Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can you tell me what is wrong with my code?

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

    Can you tell me what is wrong with my code?

    Hi Programmers,

    This is my code:



    and everything looks good. When I run the code, things are working well except sometimes.

    Here is a screenshot of me debugging it. Those functions are suppose to grab the lowest and the highest value from the past 3 bars. Looking at this image, you clearly see that High[1] is actually 1.0927, not 1.0925 as the Output window is suggesting.


    #2
    Your comparison doesn't include the highest.
    You are resetting if you find another value that is higher than the current bar, which maybe lower than the highest.

    Comment


      #3
      OMG!! Yes you're right about that. I can't believe that I missed that.

      Thanks

      Comment


        #4
        Hello BernWillChris,

        Thanks for your post.

        For all NinjaTrader 8 related inquiries, please post in the NinjaTrader 8 section. (This will help us keep track of everything
        http://ninjatrader.com/support/forum...splay.php?f=57


        Try printing the High[0] without any logic sorrounding this. I'd like to know if each bar's high is printing correctly.

        Also, the MAX(ISeries, period)[barsAgo] may work better for what you are trying to do.
        http://ninjatrader.com/support/helpG...aximum_max.htm
        Last edited by NinjaTrader_ChelseaB; 08-04-2015, 11:42 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea,

          Sorry about post at wrong location. I just didn't see a particular section that I felt was suitable for programming related questions. I went here since is was labeled as NinjaScript Development Support >> Strategy Development without it specifically saying Ninjatrader 7.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          606 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          353 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X