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

BuySell Indicator missing for some bars

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

    BuySell Indicator missing for some bars

    Hi,

    I have built a strategy on top of the stock BuySell indicator that Ninja Trader distributes. The indicator seems to run fine if I manually add it to it's own chart, but when I make it part of my strategy, it will eventually start missing for some bars. I've attached a screenshot, where you can see gaps between the histogram plots for the indicator, there should be one for every bar, but isn't.

    Both indicator and strategy calculate OnEachTick.

    Do you have any idea what can cause this sort of behavior?

    I attached the strategy code, there's not much too it.

    Thanks!
    Attached Files

    #2
    FWIW - I also have a very simple indicator called BarNumbers which prints the BarIDs above the bar that also stops working after a while. Once it stops, it never restarts though unlike the BuySell which will resume working.

    The entirety of the BarNumbers indicator is -
    Draw.Text(this,"bar number" + CurrentBar, CurrentBar.ToString(), 0, High[0] + 15 * TickSize);


    I am much more concerned with the BuySell indicator obviously, just providing this for more context if it helps.

    Comment


      #3
      Hello NickyD,

      Thank you for your post.

      The BuySellVolume should plot on each bar regardless of the bar type. In your screenshot is this a live chart or one built in Playback? If this is a live chart are you using Tick Replay?

      In addition, please send me your log and trace files so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Email Support. Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

      Please list 'ATTN: Patrick H' in the subject line and reference this thread in the body of the email.

      I look forward to your response.

      Comment


        #4
        Hi Patrick, I just sent that email. As to your questions:

        The screen shot was from a live chart.

        Tick Replay is enabled on the chart, yes.

        Comment


          #5
          For the sake of the thread, here's the answer Patrick ended up digging up:

          This behavior is due to the OnBarUpdate() function not called as soon as needed in the hosted indicator. To ensure the indicator is properly called in OnBarUpdate please ensure to use the Update() function on the indicator. For example:
          private BuySellVolume bsv;
          ...
          if (State == State.DataLoaded)
          {
          bsv = BuySellVolume();
          AddChartIndicator(bsv);
          }
          ...
          protected override void OnBarUpdate()
          {
          // call update on the indicator in OnBarUpdate first
          bsv.Update();
          }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jclose, Today, 09:37 PM
          0 responses
          4 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,413 views
          0 likes
          Last Post Traderontheroad  
          Started by firefoxforum12, Today, 08:53 PM
          0 responses
          10 views
          0 likes
          Last Post firefoxforum12  
          Started by stafe, Today, 08:34 PM
          0 responses
          10 views
          0 likes
          Last Post stafe
          by stafe
           
          Started by sastrades, 01-31-2024, 10:19 PM
          11 responses
          169 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X