• 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

Indicator testing automation

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

    Indicator testing automation

    Hello,

    Before I turn indicator into strategy I always back test the idea. Let's say I want to go long when 34 EMA crosses above 55 EMA, and close the trade after it closes below. Then I want to do the same with 35 EMA over 56 EMA, and so on. EMA values are parameters of course. Is there any tool (3rd party totally fine) that can press F5 (refresh), recognize that the indicator finished running, and then click F5 again for the next batch. I can figure out on my own how to change the parameters, but the process of automatically keep triggering indicator, I am not sure how to do.

    Thanks,
    redduke

    #2
    Hello RedDuke,

    Thanks for your post.

    I'm not aware of any means to accomplish your goal using an indicator and refresh. We can leave this thread open for any contribution by other members.

    The iterative process you are describing is exactly what the strategy analyzer optimizer will do for you when you apply a strategy and have provided inputs that are user adjustable. In the optimizer, you can set the start, end and step values for the moving averages to test. https://ninjatrader.com/support/help...a_strategy.htm

    Your indicator idea of various period crossovers can be made into a very simple strategy using the strategy wizard.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul.

      Thanks for the answer. Does strategy analyzer runs of minute data or I need market replay data for it to work? I have recorded data for few years, where min data I have 10 years.

      Thanks,
      redduke

      Comment


        #4
        Hello RedDuke,

        Thanks for your reply.

        The strategy analyzer would not be able to use market replay data as that is a special format of historical data that includes all levels of data. The strategy analyzer would use the historical data as found under Tools>Historical data manager. This is the data that your charts would use when you connect to a live data feed and the historical data is used to backfill the chart's data series based on the number of days to load.

        Historical data is recorded in tick, minute or day bars, all other bar types are generated from this data.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by RedDuke View Post
          Does strategy analyzer runs of minute data or I need market replay data for it to work? I have recorded data for few years, where min data I have 10 years.
          SA uses Historical data only (which is stored differently than Market Replay data) -- it cannot use Market Replay data.

          Btw, since you're asking specifically about Minute data, you're in luck. You can download an unlimited number of years
          of Historical minute data using the Historical Data Manager (see Options -> Tools -> Historical Data Manager -> Download),
          but since it seems you already have Historical minute data from the last 10 years, so you're all set.

          Lastly, there is a sample strategy provided by NinjaTrader that exists in your bin/Custom/Strategy folder, it's called,

          @SampleMACrossOver.cs

          which uses the SMA but otherwise does exactly what you're asking.

          I've attached a modified copy of that file (changed all usages of SMA to EMA) for you to get started.
          Attached Files
          Last edited by bltdavid; 06-20-2019, 08:59 AM.

          Comment


            #6
            Originally posted by NinjaTrader_PaulH View Post
            Hello RedDuke,

            Thanks for your reply.

            The strategy analyzer would not be able to use market replay data as that is a special format of historical data that includes all levels of data. The strategy analyzer would use the historical data as found under Tools>Historical data manager. This is the data that your charts would use when you connect to a live data feed and the historical data is used to backfill the chart's data series based on the number of days to load.

            Historical data is recorded in tick, minute or day bars, all other bar types are generated from this data.
            Paul,

            Just to confirm, does strategy analyzer uses tick data? Let's say I want to back test 10 years back, but data vendor only has 3 years of historical tick data and 10 years of min data. My assumption is that strategy analyzer will only be able to back test 3 years.

            Thanks,
            redduke

            Comment


              #7
              Originally posted by bltdavid View Post

              SA uses Historical data only (which is stored differently than Market Replay data) -- it cannot use Market Replay data.

              Btw, since you're asking specifically about Minute data, you're in luck. You can download an unlimited number of years
              of Historical minute data using the Historical Data Manager (see Options -> Tools -> Historical Data Manager -> Download),
              but since it seems you already have Historical minute data from the last 10 years, so you're all set.

              Lastly, there is a sample strategy provided by NinjaTrader that exists in your bin/Custom/Strategy folder, it's called,

              @SampleMACrossOver.cs

              which uses the SMA but otherwise does exactly what you're asking.

              I've attached a modified copy of that file (changed all usages of SMA to EMA) for you to get started.

              Hi bltdavid,

              Thank you very much for above info.

              Regards,
              redduke

              Comment


                #8
                Hello RedDuke,

                Thanks for your reply.

                If your strategy uses minute based bars then it will draw from the historical minute bars. (Example, 3 minute, 60 minute, 240 minute, etc)

                If your strategy uses tick based bars then it will draw from your 3 year supply of tick data (Example: Tick bars, Volume bars, range bars, renko bars, seconds bars.

                The answer depends on the bar type used and if your strategy adds other type data series, for example, a strategy that is applied to 5-minute bars but adds a 1 tick data series would be limited to the 3 years of tick data.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Paul,

                  Let me clarify my question. Let's say my strategy goes long when current bar breaks high of previous bar (on 1 hour chart), and never repeats the trade on the same bar. And it also sets profit target (20 ticks) and stop loss (below low of previous bar). Now let's assume during current hour market break high/low of previous bar multiple times, back and forth. 2 scenarios could unfold:

                  1) the market could have first hit my profit target, and close the trade in the green
                  2) the market could have first hit my stop loss and close the trade in red

                  How will strategy analyzer know the exact unfolding? My assumption is that for reliable back test and optimization tick data is required. Can you please clarify,

                  Thanks

                  Comment


                    #10
                    Hello RedDuke,

                    Thanks for your reply.

                    The strategy analyzer will take the conservative approach and fill the stop first.

                    Adding a faster time frame and submitting orders to the faster time frame would be the answer, considering that your chart is using 60-minute bars you could certainly test with adding a 1-minute series if you are trying to keep to your minute bars historical data. Otherwise, a single tick series will do the trick.

                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Paul,

                      What do you mean by submitting orders on faster time frame? If my main chart is 60 min, how do I tell strategy analyzer to drop to 1 min ?

                      Thanks

                      Comment


                        #12
                        Hello RedDuke,

                        Thanks for your reply.

                        You would use the entry method overload that allows you to specify the bars to submit the order to.

                        I've linked an education example of this here: https://ninjatrader.com/support/help...ipt_strate.htm
                        Paul H.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_PaulH View Post
                          Hello RedDuke,

                          Thanks for your reply.

                          You would use the entry method overload that allows you to specify the bars to submit the order to.

                          I've linked an education example of this here: https://ninjatrader.com/support/help...ipt_strate.htm
                          Thanks a lot

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by genbrain9, Today, 10:30 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post genbrain9  
                          Started by lonechaos, Today, 07:02 PM
                          0 responses
                          11 views
                          0 likes
                          Last Post lonechaos  
                          Started by YellingOption, Today, 03:25 PM
                          0 responses
                          17 views
                          0 likes
                          Last Post YellingOption  
                          Started by 7robert, Today, 03:08 PM
                          2 responses
                          23 views
                          0 likes
                          Last Post 7robert
                          by 7robert
                           
                          Started by ManTrader, Today, 03:00 PM
                          2 responses
                          9 views
                          0 likes
                          Last Post ManTrader  
                          Working...
                          X