Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Addplot with a variable from OnRender

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

    Using Addplot with a variable from OnRender

    Hello,


    I tried to create a line in the chart with AddPlot Value[0] = variable;

    My class variable is from OnRender but only the last value of the values from the variable result will show in the chart. You will reply move your code into OnBarUpdate but is there a way i can keep the variable in OR class and send it to OBU?

    Its working if i draw horiz or vert line i just send the variable from OR to OBU and it does the job.

    Thank you

    #2
    Hello frankduc,

    Thanks for your post.

    Plots have a Series<double> associated with them which is relative to the bars on the chart. Series values should be assigned in OnBarUpdate.

    OnRender should be used for custom rendering what is visible on the chart alone. If you want to draw a line in OnRender, use SharpDX instead of assigning plot values.

    To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.

    https://ninjatrader.com/support/help..._rendering.htm

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    71 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X