I'm aware there are 3 ways to flatten positions at close and cancelling all active orders, here:
1. Provided by NT :
Tools--> Options--> Misc--> Check box Flatten all
2. NT Statement that is called as following:
protected override void Initialize() { ExitOnClose = true; ExitOnCloseSeconds = 5; }
if ( Bars.BarsSinceSession < BarsRequired || ( ToTime(Time[0]) >= 165950 && ToTime(Time[0] ) <= 171456 ) ) { ExitLong(); ExitShort(); return; }
Thanks
Comment