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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      56 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      75 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      39 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      101 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X