Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem plotting indicator Cumulative Delta when running live

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

    Problem plotting indicator Cumulative Delta when running live

    Hi,
    I am developing an indicator Cumulative Delta Volume for NT8.
    When loading Market Data through Playback Connection it worked perfectly.
    The problem is when I run Playback "live", or even at Simulated Data Feed. I did not test at on-line account (SIM101 or Real Account) at NT Continuum, but I suspect the result will be the same.
    I based this indicator on HeikenAshi for NT8, version April 2018, available on Ecosystem, wich I found a reference at this Forum.
    My indicator considers the mounting of Open, High, Low and Close as Heiken Ashi formulation, but the difference is that the Open and Close of each bar is a cumulative formula for plotting the next bar. It uses basicaly State.SetDefaults, OnBarUpdate and OnRender() (copied from HeikenAshi indicator).
    In each bar a delta is calculated and summed for next bar.


    This file attached "NT8 - plot OK after loaded data (or Reload Ninja Script).JPG" is the correct appearence, when I load a market data.

    But when running Playback, this is the result...

    File attached "NT8 - Problem on Running playback.JPG"

    If I Reload Ninja Script at panel, chart stays ok.


    I´ve tried Calculate method ".OnBarClose", but it does not matter if I use it or ".OnEachTick" at State.SetDefaults. And I don´t know why!

    It seems that for each iteration at OnBarUpdate() it keeps calculating the cumulative delta, instead of doing this only at Bar Close. As Volume is a factor multiplying the delta at formula, the values of bars are updated at each tick or price change and plotting is updated very distorted.

    Please, I need some light here. A help on how to make it work on running "live", as it is by simply loading data.


    Thanks and best regards,
    Marcos
    Attached Files

    #2
    Hi Marcos, thanks for posting.

    Do you have a test file that is reduced to demonstrate the problem? I will need you to reduce the script down to only demonstrate the data loading issue and Export it and post the .zip file here for me to test.

    Best regards,
    -ChrisL

    Comment


      #3
      Hi Chris.
      Thank you very much for your quick answer.

      I have exported only the indicator (CDV) to a .zip file, as requested. I hope this is what you´ve asked.
      Please let me know if you need something different or something else.

      Thanks again.
      Attached Files

      Comment


        #4
        Hi Marcos, thanks for your reply.

        I can not use the indicator because it has the error:
        Indicator 'CDV': Error on calling 'CalculateMinMax' method on bar 5519: The calculation results in unrenderable values.

        This means the plots are producing "NaN" or not a number, or a very small number.

        I would first recommend using Print() to print out the data you are processing so you can see the difference in values between historical and real time. Also, turn on Tick Replay in the data series menu (if you do not see it, enable it in Tools>Options>Market Data). Test the indicator again with tick replay enabled + OnEachTick calculation.

        Kind regards,
        -ChrisL

        Comment


          #5
          Thanks Chris.
          Well, turning Tick Replay in data series menu and enabling OnEachTick calculation had no result to the problem. I mean, nothing changed.

          I understand that the error message "Error on calling 'CalculateMinMax'..." is a consequence because the bars being calculated in real-time, in indicator panel, have a great difference in amplitude related to the previous bars plotted when I loaded historical data in Playback Connection.
          As I said before, the problem happens when I click play and run the Playback (or other real-time connection).

          It seems that on each tick (in Playback mode I would say each second when running), the calculation is being made at OnBarUpdate, and the cumulative values, ruled by the indicator formulas, are being applied. Instead of applying the calculation only at bar close.
          So I really do not understand why it calculates on each tick, and not at the bar close, once I have specified the Calculate.OnBarClose calculation.

          I think that is the problem.

          Best regards,
          Marcos

          Comment


            #6
            Hi Marcos, thanks for your reply.

            You will need to use Print() in your script to print out the data to confirm if it is running OnBarClose or OnEackTick. Also, if your script is adding a 1 tick data series, that would replicate OnEachTick behavior even if calculated is set to OnBarClose.

            Best regards,
            -ChrisL

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            566 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            547 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            548 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X