Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

2min candle on a 30min chart indicator question

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

    2min candle on a 30min chart indicator question

    I have a very simple indicator that I've added to my 2min chart that basically plots the open to the 1hr range. (8:30 CST to 9:30CST) The yellow and Blue horizontal bars. It works great on 2min chart but I want to be able to put that same setup on the 30min chart but so that it follows the 2min chart style. If I put it on the 30min time frame it take the entire 8:30 bar candle and then the entire 9:30 bar candle on 30min chart. I want it to be the same size as it is on the 2min chart. I tried doing a multi-data series chart and add the indicator but move it to the 30min chart but it won't show up at all.

    Is there a parameter I need to add to the code to be able to do this or another approach? Its a very simple indicator just missing something here.

    I'm trying to get the Y value from the time at 8:28am CST to 8:30am CST and use that as the high and low or the y values to draw the rectangle.

    Code itself:

    Code:
    protected override void OnBarUpdate()
    {
    
    
    
    if(ToTime(Time[0]) == ToTime(8,30,0) ) {
    
    Draw.Rectangle(this, "startTime" + CurrentBar, false,Time[0], Low[0] - TickSize, new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 15, 0), High[0], Brushes.Transparent, Brushes.Yellow, 30);
    }
    
    
    if(ToTime(Time[0]) == ToTime(9,30,0) ) {
    
    Draw.Rectangle(this, "startTime" + CurrentBar,Time[0], Low[0] - TickSize, new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 15, 0), High[0], Brushes.Transparent);
    }
    
    
    
    
    
    }
    Attached Files
    Last edited by vegas3416; 06-05-2022, 11:10 AM.

    #2
    Hello vegas3416,

    I'm not quite sure what you are meaning by same size as the 2 minute chart.

    The 2 minute chart is going to have many more bars for that hour period than the 2 30 minute bars.

    The rectangle can be drawn on as few as two consecutive bars.

    Have you added both a 2 minute series and a 30 minute series to the same panel on the chart?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    653 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 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
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X