Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Minute Time Frame Indicators in a TickTime Frame strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Minute Time Frame Indicators in a TickTime Frame strategy

    I would like to use a 1-minute indicator (for stop/limit values) in a tick timeframe strategy, both on the same instrument. The indicator values should only be updated once every minute.
    e.g. FDAX, tick timeframe and a SMA(10) on a 1 minute period FDAX => SMA Value is updated only once a minute.

    When I add a 2nd bar object to the strategy:
    Code:
    Add(PeriodType.Minute, 1);
    Add(SMA(10));
    This object will updated on every tick, even if I limit the OnBarUpdate() to the underling instrument on the ticktimeframe with
    Code:
    if (BarsInProgress != 0)
     return;
    It is the same with the example strategy:
    When I add the SampleMultiTimeFrame strategy that is provided with NT 6.0.0.10 to a ticktimeframe chart two SMAs are plotted which are updated several times in a single minute. In the strategy code they a defined as a 5 minute SMA and a 50 minute SMA.

    Did I misunderstood something? Why is the SMA updated on every tick?

    #2
    imported post

    Indicators in a strategy are updated according the CalculateOnBarClose property of the strategy holding the indicators.

    a) if the strategy has CalculateOnBarClose=True, then the indicators will run with CalculateOnBarClose=True
    a) if the strategy has CalculateOnBarClose=False, then the indicators will run with CalculateOnBarClose=False
    DierkNinjaTrader Customer Service

    Comment


      #3
      imported post

      I tried both CalculateOnBarClose=true and CalculateOnBarClose=false on the SampleMultiTimeFrame strategy. It looks like there is no difference, the plots are the same.

      The minute based SMA is updated on every bar close (= every tick) of the tick timeframe underlying and not on every bar close (which is every 10 minutes) of it´s own timeframe.

      How can I create an indicator that is updated only on a certain time intervall?



      Comment


        #4
        imported post

        Hmm, let's make sure we are on the same page: As you throw a strategy/indicator on a chart, it's executed once per bar for the historical part of the bars series. no matter what the CalculateOnBarClose property is set to. CalculateOnBarClose=False only is relevent for strategies/indicators running on incoming realtime data.

        Reason: On historical bars data there are no ticks. One bar only triggers OnBarUpdate once.
        DierkNinjaTrader Customer Service

        Comment


          #5
          imported post

          Sorry, maybe I did not point it out clearly.

          I use a tick time chart and I have historical tick data, so every tick is a bar.

          When I throw the strategy/indicator on this chart it is executed once per bar = once per tick. It obviosly does not matter if CalculateOnBarClose is set to true or false.

          How can I add an indicator that is updated only once per minute, to a ticktime chart or a strategy running on a tick time chart?

          Comment


            #6
            imported post

            I see. Sorry you can not visualize on chart an indicator running on a different timeframe than the chart.

            But you can add an indicator running on a minute time frame to a strategy running on a tick timeframe. If the strategy then runs on CalculateOnBarClose=false, the indicator will only calculate once per per minute.

            The docs (NinjaScript->Developing Custom Strategies->Multi Time Frame & Instrument) hold a sample on how to run indicators on different timeframe than the strategy.
            DierkNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Newtrader101, Today, 06:36 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_Spencer  
            Started by Rainmakersg, Today, 12:34 AM
            3 responses
            20 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by guidoisot, Today, 03:09 AM
            2 responses
            21 views
            0 likes
            Last Post guidoisot  
            Started by ntbone, Yesterday, 10:31 PM
            3 responses
            23 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by 7robert, Yesterday, 11:38 PM
            3 responses
            32 views
            0 likes
            Last Post 7robert
            by 7robert
             
            Working...
            X