Memphis,TN
Posts: 3 since Jan 2011
Thanks Given: 0
Thanks Received: 0
|
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?
|