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

statements ignored

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

    statements ignored

    Greetings,

    I'm wondering if there is something wrong with the syntax of the following command statement:

    if(High[0] >= Fibo27(1.27, 1, 8, 1).Upper27[1]){do something}

    Basically the idea is that if current price tops the last bar "Upper27" value from the "Fibo27" indicator something is to be done...this statement and others like it seem to be ignored by my strategy, and I'm at a loss to explain why? They seem to be ignored because the "do something" part is never done...ideas? Suggestions?

    #2
    Looks fine to me although you reference 1 bar ago for the Upper plot, you might want to make sure that you are not calling this when CurrentBar == 0 since you will get index out of range exception in your log.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks, but it cannot be called on CurrentBar 0 because the strategy will not run until bar 20...so nothing seems wrong, huh?

      Comment


        #4
        Syntax wise, it's fine.
        RayNinjaTrader Customer Service

        Comment


          #5
          Thank you. I think I found the problem however I'm at a total loss to explain it. If you check the attached screenshot you can see the values in question being reported incorrectly in the Output Window compared to the "Data Box" values. The Data Box contains the correct values. As can be seen, the strategy Print statements showing in the Output Window are correct for the High[1], Low[1], and Close[1]...but the values for "Fibo27" (the last 4 values in the Data Box) are completely off...

          I have repeated this test using ONLY the "Fibo27" indicator running without the strategy, and the values that show in the Output Window then are completely correct...thus the strategy is somehow returning the incorrect values for that indicator. Could this be a possible bug? Or what could be the problem cause here??
          Attached Files

          Comment


            #6
            Burga1,

            I'm having a similar problem in which Ray is looking into. The indicator I created shows the values correctly, yet when the same function is used within a strategy it does not calculate properly. Maybe that's your issue?

            Anthony
            mrlogik
            NinjaTrader Ecosystem Vendor - Purelogik Trading

            Comment


              #7
              Why are you printing [1] values? The data box shows [0] values not [1] values.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                The values in the Data Box are for [1] values, I hovered the cursor over that bar and held it there on that bar to bring up those values.

                Comment


                  #9
                  I do not know where you are hovering. If you are hovering 1 bar behind the latest bar (a.k.a. the last bar that has the indicator plotted) that is still [0] index. What can help is add Time[0] into your print functions to make more sense of the raw information being printed.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Haiasi, 04-25-2024, 06:53 PM
                  2 responses
                  16 views
                  0 likes
                  Last Post Massinisa  
                  Started by Creamers, Today, 05:32 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post Creamers  
                  Started by Segwin, 05-07-2018, 02:15 PM
                  12 responses
                  1,786 views
                  0 likes
                  Last Post Leafcutter  
                  Started by poplagelu, Today, 05:00 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post poplagelu  
                  Started by fx.practic, 10-15-2013, 12:53 AM
                  5 responses
                  5,407 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Working...
                  X