Exit code is as follows:
switch(Position.MarketPosition) { case MarketPosition.Short: if (ToTime(Time[0]) >= 50000) Print("Time is " + Time.ToString()); Print("Exiting SHORT Position"); ExitShort(shares,"ES", "E1"); // ES is name of exit and E1 is the entry name // ExitShort(int quantity, string signalName, string fromEntrySignal) break; case MarketPosition.Long: if (ToTime(Time[0]) >= 50000) Print("Time is " + Time.ToString()); Print("Exiting LONG Position"); ExitLong(shares,"ES", "E1"); // ES is name of exit and E1 is the entry name // ExitShort(int quantity, string signalName, string fromEntrySignal) break; }
Comment