When running historically, i would like the strategy to exit, but when this exit is encountered in real-time, I want it to be ignored.
I tried this:
protected override void OnBarUpdate()
{
//load a 1 minute chart ES 09-08 with only 1 day history
if (Historical)
{
if (ToTime(Time[0]) == 120000)
EnterLong();
if (ToTime(Time[0]) == 120500)
ExitLong();
}
}
I'm basically trying to have an entry that I use each day but just use the exit virtually-- just to force the strategy to think it is flat after some arbitrary time ONLY IF the exit bar is a historical bar.


Comment