Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiTime Frame setup

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

    MultiTime Frame setup

    Team,

    I have default chart:

    chart (default) timeframe: 10min // always smaller timeframe compared to superior timeframe

    superior timeframe: 40min // custom parameter I can change

    So based on these I have some below operations

    1) when I access this.Currentbar will that be defaulttime frame value or superior timeframe value

    2) base.High[1] ==> will this be default time frame or superior timeframe

    3) do I need to
    AddDataSeries(BarsPeriod.BarsPeriodType, 40); // 40min
    AddDataSeries(BarsPeriod.BarsPeriodType, 10); // 10min

    4) do I need to add
    AddPlot(new Stroke(Brushes.Green, DashStyleHelper.Solid, 5), PlotStyle.TriangleUp, "EnterLong");
    AddPlot(new Stroke(Brushes.Purple, DashStyleHelper.Solid, 5), PlotStyle.TriangleUp, "SuperiorEnterLong");


    My final goal is to have single chart with 2 timeframes on it. I could do it by adding indicator twice on chart. But I don't to go that route.

    I have some code, which I cannot share, what is the best way to walk through?
    Last edited by surya; 03-21-2021, 07:40 PM.

    #2
    Hello surya,

    Thank you for your post.

    1) when I access this.Currentbar will that be defaulttime frame value or superior timeframe value

    this.CurrentBar will refer to the primary (default) time frame that your script is enabled on.

    2) base.High[1] ==> will this be default time frame or superior timeframe

    base.High[1] will refer to the previous bar High for the primary (default) time frame. To refer to the added secondary time frame you could use Highs[1][0].

    Highs - https://ninjatrader.com/support/help.../nt8/highs.htm

    3) do I need to
    AddDataSeries(BarsPeriod.BarsPeriodType, 40); // 40min
    AddDataSeries(BarsPeriod.BarsPeriodType, 10); // 10min


    A script will run on the primary data series that it is enabled on. AddDataSeries() would be used to add a secondary data series to your script. For example, if you would like the 10-minute data series to be the primary series, you would simply enable your script on a 10-minute data series. Then, you could add a secondary 40-minute data series to your script using the AddDataSeries() method.

    AddDataSeries - https://ninjatrader.com/support/help...dataseries.htm

    4) do I need to add
    AddPlot(new Stroke(Brushes.Green, DashStyleHelper.Solid, 5), PlotStyle.TriangleUp, "EnterLong");
    AddPlot(new Stroke(Brushes.Purple, DashStyleHelper.Solid, 5), PlotStyle.TriangleUp, "SuperiorEnterLong");


    As stated in the Tips section of the help guide documentation below, for MultiSeries scripts, plots are synched to the primary series of the NinjaScript object.

    AddPlot - https://ninjatrader.com/support/help...t8/addplot.htm

    Also, see this help guide documentation for more information about working with Multi-Timeframe and Multi-Instrument scripts - https://ninjatrader.com/support/help...nstruments.htm

    Please let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    657 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    373 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X