Log in to see Cloud of Tags

Wealth-Lab Wiki

TASC 2016-03 | ADX Breakouts (Calhoun)

RSS

Traders' Tip text

The WealthScript code for Wealth-Lab for Ken Calhoun's intraday technique called "ADX Breakouts" is presented. Through interactive “sliders” on the bottom left of the screen you can tune this system by modifying the parameters like trailing stop size, thresold for entry etc.

Image

Figure 1 illustrates The two example trades in JAH (Jarden Corp) in December 2015.

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class TASC201603 : WealthScript { private StrategyParameter paramTrailing; private StrategyParameter paramThreshold; private StrategyParameter paramRange; private StrategyParameter paramADX;

public TASC201603() { paramADX = CreateParameter("ADX above", 40, 30, 90, 10); paramRange = CreateParameter("15-day range, $", 5, 1, 10, 1); paramThreshold = CreateParameter("Cents above", 0.50, 0, 1.0, 0.1); paramTrailing = CreateParameter("Trailing stop $", 2, 1, 10, 1); } protected override void Execute() { if( !Bars.IsIntraday ) { DrawLabel(PricePane, "Requires intraday data"); Abort(); } else { SetScaleDaily(); DataSeries FifteenDayHigh = Highest.Series(High,15); DataSeries FifteenDayLow = Lowest.Series(Low,15); DataSeries FifteenDayRange = FifteenDayHigh - FifteenDayLow; RestoreScale(); FifteenDayHigh = Synchronize(FifteenDayHigh); FifteenDayRange = Synchronize(FifteenDayRange); FifteenDayRange.Description = "The fifteen day range"; var intradayADX = ADX.Series(Bars,14); intradayADX.Description = "Intraday ADX (14)"; PlotSeries(PricePane,FifteenDayHigh,Color.Blue,LineStyle.Solid,1); ChartPane rangePane = CreatePane(30,true,true); PlotSeries(rangePane,FifteenDayRange,Color.Violet,LineStyle.Solid,1); ChartPane adxPane = CreatePane(30,false,true); PlotSeries(adxPane,intradayADX,Color.Red,LineStyle.Solid,1); DrawHorzLine(adxPane,40,Color.Green,LineStyle.Dashed,1); for(int bar = GetTradingLoopStartBar(1); bar < Bars.Count; bar++) { if (IsLastPositionActive) { Position p = LastPosition; double amount = p.MFEAsOfBar(bar) / p.Shares + p.EntryPrice - paramTrailing.Value; SellAtTrailingStop(bar + 1, p, amount, "$2 Trailing"); } else { if( (Close[bar] > 20.0) && (Close[bar] < 70.0) ) if(FifteenDayRange[bar] > paramRange.Value) if(intradayADX[bar] > paramADX.ValueInt) BuyAtStop(bar+1, FifteenDayHigh[bar] + paramThreshold.Value); } } } } } }

Eugene
Wealth-Lab team
www.wealth-lab.com

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.