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

.Reset() plots close values, not null values

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

    .Reset() plots close values, not null values

    Hello,

    I am working on an indicator that plots the low of the day, if that day’s low is lower than the previous day’s low.

    Specifically, a day’s low is added to a DataSeries if the day makes a lower low. If the day doesn’t make a new low, the DataSeries stores a null value using the .Reset() method.

    The problem I am experiencing is that the .Reset() method doesn’t seem to be setting a null value. When the indicator is added to a chart, the instances where a null value is expected are plotted on the chart as the day’s Close Value. I have checked my code and cannot see a reason why it is plotting the Close.

    The indicator is attached.

    For the sake of clarification, I have also attached and a .gif showing the indicator as it currently plots and also showing how I would like it to plot.

    Is there anyway to achieve the desired indicator plot (as shown in the .gif).

    Many thanks.
    Attached Files

    #2
    Hi ninja.man, please check this link - http://www.ninjatrader-support.com/H...iesObject.html

    The Reset() method will differentiate between 'visualization' and 'plotting', meaning the null value will be stored internally for calculations, but is not used in plotting as this may not be visually appealing.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello Bertrand,

      I looked through that page in the hope of finding a solution before I posted on the forum, and modeled my code specifically on what that page contains--still I am getting a plot at the close of the day, rather than a null value. Perhaps if you have the time you can take a minute to review the code in the indicator I posted. It is very simple and should take just a moment to see where the error is. I myself have triple checked it, but as I am not a programmer, I do not see where I am making the mistake!

      Comment


        #4
        There is no mistake, the difference is just the null value is stored internally and not used for actual plotting of the indicator.

        You may want to check this reference sample for an idea how to connect Plots with the DataSeries object - http://www.ninjatrader-support2.com/...ead.php?t=3227
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Irukandji, Today, 04:58 AM
        0 responses
        2 views
        0 likes
        Last Post Irukandji  
        Started by fitspressoburnfat, Today, 04:25 AM
        0 responses
        2 views
        0 likes
        Last Post fitspressoburnfat  
        Started by Skifree, Today, 03:41 AM
        1 response
        4 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        604 views
        0 likes
        Last Post NinjaTrader_Jason  
        Working...
        X