I have an an automated strategy that uses SetExitOnClose and a custom session, ending 5 minutes before the close. Chart time frame is 15 min. It works fine in back testing of course but on it's first live trade, it did not exit as expected. The session for Coffee-KC, closes at 13:30 EST. I created a session that closes on trade day (once a week) at 13:25, and then simply coded
Code: Select all
if markeposition <> 0 then setexitonclose;
Right now I am trying the following:
Code: Select all
if Marketposition = -1 and time >= 1316 {using 15 min chart} then
Begin
buytocover("EOD_SX") this bar Close;
End;
Any advice is greatly appreciated. Thank you!
Tony