Variable MA and Tradestation

Discussion in 'Technical Analysis' started by lizardgizzard, Feb 24, 2003.

  1. Hi there. I would be so UNBELIEVABLY grateful if someone out there could provide the formula for a variable moving average function or indicator in Tradestation. I've tried programming it myself, but the formula usually involves the Chande momentum oscillatoras the volatility ratio, and I can't find that one anywhere either. Please help!! Thanks!

    -Lizard
    :eek:
     
  2. {SAVE AS FUNCTION:}

    Inputs: Length(NumericSimple), Smooth(NumericSimple);
    Vars: Up(0), Dn(0), UpSum(0), DnSum(0), AbsCMO(0), SC(0);

    Up=IFF(Close>Close[1], Close-Close[1],0);
    Dn=IFF(Close<Close[1], AbsValue(Close-Close[1]),0);

    UpSum=Summation(Up,Length);
    DnSum=Summation(Dn,Length);

    If UpSum+DnSum >0 then
    AbsCMO=AbsValue((UpSum-DnSum)/(UpSum+DnSum));

    SC= 2/(Smooth+1);

    If Currentbar=Length then VIDYA=Close;
    If Currentbar>Length then
    VIDYA=(SC*AbsCMO*Close)+((1-(SC*AbsCMO))*VIDYA[1]);


    {Copyright c 1997, Technical Analysis, Inc.}


    {VIDYA INDICATOR: SAVE AS INDICATOR}

    Inputs: Length(21), Smooth(5), PCT(0);

    Value1=VIDYA(LENGTH,SMOOTH);
    If Value1 > 0 then begin
    Plot1(Value1, "VIDYA");
    Plot2(Value1*((100+PCT)/100),"UpBand");
    Plot3(Value1*((100-PCT)/100),"DnBand");
    End;


    {Copyright c 1997, Technical Analysis, Inc.}


    *******************************************

    Possibly still available as EL archive file, along with some other Chande stuff, either at the old Omega site or in the Technical Analysis of Stocks and Commodities archives.
     
  3. Thank you very much, Kymar. Very helpful indeed!

    -Lizard
     
  4. PHISEL

    PHISEL

    {SAVE AS FUNCTION:}

    Inputs: Length(NumericSimple), Smooth(NumericSimple);
    Vars: Up(0), Dn(0), UpSum(0), DnSum(0), AbsCMO(0), SC(0);

    Up=IFF(Close>Close[1], Close-Close[1],0);
    Dn=IFF(Close .....?