I'm trying to write a very simple breakout strategy, just to get started with NT scripting, but I'm kinda stuck. Hope you guys can answer me some of my questions.

1.) I'd like to submit a single order above the current bar and if, at the end of the bar's time, it's not filled (because price level was not hit) I'd like to move the order to some other price level. My first approach was to use AtmStrategyCreate() and AtmStrategyChangeEntryOrder() to create and change my order and then have my stop loss, breakeven and auto trail managed by a custom ATM strategy. This works well as long as I'm not running this strategy in the strategy analyzer. ATM strategies do not work on backtests. This would be my first question: Why not? How am I supposed to test and optimize my strategy then? I could use market replay and manually see how my strategy performs, but that doesn't seem very desirable to me.
2.) My next approach was to have a look at the 'managed approach order methods'. These would probably work on a backtest (as far as I understand), but they do not support a ChangeOrder() method. I've found somewhere on the forums that the recommended way to change my order is to first cancel it and then submit a new order at the new target price. I haven't tested this, because it just doesn't feel right. Why should I first cancel an order and then submit a new one, when I can simply change my existing order?
3.) I then had a look at the 'unmanaged approach'. This approach offers a ChangeOrder() method, but no order management at all (as the name says...). I would have to implement it myself. This is not a problem in general, but I would end up programming exactly what your ATM strategies are allready capable of. Again, this doesn't feel right.
I hope I could make myself clear and you can show me a best pratice solution for my problem. Also, I'm curious to find out why ATM strategies do not work on backtests. Would have been so easy..

Kind regards,
Kai


Comment