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

Problem with a Double

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

    Problem with a Double

    I am trying to use the code below to assign the average of the previous days high, low and close to a double but Im getting an error, "Cannot apply indexing with [] to an expression of type 'double'", here is the code,


    pp = (Highs[1][1] + Lows[1][1] + Close[1][1])/3;

    #2
    Hi GKonheiser,

    Thank you for posting.

    You will need to use Closes instead of Close.
    This will ensure that you are accessing the data series array for the script.

    http://www.ninjatrader.com/support/h...tml?closes.htm

    Please let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by JonesJoker, 04-22-2024, 12:23 PM
    7 responses
    40 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Waxavi, 04-19-2024, 02:10 AM
    2 responses
    37 views
    0 likes
    Last Post poeds
    by poeds
     
    Started by chbruno, Yesterday, 04:10 PM
    1 response
    44 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Max238, Today, 01:28 AM
    1 response
    24 views
    0 likes
    Last Post CactusMan  
    Started by giulyko00, Yesterday, 12:03 PM
    2 responses
    10 views
    0 likes
    Last Post giulyko00  
    Working...
    X