Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I update values in DataBox using OnRender?

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

    How can I update values in DataBox using OnRender?

    1. I added new plots in OnStateChange for State.SetDefaults case:

    AddPlot(new Stroke(Brushes.Green, 1), PlotStyle.Line, "LongLevel");
    AddPlot(new Stroke(Brushes.Red, 1), PlotStyle.Line, "ShortLevel");

    2. I added theese plots at the end of my code to see they in DataBox window:

    [Browsable(false)]
    [XmlIgnore]
    public Series<double> LongLevel
    {
    get { return Values[0]; }
    }


    [Browsable(false)]
    [XmlIgnore]
    public Series<double> ShortLevel
    {
    get { return Values[1]; }
    }

    3. I set the value like this (in OnBarUpdate):
    Values[0][0] = x;
    Values[1][0] = y;

    But when I open the window DataBox - I see inly n\a values. What do I wrong?

    PS
    I use OnRender in my indicator to render graphic elements.

    #2
    Hello handlar,

    I wanted to check are you seeing n/a for all bars on the chart or is this related to the current bar / random bars when you move the mouse around? Generally, N/A is reported for bars which do not have a value set.

    You may try making a more simple test and exclude any extra logic you have and just set the plots from OnBarUpdate for every bar. You could just use the close price and open price as a test, if you are able to now see the values instead of N/A that would indicate something with the logic used being at fault.

    If you can upload a simple indicator that demonstrates the problem as a test, we could work together on that as well.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X