I'm looking for the easiest way to fix any specific exit order to an entry order, for the formation of NT's order pairing in it's trades-reporting.
Specifically I need to perform the following (backtesting functionality):
1. Buy at the open of Daily bar, and/or on a limit price.
2. Have a stop order for each entry that may trigger on the same (entry) bar, or later bars.
3. When a stop is hit, it should create a trade that references it's corresponding entry order, and not the first open entry. *
* This will often be the last entry, if using fixed sized stops. So linking last exit to last entry will be helpful. But ideally, to work for variable stops, it should link to specific entry order.
I can use unmanaged mode, or 3rd party, e.g. LOM, if needed. Hard coding orders is also acceptable if this function exists. Just looking for simplest solution at the moment that allows for controlling the trade "pairing".
Note this need not to work for live trading, as it is currently for statistical purpose.
Comment