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

Close [0} gets oldest not newest price

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

    Close [0} gets oldest not newest price

    I did a cut and paste of another indicator but I am not seeing something. For Close[0] it is pulling the oldest close price on the chart and not the most recent.

    What is this blind person missing?

    Attached is the indicator.
    Attached Files

    #2
    The problem is you are using essentially a lookback period of 1 with DrawRay(). To accomodate this you need to ensure there is at least 1 bar on the chart.

    Replace
    Code:
    if (Bars == null)
         return;
    with
    Code:
    if (CurrentBar < 1)
         return;
    Last edited by NinjaTrader_JoshP; 01-10-2008, 02:25 AM.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh

      Bullseye!

      The cut and paste was from a market indicator that used the price ladder update section. oops.

      You have healed the blind to see once again

      Many thanks.

      Cliff

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Davide999, 05-18-2023, 03:55 AM
      4 responses
      556 views
      1 like
      Last Post kcwasher  
      Started by Stanfillirenfro, Today, 07:23 AM
      2 responses
      10 views
      0 likes
      Last Post Stanfillirenfro  
      Started by rexsole, Today, 08:39 AM
      2 responses
      7 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      6 responses
      29 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by gbourque, Today, 06:39 AM
      2 responses
      14 views
      0 likes
      Last Post gbourque  
      Working...
      X