PDA

View Full Version : Multi-Time Frame Order Delay


darckeen
08-03-2009, 12:17 PM
I'm using a strategy that has multi time frames of the same instrument. CalculateOnBarClose = true, the primary time fame is the smaller, i.e. 1min. the secondary time frame is larger i.e 60min. I'm evaluating an indicator in the secondary time frame and entering the trade on the primary time frame. My problem is that when a bar in the secondary time frame evaluates true and I EnterLong() the order executes one bar late in primary time frame.

For example, if in the 60 min time frame in the 8:00 bar i EnterLong() the order executes at the opening price of the 8:02 bar. I'd like to have the order execute at the open of the 8:01 bar.

NinjaTrader_Josh
08-03-2009, 12:36 PM
darckeen,

You will need to swap your bars to have primary as the larger time frame series.

darckeen
08-11-2009, 01:58 AM
Ok, I think I understand why the primary bar needs to be bigger. Another question, is it possible to create a strategy that trades multiple instruments?

NinjaTrader_Bertrand
08-11-2009, 06:03 AM
darckee, yes this is possible as you can direct the order execution to different bars objects / instruments - http://www.ninjatrader-support.com/HelpGuideV6/MultiTimeFrameInstruments.html

darckeen
08-13-2009, 06:48 PM
Ok i've got a multi instrument strategy working and was wondering if there is anyway to visualize the trades for individual instuments other then the primary instrument in the strategy analyser chart pane.

NinjaTrader_Bertrand
08-14-2009, 03:36 AM
darckeen, it would probably be easiest to print 'Positions' to the output window for this - http://www.ninjatrader-support.com/HelpGuideV6/Positions.html

NinjaTrader 7 will offer a more detailed 'Strategies' tab for this - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html

darckeen
08-24-2009, 01:56 PM
Thanks for the help so far. A few more questions:

With a multi instrument strategy in backtesting the order of OnBarUpdate() always seems to go in the order that the instruments were Add() to the strategy. Will this hold true in live trading provided UpdateOnClose = true?

Also is there anyway to implement SetStopLoss() and SetProfitTarget() in another BarsInProgress?

NinjaTrader_Josh
08-24-2009, 02:19 PM
darckeen,

When running a strategy live it doesn't matter what order you add them in. The events trigger in the order the data is received. If the primary is received first, then that will trigger first.

Set() are not tied to specific BarsInProgresses. They just work off the data. If price touches or passes the Set() order then the order will try to fill.

darckeen
08-28-2009, 06:27 PM
Is it possible to access Performance by BarsInProgress or Instrument?

NinjaTrader_Austin
08-29-2009, 02:18 PM
Hi darckeen, I don't think there is a specific overload to access Performance by BIP or Instrument, but I can think of a workaround.

You can use Trade class (http://www.ninjatrader-support.com/HelpGuideV6/TradeClass.html) to get trade information and then match the instrument provided in the IExecutions (http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?IExecution) information for entry/exit.

Anyways, I'll leave this open so Josh takes a look at it on Monday to confirm.

NinjaTrader_Josh
08-31-2009, 07:07 AM
Unfortunately there is no filtering to the BarsInProgress or instrument level.