Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

APPENDIX B: TradeStation 2000i Source Code of Select Programs

APPENDIX B

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

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint