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