I wrote schedules when the order should be closed! that is, time to exit the market.
question where to put this code ??
if((exitSesion1 && ToTime(Time[0]) >= end_time && ToTime(Time[0]) <= start_time_1) || (exitSesion2 && ToTime(Time[0]) >= end_time_1 && ToTime(Time[0]) <= start_time_2))
{
ExitLong();
ExitShort();
CancelOrder(entryOrder1);
CancelOrder(entryOrder2);
}
OnBarUpdate is not correct as the work on closing the bar and the strategy works a long interval or long renko
Comment