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

Not always getting Fisher Values correctly

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

    #16
    Since this problem only occurs on the strat tab and works fine when loading it on a chart... and I had a similar problem in the 7 beta... I'm starting to wonder if I'm the only one that uses the strat tab.

    Am I misunderstanding something? Shouldn't strats started in the chart or the tab run exactly the same? Or is there some sort of fundamental difference I'm not aware of?

    Comment


      #17
      lookOutBelow, if you set CalculateOnBarClose = true in your strategy when your run it via the strategy tab, do the values match up?
      AustinNinjaTrader Customer Service

      Comment


        #18
        I think I just found out what exactly is wrong...

        If you run this strategy from the Chart, it works fine. But, as you know, I couldn't get it to work using the strat tab.

        But, this morning, I ran it again and it worked fine through the strat tab. That led me to play around to find out why it was working now.. And now I know.

        1) Go to strat tab
        2) Right click for "new strategy"
        3) select the strat I put in a previous post.
        4) change the time from the default of 12 am to 12 am to 6:30am to 1:00pm (I'm PST)

        Whammo, it doesn't work. Changing the session begin and session end time from the default is what is causing this to fail!!!
        Last edited by lookOutBelow; 08-04-2010, 09:24 AM.

        Comment


          #19
          lookOutBelow, if your charts start at a different time, then the values would be different as well - it isn't failing, it is just using different data.
          AustinNinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_Austin View Post
            lookOutBelow, if your charts start at a different time, then the values would be different as well - it isn't failing, it is just using different data.
            So, what exactly is "Session begins" and "Session ends" for? I was under the impression that this told NT what time the strategy should start and stop?

            And if they are using "different data" , why would the data sync up after an hour or so?

            Comment


              #21
              That is exactly what 'session begins' and 'session ends' are for. It's just that if you have your chart starting at a different time than your strategy, especially if your strategy has CalculateOnBarClose = false (as seen in your code), then the values would definitely not match up because the indicator is using different data (including the intra-bar data when the bar is still building for the charts).
              AustinNinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_Austin View Post
                That is exactly what 'session begins' and 'session ends' are for. It's just that if you have your chart starting at a different time than your strategy, especially if your strategy has CalculateOnBarClose = false (as seen in your code), then the values would definitely not match up because the indicator is using different data (including the intra-bar data when the bar is still building for the charts).
                Sorry to keep at it. But this still doesn't make sense to me.

                I've tried with CalculateOnBarClose = true and I get the same incorrect results.

                And if the timestamps are the same and the prices are the same, why would the fisher values be different if I run it from the chart than when I run it through the tab (with session begin/end set other than default)? FWIW, I've changed the settings for the chart indicators to Calculate on Close to both true and false.

                Comment


                  #23
                  lookOutBelow, can you please tell me every exact step you're taking that leads to these mis-matched values?

                  Your values could be different depending on the time of day because if the session starts early and ends early, the indicator would look at data "wrapping" around to the previous day.

                  I just created another strategy, ran it, compared the results to the chart, and everything is behaving as expected. The chart and strategy are set to 24 hour session, and calculate on bar close is set to true.

                  Please take a look at the attached screenshot, as everything is working fine here.
                  Attached Files
                  AustinNinjaTrader Customer Service

                  Comment


                    #24
                    Something to remember is that it doesn't happen all the time. For instance, if I run it right now, things are fine. I only noticed this problem when using Market Replay data. And even then, it didn't last but an hour or so throughout a whole day.

                    Since I cannot attach a 5meg file. Is there a place I can upload or email you my Replay data for 7/20? Perhaps if you run your script from 6:30 - 8am (PST) on 7/20's replay you'll get different results?

                    Comment


                      #25
                      lookOutBelow, I will run your replay data. Can you please upload it to sendspace.com or an equivalent and then send me the link? I just took a look back at the first picture you posted and it shows your chart going back past 6:30AM, which means the indicator is using data from before 6:30AM, but if you don't have your strategy starting until 6:30AM, then the strategy would go back and use as many bars as necessary from before the previous close (1PM). I have a feeling this is where the discrepancy creeps in.
                      Attached Files
                      AustinNinjaTrader Customer Service

                      Comment


                        #26
                        If the mis-matched values only occur during the very beginning of the session, then that would definitely be the issue.
                        AustinNinjaTrader Customer Service

                        Comment


                          #27
                          Originally posted by NinjaTrader_Austin View Post
                          I just took a look back at the first picture you posted and it shows your chart going back past 6:30AM, which means the indicator is using data from before 6:30AM, but if you don't have your strategy starting until 6:30AM, then the strategy would go back and use as many bars as necessary from before the previous close (1PM). I have a feeling this is where the discrepancy creeps in.
                          I'm a little confused. But that sounds like a reasonable explanation. However, wouldn't the strategy at 6:31am be using the same data/bars as the indicator is at 6:31am? I'm not sure how things are working under the hood.

                          And if they are not using the same source material, wouldn't everything be caught up in 35 1-min bars (using 35 period fisher)? As is, they seem to catch up about an hour in.

                          Anyhow.. Here is the file..




                          Thanks for helping me understand all of this.

                          Comment


                            #28
                            Originally posted by lookOutBelow View Post
                            I'm a little confused. But that sounds like a reasonable explanation. However, wouldn't the strategy at 6:31am be using the same data/bars as the indicator is at 6:31am? I'm not sure how things are working under the hood.
                            That would depend on the session settings. If your chart has the default 24/7 session, then it would as many bars as necessary (35 in this situation) to run the calculations. However, if your strategy starts at 6:30AM (and ends at 1PM), then at 6:35AM, for example, it would use the 6:34, 6:33, 6:32, 6:31, 6:30 bars, but also the 1:00PM, 12:59PM, 12:58PM bars, and so on until all the required bars are used. That is the wrap-around I was speaking earlier.
                            And if they are not using the same source material, wouldn't everything be caught up in 35 1-min bars (using 35 period fisher)? As is, they seem to catch up about an hour in.
                            Yes, it should be caught up at the 36th bar.
                            Anyhow.. Here is the file..

                            http://www.sendspace.com/file/xeozoa
                            Thank you, I will be testing this out and getting back to you.

                            Thanks for helping me understand all of this.
                            You are very welcome. Please let us know if you have any other questions.
                            AustinNinjaTrader Customer Service

                            Comment


                              #29
                              Forgot to ask: can you please tell me all of the settings (session start/end for both chart and strategy, calculate on bar close settings, when the mis-match first happened, etc) you used for the test?
                              AustinNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,603 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post Javierw.ok  
                              Working...
                              X