Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get indicator in AddDataSeries

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

    Get indicator in AddDataSeries

    Hello,

    I used time ago to get Indicator values in Multi Time Frame adding BarsArray[] and it worked.

    Now I have a problem but I do not understand why:

    I add DataSeries and indi in Data series 2:
    PHP Code:
    else if (State == State.Configure)
    {
    
    AddDataSeries(_hist_1, TF1Type, TF1Period);
    AddDataSeries(TF2Type, TF2Period);
    AddDataSeries(TF3Type, TF3Period);
    AddDataSeries(TF4Type, TF4Period);
    
    //Delta1= OrderFlowCumulativeDelta(Close, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);
    Delta2= OrderFlowCumulativeDelta(BarsArray[2], NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);
    
    } 
    

    And then I draw a line in max/min in panel2 (BarsInProgress == 2 is 60 min)
    PHP Code:
    if (BarsInProgress == 2) // 60 min.
    {
    if(IsFirstTickOfBar)
    {
    Draw.Line(this, "HLH2_Tf1"+ CurrentBar.ToString(), false, Time[0], Delta2.DeltaHigh[1], Time[1], Delta2.DeltaHigh[1], Brushes.Yellow, DashStyleHelper.Dot,1, false);
    Draw.Line(this, "HLL2_Tf1"+ CurrentBar.ToString(), false, Time[0], Delta2.DeltaLow[1], Time[1], Delta2.DeltaLow[1], Brushes.Yellow, DashStyleHelper.Dot,1, false);
    } 
    

    Finally all work fine but the value High/Low are not of the 60 min candle, they are of the 1 min chart (it seems refers to BarsInProgress == 0), the chart I'm viewing.

    Click image for larger version

Name:	3NtForum_1.jpg
Views:	380
Size:	289.5 KB
ID:	1191149

    Could you help to understand why ...what is wrong please?

    Thanks. Caudio


    #2
    Hello ClauTrade,

    Thanks for your post.

    Is the additional code added for updating the indicator from the 1 tick data series?

    Please see the attached example script that demonstrates OrderFlowCumulativeDelta being applied to an added 1 Tick series and drawing a line on the chart at the DeltaClose value of the 1 Tick series.

    Also, see the help guide documentation below.
    OrderFlowCumulativeDelta: https://ninjatrader.com/support/help...ive_delta2.htm
    Draw.Line: https://ninjatrader.com/support/help.../draw_line.htm

    Let us know if we may further assist.
    Attached Files
    <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
    646 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X