i am using Swing Indicator to get the previous High, however, there is an issue, apparently.
if you see screenshot, although there is a new Swing High and the data box shows the correct value, when asking for
SwingHigh[0] i am getting an old Previous High, you can see that in the log output
is there something wrong with my code?
i am just saving the SwingHigh[0] at the moment of the entry signal in a variable and then comparing the Close[0] if it is above or below I exit the position
Entering Short
EnterShort(Position.Quantity * 2, "GoShort");
PreviousMaxPosHigh = Swing1.SwingHigh[0];
if (Position.Quantity >= MaxPositions && Close[0] > (PreviousMaxPosHigh))
{
ExitShort("Loss Max Position Hit", "GoShort");
Print(Time[0].ToString() + " EXITING AT A LOSS - MAX POSITION REACHED AND DID NOT REVERSE TO THE EMA 100");
}
OR PERHAPS there is a better way to get the Previous High and Low?
Thanks
Comment