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

Strat builder strategy will not backtest

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

    Strat builder strategy will not backtest

    Hi,

    I am new to NT and wanted to backtest a couple of strategies. Problem is the strategies I create using the strategy builder will not backtest.
    To keep things simple I created a minimal strategy that should enter long when StochRSI crosses above 20, and exit once StochRSI decreases in value.

    In attachment I added screenshots of all steps I went through. Can someone please explain why this strat will not produce results when I try to backtest it?
    (Also included a screenshot of the log that shows an error saying the strat wanted to place an order before the required amount of bars was reached)

    Thanks in advance,

    TradingJean.

    Last edited by tradingjean; 12-30-2019, 07:33 AM.

    #2
    Hello tradingjean,

    Thanks for your post and welcome to the NinjaTrader forums!

    Regrettably your attached files show as an invalid file type and are not viewable.

    As a test, please try backtesting with the platform strategy called SampleMACrossover on the very same data (same bars, same time frame, same dates). This is a known strategy and it will always perform trades. If this strategy produces results then that would verify you have the data. If no results then likely you do not have the data you are trying to back test over and in this case please identify the instrument, dates and time frame as well as what data feed you are connected to.

    The error message only means that your strategy tried to place a trade within the first 20 bars however trades after 20 bars should not be an issue.

    If possible, please try again attaching screenshots.



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello Paul,


      Thank you for the quick reply.

      I deleted the .PNG files in the original post and added .jpg to this post. Hopefully you will be able to view them.

      SampleMACrossover works fine with the same data, so that is not the problem it seems.

      Click image for larger version

Name:	2Data.jpg
Views:	282
Size:	46.2 KB
ID:	1082165Click image for larger version

Name:	1general.jpg
Views:	294
Size:	77.1 KB
ID:	1082166Click image for larger version

Name:	3input.jpg
Views:	284
Size:	51.9 KB
ID:	1082167Click image for larger version

Name:	4entryrule.jpg
Views:	291
Size:	56.6 KB
ID:	1082168Click image for larger version

Name:	5exitrule.jpg
Views:	281
Size:	56.6 KB
ID:	1082169

      Comment


        #4
        Click image for larger version

Name:	7log.jpg
Views:	283
Size:	31.1 KB
ID:	1082171Click image for larger version

Name:	6backtest.jpg
Views:	298
Size:	183.5 KB
ID:	1082172

        Comment


          #5
          Hello tradingjean,

          Thanks for your reply and screenshots.

          It looks like you are wanting to enter when the StochRSI crosses above a value of 20. The StochRSI indicator is range bound from 0.0 to 1.0, so you would need to change the input from an integer type (whole number) to a Double type (decimal floating point), you would also need to set the "MIN" value to 0.0 and likely set your default to 0.2.

          In the Strategy Builder, once you have used an input in your "sets" you cannot change the input unless you first remove it from all of the conditions where it is used, first. So please follow this process to change the input:

          1) In Set 1, select the only condition and click "remove". (do not delete or remove the set of the actions of the set)
          2) In the "Inputs and Variables section, you can now change from int to Double and set the default (0.2) and MIN (0.0) as specified.
          3) In Set 1, recreate your entry condition
          4) Click next until finish to re-compile the strategy.

          The strategy should now be able to meet the entry conditions and will place orders.

          For future reference, I would suggest adding a drawing (such as a dot or other drawing marker (found in the Misc folder) in the actions of a set) when you want to see on the chart when that particular sets conditions are true. In this case you would have seen dots for all the exits conditions but none for the entry condition.

          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Thank you, it works now. Sorry for your time, should have noticed that myself. Problem is that I am used to having that indicator in %.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TraderBCL, Today, 04:38 AM
            2 responses
            16 views
            0 likes
            Last Post TraderBCL  
            Started by martin70, 03-24-2023, 04:58 AM
            14 responses
            106 views
            0 likes
            Last Post martin70  
            Started by Radano, 06-10-2021, 01:40 AM
            19 responses
            609 views
            0 likes
            Last Post Radano
            by Radano
             
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            5 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            471 views
            0 likes
            Last Post tradingnasdaqprueba  
            Working...
            X