Since I've read here that there's an issue, that sometimes NT doesn't execute properly the ExitOnClose on positions that an automated Algo might have, I've tried to create my own sub-routine. For example, this simple one:
if(ToTime(Time[0]) >= 165500 && ToTime(Time[0]) <= 171450)
{
ExitLong();
ExitShort();
return;
}
It seems that it could do its job, but I've realized an obvious problem: since my Algo works on range bars under CalculateOnBarClose=True, it never closes the position in the last bar because the Algo doesn't know which bar will be the last one until it's a closed bar. The problem is that I can't work with CalculateOnBarClose=False, so, questions:
1. Is already solved and reliable the procedures ExitOnclose and the general Faltten-All for an automated Algo? if so: Should I use it both as true at the same time in order to have more guarantee to ExitOnClose properly, or is it better just one?
2. If not: what changes could I do to my sub-routine in order to solve that situation?
Thanks
Comment