Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trades not adding up

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

    #16
    frostengine, the line you deleted is in the 'NinjaScript generated code section' - which we advise not to change. The statements we made referred to removing any CalculateOnBarClose lines from the Initialize() of your referenced indicators. Only set this from the calling strategy.

    Also: since this is a known issue, this is already on our list to fix.
    BertrandNinjaTrader Customer Service

    Comment


      #17
      There are no oncalculateclose in the initialize of the indicators. I also removed the oncalculateclose from the initialize of the strategy itself. Still no difference. Those indicator values still comming up different.

      Comment


        #18
        Thanks frostengine, can you please post the strategy code you used? If you don't want to post, you can send it to me to support at ninjatrader dot com and reference this thread. Thanks.
        BertrandNinjaTrader Customer Service

        Comment


          #19
          I had created a completely new strategy for the MFI problem. Wanted to make sure nothing in my origional strategy was causing an issue...

          protected override void Initialize()
          {
          CalculateOnBarClose = true;
          }

          /// <summary>
          /// Called on each bar update event (incoming tick)
          /// </summary>
          protected override void OnBarUpdate()
          {
          Print("time: "+Time[0]+" "+MFI(5)[0]);
          }

          and with CalculateOnbarClose=false its the same exact result. This is a strategy running on 100 tick bars, start time 8:30 end time 2:45 min bars required set at 1-20 doesnt matter, tried several all the same result...

          Comment


            #20
            Thanks frostengine - unfortunately I couldn't reproduce this on my end using a fast ES tickchart values from the indicator and strategy prints aligned well. I would suggest you print from the strategy and indicator and compare the values then, as the databox ones will be rounded where as the printouts are not.
            BertrandNinjaTrader Customer Service

            Comment


              #21
              Today the trades with real and market replay matched. I will continue to output extra information everyday in the hopes of finding a day with a problem again.

              one thing I did find odd was my output the Print statements printed. The time's appeared out of order and jumbled for the different instruments. like for instance I saw most of the output for XOM from 8 to 12.. then all of a sudden the next several lines was output starting at 8 from rimm.. etc and this type of pattern continued throughout the whole output. Is there some sort of flush statement to call after the Print to make sure it writes out at the correct time?

              Comment


                #22
                I think there is something really wrong with market replay. The trades today happened to match up, but I wanted to go and see if the debug output I wrote with Print statements matched up.. Get this.. I connect to market replay, go to strategies, the output window is blank. I add a strategy and hit start on the strategy and dont touch the slider or start playing the time on the market replay, market replay still at 7:30...

                BUT the output window fills up with a lot of output showing some debug messages based on different steps of the decision making at different times through out the day as if it was going to enter that position. A variable i have declared in there which is a counter counting some day...

                The output it puts LOOKS identical to the output that was put out by the real time strategy throughout the day....

                Then I clear that data, cus i dont want that. Then i press for market replay to actually start going, the variables i have declared at the top of the strategy that get incremented on the new bars STAY incremented... although the strategy hasnt run yet, its incremetned from all that stuff it just outputed since it basicaly ran through what looks like the whole day before even starting the time to move...

                Then the stuff its outputing is different, some of it anyway, some of the potential entries are showing up at times that were not shown in real time nor that stuff it outputed by just clicking start on the strategy.... I divided the entry process into 4 steps, only when all 4 steps are true does it enter.. this allowed me to put a print statement after each step to see how many steps it was getting and waht indicator values were there so i can easly compare to real time.. and i'm seeing several of the first 2 or 3 steps being hit at different times from real and that other day... Its almost like that run through it does when you hit start jacks potentially with some indicators...

                What is going on here? Why does hittnig start without starting the actual time moving do this? If I put is(Historical) return; it does not do this before printing of data, but some of the enries and exits do not even come close to matching what real time had...

                I hope ya'll know what is going on as I am losing complete faith in my systems. My systems do me no good when I can't verify they are doing exactly as expected since market replay is acting so buggy...

                Comment


                  #23
                  frostengine,

                  Your strategy "starts" the moment you throw it onto the chart. It is calculating all that historical data and that is what the output you are seeing is. Not only do you have to have exactly the same amount and fidelity to your historical chart data between real-time and replay, you also need the exact same data in the replay itself. Please also be sure that when in real-time you turn off all simulated delays in Tools->Options since Market Replay does not use any delays.

                  If you do if (Historical) for sure your signals would be different. It is no longer taking into account the historical chart data.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Josh,

                    The data it outputted had times and dates from that day. For instance, the market replay was for may 27. The slider was currently at 7:30 AM.... i start the strategy. It outputted times past 12:00 on may 27. How is that possible? As far as the strategy knows that moment in time is still may 27 at 7:30 AM.. how can it output stuff about 9:00.. 10:00.. etc of that day when the replay has not started playing yet??

                    Comment


                      #25
                      You sure? Please try the attached tweaked SampleMACrossOver that just adds prints for the timestamps. There is no processing of replay data that has not started.

                      If you open up a May 27 replay your chart will only be loaded to May 26. There is no possibility for May 27 data. Please try opening a new chart.
                      Attached Files
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #26
                        I can not run this one until the day ends. Since, it is currently running live again today. I will test on some of the other market replay days just to see if I see the same thing on any other days to get some info to you on that..

                        One thing to note, I am not running the strategy from a chart on market replay. I am running the strategy from the strategies section. Not that I imagine that matters?

                        Comment


                          #27
                          If you are running it from the strategies tab you need to ensure you are using the correct start/end date/times. I recommend you just do it from the chart.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #28
                            I run it from the strategies section because that is how I run it when running live. Having 15 charts open to run the strategy against 15 different stocks seems inefficient when there is the strategy section.

                            The start/end times are identical to the start/end times i chose for live trading.

                            Comment


                              #29
                              Understood, but please try one instance of the strategy from a chart and see what happens. Please try with different replay files too. Thank you.
                              Josh P.NinjaTrader Customer Service

                              Comment


                                #30
                                On the market replay days I have and on this specific computer. I could not get it to do it again. I know I was not crazy, granted I don't remember explicitly looking at the date, only the trade output and time.. and the trades/times that were being printed before the market replay started was identical to what was generated LIVE that day.. so I figured the day had to have been the same.... Tonight i will retest on the machine that did it and verify more conclusively.

                                Thanks for the help...

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Carolscogginsi, Today, 10:45 PM
                                0 responses
                                5 views
                                0 likes
                                Last Post Carolscogginsi  
                                Started by RaddiFX, Today, 10:15 AM
                                2 responses
                                15 views
                                0 likes
                                Last Post RaddiFX
                                by RaddiFX
                                 
                                Started by patrickmlee007, Today, 09:33 AM
                                2 responses
                                18 views
                                0 likes
                                Last Post patrickmlee007  
                                Started by magnatauren, 08-15-2020, 02:12 PM
                                5 responses
                                208 views
                                0 likes
                                Last Post RaddiFX
                                by RaddiFX
                                 
                                Started by rene69851, 05-02-2024, 03:25 PM
                                1 response
                                23 views
                                0 likes
                                Last Post rene69851  
                                Working...
                                X