Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot data is showing in Data Box but Printing as 0 to Output window

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

    #16
    Hello Ray12345,

    This is Jim responding on behalf of Chelsea who is out of the office at this time.

    I am not sure I am following what you are trying to do. Could you please elaborate if this does not resolve your inquiry?

    If you reference barsAgo 0 I.E. SMA(20)[0] or MACD(1,1,1).Diff[0], we will be referencing the plot value associated with the current bar. If you want to save that bar number, you can assign CurrentBar to a class level variable and then subtract it from CurrentBar. I.E. SMA(20)[CurrentBar - YourSavedCurrentBarValue]

    We look forward to assisting.

    Comment


      #17
      Hi Jim

      I have got an indicator that plots on the bar before the bar it is calulated on. It does not plot a value on every single bar. When I call that indicator and it's parameters it gives 0 for the data. it displays correctly in the databox. To get around that I have created an additional plot in the original indicator after the plot is created. ie. Plot[0] plots on the original indicator and Plot[1] is required so that the data can be called and used from the other indicator. i have just coloured it transparent so it doesn't plot twice on the original indicator. So I dont have a problem using the data in the calling indicator. The data is just printed to the output window on the bar after it does on the data box which is the bar that it is calculated from (after it closes). So no problem so far as I can use it in an if statement to do calculations on the calling indicator.

      The problem I have know is that I also need the bar number from the plot to use in an if statement. Does that mean I have to go back to the original indicator again to do another plot for the bar number (CurrentBar -1) so I can use the bar number in the calling indicator if statements. So I will have a coloured plot on the original indicator with two transparent plots for the data value and the bar number.

      It just seemed like a messy way of programming and using ram but if it is the only option it is not a problem. I was just confirming if it was the normal way of doing it.
      Last edited by Ray12345; 12-26-2020, 03:40 AM. Reason: It is ok. I worked out I can get the bar number during BarUpdate in the Calling Indicator.

      Comment


        #18
        Hello Ray12345,

        A transparent plot sounds like it should just be a Series<double> instead of a plot.
        Do you need a second plot, as in you need to save a full series of custom double values for every bar on the chart?
        Are you duplicating information instead of using the original object?
        Do you just need to save one double value to a double variable?
        Do you need to save a bar number to an int variable?

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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