Announcement

Collapse
No announcement yet.

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]".

    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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      637 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      571 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X