I'm coding a strategy where I only want the stops and profit targets to work during certain times, even though I'll have positions on at other points in my strategy.
For example, the strategy enters a position on the close and holds it overnight. The following day, I don't want the stops to work prior to 841 AM and not after 3:00 PM.
How would I code this time limitation for the SetStopLoss() function (where time >= 841 & <=1500)?
Thanks in advance.

Comment