Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

General MTF question

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

    General MTF question

    Hi there,

    I am creating a panel that plots current values of my indicator on several different timeframes.

    I am using the Add() as per NT advice. I am adding 3min, 10min, 30min, 90min, 360min, Day, Week, Month within the initialize section. I am using a 1 minute chart to display these.

    I have no problem plotting the indicator values of anything that is based on minutes and days, however the Week and Month values are not accurate. They either plot 0 (zero) or a maximum value.

    I have 2 questions:

    1. I have set the 1 min chart to 60 days. Is this necessary or do all the necessary data download as much as they need irrespective of the 1min chart days loaded? In other words could I load 10 days on my 1min chart and still have the Month indicator plot correctly?

    2. Is there a way that I can get my indicator to guarantee a certain number of bars for my week and Month data?

    Please see the image. The daily and weekly bars are correct but not the monthly bar.

    Thanks in advance.
    Attached Files

    #2
    Sim22, you would need to load as much data for the primary series so you can pass the BarsRequired for all series (for an indicator the default is 20 bars, could be set in Initialize() though). You can check the CurrentBars processed in OnBarUpdate for example and only do your calcs if a certain # of bars have been seen, thus ensuring the data you need is actually present.

    :https://www.ninjatrader.com/support/...urrentbars.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      So, in other words if I wanted to plot monthly bars I would need to set , for example, my primary series to several hundred days. Correct? That is insane especially if it is a 1 min chart. I will have to do a workaround.

      If I set my primary series to 1440min bars/700 days back, for example, would that allow my 3, 10 or 30 min series to update tick by tick correctly, despite my primary series being a higher timeframe? And if that worked does that mean the secondary 3, 10 or 30 min series would each load up the equivalent of 700 days?

      I have added the code:

      Code:
      if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
              return;
      ....but I think I might have to add more bars required.

      Sorry for the questions but I want to get it right
      Last edited by Sim22; 07-08-2014, 04:37 PM.

      Comment


        #4
        You are correct in understand here, it goes by the primary series (either via the range / days or bars you load up). More flexibility is on our feedback list for consideration in the next major platform update. For the tick updates, that would be correct for realtime / replay yes. For backtesting you would always have CalculateOnBarClose == true for all series.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,222 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        438 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        10 views
        0 likes
        Last Post FAQtrader  
        Working...
        X