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 Max238, Today, 01:28 AM
      1 response
      22 views
      0 likes
      Last Post CactusMan  
      Started by giulyko00, Yesterday, 12:03 PM
      2 responses
      10 views
      0 likes
      Last Post giulyko00  
      Started by r68cervera, Today, 05:29 AM
      0 responses
      4 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      6 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      38 views
      0 likes
      Last Post JonesJoker  
      Working...
      X