Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trades disappears

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

    Trades disappears

    I have an issue.
    I have backtested and implemented the result in strategies.
    The strategy is automated and have traded for about four weeks. When I tried backtesting again the trades are gone. And now the backtesting shows trades that the automated strategy have shown or executed.
    I attach two screenshots for comparison. One the original trades when in automated mode and one backtested version.
    All the conditions are still true and the trades should show up. Whys that?
    Attached Files

    #2
    Hello hagu1,

    Thanks for the post and welcome to the NinjaTrader forums! Sorry, it's not clear what you are running into. Could you please walk use through the steps you made in the platform, what your expectations were with those steps, and then what did you see happen instead?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Okey i will try to explain more clearly.
      1. I run a backtesting at ACI 5 min chart with a certain setup of parameters.
      2. I get a result, witch I live trade for four weeks.
      3. I get a number of executions. As seen at the attached file "ACI med indicator".
      4. I want to check the executions by run a backtest. As seen at the attached file med "ACI strategy".
      5. The backtest result differ from the “real time” execution from step 3.
      Should not the backtest of a strategy match the realtime executions if they are run on the same set of data?

      Comment


        #4
        I see, thanks for the reply. Unfortunately there can be different results running a strategy real time compared to a backtest. Some of the reasons for these expected discrepancies are detailed here:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          But I don’t get it. If the data is exactly the same on day 1 when taking the trade as on day 2 when backtesting, should not the backtesting result show the trade from day 1? If the data differ it means that backtesting/optimizing/walk forward testing is a waste of time.
          Is there any solution to solve or minimize this problem?

          Comment


            #6
            And if you manually check that the conditions is still true day2 why don’t it show up on backtesting?

            Comment


              #7
              The data is not necessarily the same either for historical compared to real time. For more info on this, see the following link: in section (Understanding why a chart can look different after reloading historical data from the server)


              You can adjust your strategy code to provide more granularity in a backtest, following this sample:
              You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


              Strategies function mechanically different in a backtest compared to real time, so you should also consider taking advantage of the built in market replay feature to test your strategy. With this, you can quickly playback a day's worth of data to evaluate on this simulated real time feed. You can expect the mechanical operation of the strategy on market replay to be very similar to actual real time strategy.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Okay, I appreciate your commitment.
                But I think I do not really expressed myself clearly.

                As you can see on the attachments 1 and 2, the requirements are met and the signal is displayed.
                Stochastics cross 23. SMA based on the BOP exceeded the previous number. And SMA at closing above the previous number. All conditions met.

                If you look at the attachments 3 and 4, which shows exactly the same data, there is no signal.
                And although the strategy is turned on to see no signal even though the signal shall be displayed because the requirements are met.

                This is what I think backtesting should review previous trades if you have the exact same data.

                Image 1 & 2 shows live trading. Image 3 & 4 shows backtesting or more correctly the same chart but with the strategy switched from Strategy Preformance Historical and Real Time.

                Is not this strange?
                Attached Files

                Comment


                  #9
                  In your screenshots 3 &4 the strategy is not enabled. Does it work better for you once it's enabled?

                  Right click > Strategies > Set enabled > true > OK.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Oh sorry. No difference.
                    Attached Files

                    Comment


                      #11
                      Thanks. So that I'm understanding the issue - your strategy never shows any trades on a backtest/historical but it does place actual trades when you run it real time? If so, can you please share the strategy you're using?
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        Yes it is correct. Of course. What do you need and how do I do this? Where shall I send it?

                        Comment


                          #13
                          You can attach directly here or if you prefer send to support 'at' ninjatrader 'dot' com and include a link to this thread.

                          To post here, click the paper clip icon when replying to a post.

                          You can attach the .cs file for the strategy stored here:
                          Documents\NinjaTrader 7\bin\custom\strategy
                          Ryan M.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks for sending in the strategy. I was able to get some historical trades but did notice you index [-1], which is not supported in our platform. Any "bars ago" values should be positive number . A value of 1 means 1 bar ago.

                            Then next step is to debug values used in your strategy, to verify they're what you expect for each bar. You can also add drawing objects for additional signal confirmation. The following links can help with debugging and using draw objects:

                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #15
                              Thank you very much for your help.
                              I'm going to try trade and see if the problem resolves itself.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bill2023, Yesterday, 08:51 AM
                              8 responses
                              43 views
                              0 likes
                              Last Post bill2023  
                              Started by yertle, Today, 08:38 AM
                              6 responses
                              25 views
                              0 likes
                              Last Post ryjoga
                              by ryjoga
                               
                              Started by algospoke, Yesterday, 06:40 PM
                              2 responses
                              24 views
                              0 likes
                              Last Post algospoke  
                              Started by ghoul, Today, 06:02 PM
                              3 responses
                              16 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              46 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X