But I only want the Process.Start command to run if there are no pending orders and the market position is flat.
I tried as below but get "Error on calling 'OnBarUpdate' method on bar 6304: Object reference not set to an instance of an object."
//Add your custom indicator logic here.
if(State == State.Historical)
return;
if (accountPosition.MarketPosition == MarketPosition.Flat)
{
//Print(string.Format("{0} accountPosition.MarketPosition"));
Process.Start(@"C:\Users\paulb\Documents\MyNTstuff \runmacro.bat");
}
Thanks
Comment