I'm not a programmer, but have some skills in this area and have been helping a trader develop a custom indicator and now I am trying to hook it up to an automated strategy to backtest it. The strategy reverses in one of two ways: (1) a signal is violated during a bar and an order to reverse is submitted (EnterLong/Short @ market) the next day or (2) the bar moves through a stop loss point and triggers a stop and reverse (these are typically 5-10 ticks from our signals). Along the way, the stop loss price gets modified as the trend lengthens.
I have been advised to use unmanaged orders and now (by ninja support) quasi-managed orders (highly overloaded and provided an orderid ...e.g., .stopLoss = EnterLongStop(.........). Within OnBarUpdate I am evaluating incoming bars against my indicator values and trading rules and enter a first position, reverse a position, or amend a stop/reverse order. I am creating the stop/reverse order in OnExecutionUpdate. I have some processing going on in OnOrderUpdate (primarily setting orderids to null for unfilled or cancelled orders).
Everything seems to work through the first pair of EnterLong or EnterShort and EnterShort/LongStops, after that first entry and reverse everything seems to fall apart. The tendency is to get gaps where for some reason instead of exiting the position and reentering in the other direction, it simply exits.... Does anyone have any suggestions for coding this? Should I go back to coding unmanaged order entries? Any advice?
If you truly need unmanaged orders, you would probably benefit from hiring the strategy done by an experienced NT programmer. Then if you want to learn to program, you can use this as a foundation going forward.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
Thanks Mike. Yes the thought of boot-strapping had occured to me as I have used it often. In fact, my plan was to get the backtesting done and then sub it out for the automated trading. I was hoping that the real complexity of unmanaged orders lies in the error and message trapping required for automated trading and not the mere submission of orders into a historical backtest.
Since I had been advised by NT Support that alternatively either managed or unmanaged orders would work, I was hoping that someone could confirm which was really true.