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 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
          41 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
          66 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          54 views
          0 likes
          Last Post CarlTrading  
          Working...
          X