Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ADX and ATR strategies

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

    ADX and ATR strategies

    Has anyone deployed the ADX or ATR breakout strategies?
    I have tried them both and they don't seems to work for me.

    I have run them on playback over three weeks and no joy.

    Has anyone seen any guidelines or have had them running that could help with settings

    Thanks in advance

    #2
    Hello fredfred123,

    Thanks for writing in.

    I believe you are referring to the TASC article strategies found here?

    ATRBreakoutStrategy - https://ninjatrader.com/support/foru...atid=8&lpage=1

    ADXBreakouts - https://ninjatrader.com/support/foru...atid=8&lpage=1

    In the caption provided with the ATRBreakout strategy, you may see the settings used to get the results presented in the backtest. Link: https://ninjatrader.com/support/foru...kid=923&size=0

    You may also observe the source code to see which factors influence the strategy. I have added comments to the strategy code below:

    ATRBreakout:
    Code:
    protected override void OnBarUpdate()
    {
    	if (Close[0] < PriceRangeHi														// Price is less than PriceRangeHi
    		&& Close[0] > PriceRangeLo													// Price is greater than PriceRangeLo
    		&& Math.Abs(High[0] - Low[0]) >= PriceRangeMin								// Difference of High and Low is greater than PriceRangeMin
    		&& Volume[0] >= VolumeRangeMin												// Volume is greater than the minimum range
    		&& ATR(AtrPeriod)[0] >= MAX(ATR(AtrPeriod), AtrPeriod)[0]					// Current ATR value is the highest from its lookback period
    		&& CrossAbove(Close, SMA(MaPeriod), 1)										// Current price crosses over Moving Average
    		&& Math.Abs(High[0] - Low[0]) >= Math.Abs(High[1] - Low[1]) * WideRange		// Current High/Low range is greater or equal to Previous High/Low range time the factor WideRange
    		&& Volume[0] > Volume[1])													// Current Volume is greater than previous volume
    	{
    		high = High[0];																// Use this High price
    	}
    	
    	if (high != 0 && Close[0] >= high + .5)											// Current price is greater that our breakout level
    	{
    		if (High[0] > Close[0])														// Downward pivot in bar
    			EnterLongStopMarket(High[0]);
    		else
    			EnterLong();
    	}
    ADXBreakoutStrategy:
    Code:
    // Condition for ADX Breakout Entry Signals
    if (ADX(ADXPeriod)[0] > ADXBO && Close[0] >= CurrentDayOHL().CurrentHigh[1] + PntAbvDlyHi && signalValid)			// ADX exceeds breakout level and Current price is above previous day high + PntAbvDlyHi
    {
    	EnterLong(DefaultQuantity,"Breakout Entry");
    Code:
    if(!signalValid && ADX(ADXPeriod)[0] < ADXBO) // Check that we are below our breakout level before creating a singla that we have crossed above
    			{
    The TASC article itself would have the most in depth explanation on the study behind the strategy.

    Our NinjaTrader 7 documentation advises to do general backtesting with the Strategy Analyzer to find instruments where the strategy proves useful, and then to proceed to take further tests using market replay and the simulation account on a real time data feed. This is a good rule of thumb for finding the best uses for your strategies. Optimization backtests also provide a good approach to finding the best settings for your strategy.

    Optimization backtests - https://ninjatrader.com/support/help...a_strategy.htm

    Strategy Development Process (NT7 documentation) - https://ninjatrader.com/support/help...nt_process.htm

    If there is anything else I can do to provide further help, please let me know.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim

      Very interesting Strategy. I have read the article and it was informative, and looked at the code as far as my knowledge allows looks awesome!

      Trouble is I have tried all sorts of settings on the back testing and Strategy analyser for forex say GBPUSD or EURUSD on different time scales and can't get any results off at all.

      I Must be doing something wrong, most of the other strategies work ok but I can't get a peep out of it?
      The ATR and VOL loads and the SMA is plotting but no trades when run and backtesting?

      If I had a starting point would be great, sorry to sound a bit dim!!

      Comment


        #4
        Hello fredfred123,

        As a starting point, please try backtesting with settings noted in the caption of the ATRBreakout Strategy.

        Link: https://ninjatrader.com/support/foru...kid=923&size=0

        If these settings do not show results, please let me know.
        JimNinjaTrader Customer Service

        Comment


          #5
          HI Jim


          I have tried the Strategy analyser for the ES06-17 and the settings noted in the caption, I tried to download the data for the instrument but having problems in doing so.
          not surprising there are no results on that one.

          Is it possible to create a caption for forex EURUSD and GBPUSD, the data is there for that but of course I have not a starting point for the settings

          Many thanks

          Comment


            #6
            Hello fredfred123,

            You could use the front month "ES 12-17" while backtesting and the historical data from previous contract months should be merged. You should not have to specify the specific contract month while backtesting.

            I am not sure which settings you could use to run the ADXBreakout strategy on EURUSD or GBPUSD. Trading advise is not something that we are qualified to give, but I could give you some direction for you to experiment further.

            The source code can be used as a guideline to come up with parameters for loose conditions that would allow the order entry methods to fire. However, there are still conditions that must become true for the order entry method to be reached that we do not have complete control of.

            If you would like to tweak the strategy so it can trade on other instruments, I would suggest to first assign parameters that would logically allow the most trades, and run backtests over a large period of time in the Strategy Analyzer. Then, I would suggest to use prints to verify the conditions used to see which conditions are preventing the strategy from entering. With this information, you could then modify the strategy so it will take trades on any instrument of your choosing.

            While looking at the code, I noticed some ranges for the parameters were prohibitive in that you could not specify a value between 0 and 1. I've updated the strategy so it can take a more appropriate range of values.

            Link: http://www.ninjatrader.com/support/f...catid=8&id=923

            Debugging tips on using prints that can be used to analyze the strategy can be found here - https://ninjatrader.com/support/foru...ead.php?t=3418

            If there is anything else I can do to help out, please let me know.
            JimNinjaTrader Customer Service

            Comment


              #7
              HI Jim

              I thank you for the time you have spent on this and appreciate it.

              I have tried everything to get this to trade and not having any joy.
              Think the idea is just what I am trying develop, but just need a starting point to see it working and go on from there. I have run it on back testing and strategy analyser.
              I have tried very loose parameters and noted them in the script but on forex they just don't seem to work for me.

              If anyone out there have some parameters I could start off with for a forex pair I would greatly appreciate it.

              Many thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by nandhumca, Today, 03:41 PM
              0 responses
              3 views
              0 likes
              Last Post nandhumca  
              Started by The_Sec, Today, 03:37 PM
              0 responses
              3 views
              0 likes
              Last Post The_Sec
              by The_Sec
               
              Started by GwFutures1988, Today, 02:48 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by ScottWalsh, 04-16-2024, 04:29 PM
              6 responses
              33 views
              0 likes
              Last Post ScottWalsh  
              Started by frankthearm, Today, 09:08 AM
              10 responses
              36 views
              0 likes
              Last Post frankthearm  
              Working...
              X