• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

12 erroneous backtest trades?

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

    12 erroneous backtest trades?

    Perhaps a prize for the strangest query yet?

    This work in progress strategy creates (at least on my machine) 12 erroneous trades for any pair I test in on regardless of minute timeframe or dates selected.

    The trades are both long and short, but are always 1 min apart and start at the top of hour for 12 minutes. And always at the beginning of the backtest period.

    Thanks.
    Attached Files

    #2
    Please remove the duplicate 1 minute frame and submit and work your logic from BarsInProgress = 0, the primary 1 min frame.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      OK a bit more info, (ignore the name of the strategy which has '1 min' it) I trade off 15 minute bars so the addition of the 1 minute PeriodType is an attempt to replicate more realistic entry points, rather than entering orders at the close of the 15min bar which would be well off in some cases.

      The only way I found (but I am a rookie coder), was to set the entry and exit conditions within the 1 min OnBarUpdate iusing BarsInProgress and use BarsArray to reference back to the 15 minute chart. Is there is a quicker/neater way of doing this?

      If you run the strategy on 15 min FX pairs perhaps you will be able to replicate my error.

      NB My goal at present is to confirm the manual backtest results, not to produce a working automated strategy to enter and manage trades.

      Thanks so far and look forward to your feedback.

      Comment


        #4
        mokodo,

        Unfortunately we cannot use this strategy because it uses custom indicators in its trading logic. This being the case we cannot replicate your results. If you would export the strategy using Files > Utilities > Export NinjaScript we would be able to look into this further.

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Adam, will do, but will have to wait a day or so.

          Comment


            #6
            Hi Adam, strat attached
            Attached Files

            Comment


              #7
              Thanks for posting this export, while we could unfortunately not completely debug this for you, it stems from the BarsSinceExit condition in your strategy. If this is used you would need one historical trade at least kick it into gear. If I remove this condition from your set the 'mysterious' entries disappear.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Bertrand,

                Thanks for your help and the speedy turnaround, all sorted.

                Comment


                  #9
                  Glad to hear that, have a good weekend.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Error re-occurs with SetStopLoss

                    Hi again,

                    I have come back to the work below. I have added in SetStopLoss within OnBarUpdate rather than Initialize as I wish to calculate this stop based dynamically on Swing Highs/Lows.

                    Your previous advice fixed the original problem using BarsSinceEntry, but the issue has reoccured since the inclusion of SetStopLoss?

                    As always any advice would be welcomed

                    Comment


                      #11
                      Could you please send us the strategy as you have it now modified to so we could give it a run here?
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Hi Bertrand,

                        Got this sorted after trawling the forum. Issue is with SetStopLoss that was not being effected by BarsInProgress. I've switched to EnterLongStop and works great now.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by cassiano_sanches, Today, 07:37 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post cassiano_sanches  
                        Started by terminatorT1000, Today, 06:40 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post terminatorT1000  
                        Started by Giudiver, Today, 04:29 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post Giudiver  
                        Started by mlarocco, 03-03-2018, 03:54 PM
                        12 responses
                        1,298 views
                        0 likes
                        Last Post SawDr
                        by SawDr
                         
                        Started by TakingStock12, Today, 04:05 PM
                        2 responses
                        15 views
                        0 likes
                        Last Post NinjaTrader_ShawnB  
                        Working...
                        X