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 NinjaTrader_BrandonH, Today, 09:55 AM
        0 responses
        5 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by AH369, Yesterday, 05:37 AM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Started by NinjaTrader_BrandonH, Today, 09:51 AM
        0 responses
        20 views
        1 like
        Last Post NinjaTrader_BrandonH  
        Started by caveat_lector, Today, 08:55 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by aligator, Today, 09:02 AM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Eleanore  
        Working...
        X