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 Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      2 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,770 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      945 views
      0 likes
      Last Post spwizard  
      Working...
      X