TradeStation 2000i Source Code of Select Programs

Bollinger Bandit {TradeStation 2000i Format}

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
if(MarketPosition <> -1 and ExitsToday(date) = 0) then Sell("BanditSell")tomorrow dnBand

if(MarketPosition = 0) then liqDays = 50;
if(MarketPosition <> 0) then
      liqDays = liqDays - 1;
      liqDays = MaxList(liqDays,10);
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— TradeStation 2000i Format

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; ...

Get Building Winning Trading Systems with TradeStation™ now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.