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 kempotrader, Today, 08:56 AM
      0 responses
      7 views
      0 likes
      Last Post kempotrader  
      Started by kempotrader, Today, 08:54 AM
      0 responses
      4 views
      0 likes
      Last Post kempotrader  
      Started by mmenigma, Today, 08:54 AM
      0 responses
      2 views
      0 likes
      Last Post mmenigma  
      Started by halgo_boulder, Today, 08:44 AM
      0 responses
      1 view
      0 likes
      Last Post halgo_boulder  
      Started by drewski1980, Today, 08:24 AM
      0 responses
      4 views
      0 likes
      Last Post drewski1980  
      Working...
      X