I need to exit a trade a few seconds before the close... so I am looking at this example
Code: Select all
[intrabarordergeneration = true]
input: TimeClosePosition(0);
if (currenttime_s >= TimeClosePosition) then
Begin
RecalcLastBarAfter(1);
sell ("EOD_LX") next bar market;
buytocover("EOD_SX") next bar market;
End;
What would happen if it wasn't there?
Are there other alternatives to sending an order out based on time?
Thanks. Gordon