APPENDIX A
TradeStation 2000i Source Code of Select Programs
BOLLINGER BANDIT
Vars: upBand(0),dnBand(0),liqDays(50);
upBand = BollingerBand(Close,50,1.25); dnBand = BollingerBand(Close,50,–1.25);
if(MarketPosition <> 1 and ExitsToday(date) = 0) then Buy("BanditBuy")tomorrow upBand
stop;
if(MarketPosition <> –1 and ExitsToday(date) = 0) then Sell("BanditSell") tomorrow dnBand
stop;
if(MarketPosition = 0) then liqDays = 50;
if(MarketPosition <> 0) then
begin
liqDays = liqDays – 1;
liqDays = MaxList(liqDays,10); end;
if(MarketPosition = 1 and Average(Close,liqDays) < upBand) then ExitLong("LongLiq") tomorrow Average(Close,liqDays)stop;
if(MarketPosition = –1 and Average(Close,liqDays) > dnBand) then ExitShort("ShortLiq") tomorrow Average(Close,liqDays)stop;
DYNAMIC BREAK OUT II BY GEORGE PRUITT
{This system is an extension of the original Dynamic Break Out system written
by George for Futures Magazine in 1996. In addition to the channel break out
methodology, DBS II incorporates Bollinger Bands to determine trade entry.}
Inputs: ceilingAmt(60),floorAmt(20),bolBandTrig(2.00);
Vars: lookBackDays(20),todayVolatility(0),yesterDayVolatility(0), deltaVolatility(0);
Vars: buyPoint(0),sellPoint(0),longLiqPoint(0),shortLiqPoint(0),upBand(0), dnBand(0);
todayVolatility = StdDev(Close,30);
yesterDayVolatility = StdDev(Close[1],30); {See how I offset the function call to
get yesterday's value}
deltaVolatility = (todayVolatility – yesterDayVolatility)/todayVolatility;
lookBackDays ...
Get Building Winning Trading Systems with TradeStation®, + Website, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.