I'm trying to modify "StopLoss" so as to create a moving "TrailStop". My goal is to move the StopLoss for every 4 pips in favor of the direction of the trade. Referencing my screenshot it seems this is not being accomplished, and I'm not sure what is being calculated by the strategy. I know that StopLoss is supposed to be evaluated on a tick-by-tick basis so waiting on "bar close" is not the problem.
The exits/stops do not seem to be happening when they should (when a bar "falls back" to a multiple of 4 pips above entry price...)
Here's the code I'm using to set (change) the StopLoss:
NOTE: "inflator2" is a multiple for the number 4, it begins at a value of "1"
if(Position.MarketPosition == MarketPosition.Long)
{
if(subsequentCounter2 == 1)
{
if(Close[0] > Position.AvgPrice + ((4 * inflator2) * TickSize))
{
TRAILPlace = Position.AvgPrice + ((4 * inflator2) * TickSize);
SetStopLoss("Condition 2 Entry", CalculationMode.Price, TRAILPlace, true); inflator2 += 1;
} //Close[0] > Position.AvgPrice + TRAILPlace (TRAILSTOP needs to be moved up...)
} //subsequentCounter2 is 1 (this position is "open"...)
} //Position.MarketPosition is Long
I was under the impression that "Position.AvgPrice" referred to the Entry price...is this not correct? Any hints appreciated...

Comment