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

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 truepenny, Today, 03:59 AM
          5 responses
          20 views
          0 likes
          Last Post truepenny  
          Started by nicthe, Yesterday, 07:38 AM
          7 responses
          29 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by trilliantrader, Today, 09:34 AM
          3 responses
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by spencerp92, 10-10-2023, 09:56 AM
          5 responses
          317 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by flybuzz, Yesterday, 10:33 AM
          2 responses
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X