I'm storing a global boolean variable which I set to true when I call enterLong(), and false when I call exitLong(). Same thing for enterShort() and exitShort(). When I plot the value of this variable, I'm seeing individual spikes, rather than a series of 1's that align with my trades, and 0's that align with flat periods. What am I doing wrong?

The reason I'm doing this is because I have different exit logic for trend-following trades than I do for counter-trend trades, and I can't figure out how to only run my trend-following exit logic with trend-following trades. If I could get this boolean to work I would have solution for it.

Last edited by TrumpLost; 04/18/22 06:15.