Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Time Frame Labels

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

    Multiple Time Frame Labels

    Hello, I have multiple time frame label indicator from TOS, I want to achieve something similar in NinjaTrader.

    As you see, on the main chart in the middle, on the upper left there are 1 5 15 30 60 D W M Q Y in conditional backgrounds -

    red/pink, if respective timeframe's current live bar is forming red;
    green/light green, if respective timeframe's current live bar is forming green;
    gray - if respective timeframe's currrent live bar is forming as doji (last price = open)

    I need your help recreating this indicator on NinjaTrader.

    #2
    Hello UltraNIX,

    Thanks for the post.

    What about the indicator you pictured did you need help with specifically?

    You can read about using multiple timeframes and see some examples in the following link: https://ninjatrader.com/support/help...lightsub=multi

    For coloring bars you can use BarBrush https://ninjatrader.com/support/help...htsub=BarBrush

    You would otherwise need to look at the code for the existing indicator to get a better idea of what conditions you would need to form here.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse, the main idea is to display the color of current (live) bar from various additional data series.

      Like if Close[0] of 1 min > Open[0] of 1 min, then it's green, if Close [0] = Open[0], then it's gray, if Close[0] < Open[0] then it's red.

      However, there are various considerations. In order to reflect changes real time, I suppose Calculate OnEachTick or OnPriceChange should be used, right?

      Another consideration: if the primary data series on the chart is higher than, e.g. 1 minute, I still want 1 minute color to update correctly. It is applicable to all other timeframes. Lets say chart displays 60 min candles, and I still want correct 1, 5, 15, 30 min (i.e. lowe timeframes) colors to be displayed.

      Then it comes to display. How to place all those labels into upper left corner and have the conditional background of each label based on calculations I talked about previously?

      Comment


        #4
        Hello UltraNIX,

        Thanks for the post.

        However, there are various considerations. In order to reflect changes real time, I suppose Calculate OnEachTick or OnPriceChange should be used, right?
        Yes if you want to do something based on ticks or price changes you would need to use one of those modes. OnBarClose is reserved for simply calling the code once per bar.

        Another consideration: if the primary data series on the chart is higher than, e.g. 1 minute, I still want 1 minute color to update correctly. It is applicable to all other timeframes. Lets say chart displays 60 min candles, and I still want correct 1, 5, 15, 30 min (i.e. lowe timeframes) colors to be displayed.
        That would need to be accomplished in your logic. If you need to calculate something for a different period you could use the BarsInProgress to do that. How you determine what bars to paint would be delegated by the logic you use. Being that this exists in the other platform you can likely use that to gather ideas how to approach this in a similar way.

        Then it comes to display. How to place all those labels into upper left corner and have the conditional background of each label based on calculations I talked about previously?
        You could use OnRender to do that. The indicator SampleCustomRender shows how to custom render text, you could do that for each timeframe and position it where needed in the chart.
        https://ninjatrader.com/support/help...htsub=onrender

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Austiner87, Today, 09:43 AM
        0 responses
        6 views
        0 likes
        Last Post Austiner87  
        Started by bc24fl, Today, 09:57 AM
        0 responses
        6 views
        0 likes
        Last Post bc24fl
        by bc24fl
         
        Started by b16_aln, Today, 10:18 AM
        0 responses
        2 views
        0 likes
        Last Post b16_aln
        by b16_aln
         
        Started by luisjmh, Today, 10:14 AM
        0 responses
        2 views
        0 likes
        Last Post luisjmh
        by luisjmh
         
        Started by sidlercom80, 11-30-2020, 11:52 AM
        1 response
        29 views
        0 likes
        Last Post bltdavid  
        Working...
        X