Is there a way to have stops executed on entry date?
When you place your entry, you can indicate the entry day stop as well such as:
Code: Select all
broker.EnterLongOnOpen( protectiveStopPrice )
And if you want to adjust this stop price on the entry day, based on the fill price as an example, then you could put the following in the Can Fill Order script:
Code: Select all
stopPrice = order.fillPrice + s1
order.SetStopPrice( stopPrice )
If you set the Unit stop in the Entry Order Filled script, or in the Exit order filled script, it will be available for the next day. The Can Fill Order script is the last scripts to run before the order is actually filled and the entry day protective stop checked.
You can also loop over all the orders in the Before Order Execution script if you need to do more complex processing before the orders are submitted.