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

Setting Indicator Plot values

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

    Setting Indicator Plot values

    Hi,

    Looking at the "CurrentDayOHL" indicator, I don't understand how the following is possible:
    if (ShowOpen)
    CurrentOpen[0] = currentOpen;

    if (ShowHigh)
    CurrentHigh[0] = currentHigh;

    Reading the documentation, I would expect it to be
    if (ShowOpen)
    Values[0][0] = currentOpen;

    if (ShowHigh)
    Values[1][0] = currentHigh;

    How and where is the link between Values[0][0] made with CurrentOpen[0] ? The Properties only define "get"

    Thank you.

    #2
    Hi Logicwar, welcome to the forum.

    The CurrentOpen and CurrentHigh return an array. Values[0] is the first plot, Values[1] is the second and so on. So they are returning an array, and when you reference "CurrentOpen[0]", you are getting "Values[0][0]".
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,

      Thank you for the quick reply. I have learned something.

      I didn't know that it was possible in C# by only setting a "get" property returning an array to actually modify the returned array like this without defining a "set" property pointing back to the same array for modification.

      Thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kujista, Today, 06:23 AM
      4 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by traderqz, Yesterday, 09:06 AM
      2 responses
      16 views
      0 likes
      Last Post traderqz  
      Started by traderqz, Today, 12:06 AM
      3 responses
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by RideMe, 04-07-2024, 04:54 PM
      5 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by f.saeidi, Today, 08:13 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X