Once the conditions are met, I would like the strategy to close, double
check and keep trying until those positions are really close.
Anything could fail: a broker could decline to close and there may be connection issue etc.
protected override void OnStateChange() { if (State == State.SetDefaults) { Slippage = 9999999999; } }
Somehow these do not look enough.
protected override void OnBarUpdate() { if ( //condition is met ) { ExitLong(0,Quantity,"EURUSD",""); ExitShort(1,Quantity,"GBPUSD",""); } }
Comment