[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

code



PureBytes Links

Trading Reference Links

Will post your TS (".ela") code to the List. Thanks for sending it to me.

Maybe others can help code it into usable MS code: indicator, systems
tester, etc.

Aberration has only one variable in the Input section that is used for all
markets, so it shouldn't be that difficult to code.

"0" = flat, "1" = long, "-1" = short

Best regards

Walter

=========================

Aberration (ela code)

Inputs: Length(35), StdDevUp(2.0), StdDevDn(-2.0);
Vars: UpBand(0), DnBand(0), Ave(0);


UpBand = BollingerBand(Close,Length,StdDevUp);
DnBand = BollingerBand(Close,Length,StdDevDn);

Ave = Average(Close,Length);

if ( MarketPosition = 0 ) and ( Close > UpBand )
  then Buy("BE") tomorrow at market;          { Enter Long }

if ( MarketPosition = 0 ) and ( Close < DnBand )
  then Sell("SE") tomorrow at market;          { Enter Short }

if ( MarketPosition = 1 ) and ( Close < Ave )
  then ExitLong("LX") today at close;          { Exit Short }

if ( MarketPosition = -1 ) and ( Close > Ave )
  then ExitShort("SX") today at close;         { Exit Long }

{ Print ( File("k:\aberatn.eqy"), Date:6:0,
          (OpenPositionProfit + GrossProfit + GrossLoss):6:2 ); }