Hi,
During automated trading, an order to open seems to cancel on the next bar if the order is not filled during the current bar. Is there a way where we can leave the order open either 1. indefinitely or 2. until the end of day?
Thanks
Yes set a flag that says your entry conditions have been met and then keep placing the order bar after bar. Not tested.
if onmarket then
flag = 0
endif
if not onmarket and (your entry conditions) and not flag then
flag = 1
entryprice = high
endif
if flag = 1 then
buy 1 contract at entryprice stop
endif