Lets Improve Basic EasyLanguage Program

Discussion in 'Strategy Development' started by BrightPropGuy, Jan 13, 2007.

  1. Lets try to improve this very basic/famous ELP:




    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;

    if ( MarketPosition = 0 ) and ( Close < DnBand )
    then SellShort("SE") tomorrow at market;


    if ( MarketPosition = 1 ) and ( Close < Ave )
    then Sell("LX") today at close;

    if ( MarketPosition = -1 ) and ( Close > Ave )
    then BuyToCover("SX") today at close;
     
  2. Inputs: MavDays(15), BandWidth(1.5);
    Vars: MyMiddleBand(0), MyUpperBand(0), MyLowerBand(0);
    Vars: MyProprietaryVolatility(0);

    MyProprietaryVolatility = MyVolatilityUserFunction(High, Low, Close, MavDays);

    MyMiddleBand = WAverage(Close, MavDays);
    MyUpperBand = MyMiddleBand + (BandWidth * MyProprietaryVolatility);
    MyLowerBand = MyMiddleBand - (BandWidth * MyProprietaryVolatility);

    If((MarketPosition <> 1) AND (Close > MyUpperBand)) then Buy Tomorrow at Market;
    If((MarketPosition <> -1) AND (Close < MyLowerBand)) then SellShort Tomorrow at Market;

    If((MarketPosition = 1) AND (Close < MyMiddleBand)) then SellToExitLong Tomorrow at Market;
    If((MarketPosition = -1) AND (Close > MyMiddleBand)) then BuyToCoverShort Tomorrow at Market;

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

    Now just put in your own User Function that calculates your own definition of volatility and, as Emeril says, BAM!

    John Bollinger defined "volatility" to be "standard deviation" but you don't have to.