Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Proper way to match the same value coming from Order Flow Cumlative Delta bar mode?

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

    Proper way to match the same value coming from Order Flow Cumlative Delta bar mode?

    I created a delta variable that displays OnMarketData(). My Delta shows drastically different number than the OrderFlowCumlativeDelta Indicator in bar mode. An example right now I'm looking at mine showing a value of 1342 and the same indicator in a panel below is showing 106 both positive. Most of the time it tracks the right direction but is always much larger. If I remove the += and make it just =, it only shows 1 or 2 neg or pos.


    // Relevant Code
    protected OrderFlowCumulativeDelta CumulativeDelta;
    protected double Delta;


    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Minute, 1);
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    }


    protected override void OnBarUpdate()
    {
    Delta = 0;
    // Other code
    }


    protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    {
    base.OnMarketData(marketDataUpdate);
    if (CurrentBars[2] > -1)
    {
    Delta += OrderFlowCumulativeDelta(BarsArray[2], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0).DeltaClose[0];
    }
    }

    Thanks in advance!

    #2
    Hello jalley,

    The Orderflow indicators require the structure shown in the help guide samples. I don't see that you have done that in this sample, if you are not making the code look like the sample in the following page that may be part of the problem: https://ninjatrader.com/support/help...umulativeDelta
    The indicators need to use OnBarUpdate to call the inciator from BarsInProgress 1.

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

    Comment


      #3
      I have it resolved but not in the way the documentation shows because it doesn't update realtime. I found a way to get it to update realtime;
      Last edited by jalley; 02-26-2021, 02:53 PM. Reason: Resolved it

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ScottWalsh, 04-16-2024, 04:29 PM
      6 responses
      27 views
      0 likes
      Last Post ScottWalsh  
      Started by frankthearm, Today, 09:08 AM
      10 responses
      35 views
      0 likes
      Last Post frankthearm  
      Started by GwFutures1988, Today, 02:48 PM
      0 responses
      2 views
      0 likes
      Last Post GwFutures1988  
      Started by mmenigma, Today, 02:22 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by NRITV, Today, 01:15 PM
      2 responses
      9 views
      0 likes
      Last Post NRITV
      by NRITV
       
      Working...
      X