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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X