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

Re[2]: [RT] Crude Code



PureBytes Links

Trading Reference Links

Hello BobR,

B> RD, would you or anyone else, have a suggestion for a "byte" of congestion
B> code we could use in place of the "if value1=value1[1]....." so that we get
B> more yellow dots in the multicolorline?

B> gracias amigo,
B> bobr

{code by www.markbrown.com}
 
INPUTS: PRICE(CLOSE),LENGTH(80),filen(80),percentage(.1);
var:aa(0),filter(0);
 
filter=percentage*StdDev(aa-aa[1],filen);
aa=AMAf(length, price);
 
if aa<>0 then
if aa-lowest(aa,filen)>filter then begin plot1(aa,"FOF+");end;
if aa<>0 then
if highest(aa,filen)-aa >filter then begin plot2(aa,"FOF-");end;
 
if filter <filter[filen]then begin plot3(aa,"FOF 0");end;
 
{
 
{AMA - Adaptive Moving Average Function developed by Perry Kaufman in his book Smarter Trading}
 
inputs: period(NumericSimple), price(NumericSeries);
vars:  noise(0), signal(0), diff(0), efratio(0), smooth(1), fastend(.666), slowend(0),
  AMA(0), AMAl(0), AMAp(0), AMAc(0);
 
 
if slowend = 0 then slowend = 2 / (period + 1);
{Calculate Efficiency Ratio}
AMAp = price;
if AMAp[1] <> 0 then diff = AbsValue(AMAp - AMAp[1]);
if(currentbar <= period) then begin 
 AMAc  = AMAc + 1;
 AMA = ((AMAl * (AMAc - 1)) + AMAp)/AMAc;
 end
else begin
 signal = AbsValue(AMAp - AMAp[period]);
 noise = Summation(diff, period);
 if(noise <> 0) then efratio = signal/noise;
 smooth = Power((efratio*(fastend - slowend)) + slowend,2);      
 
{Adaptive Moving Average}
 AMA = AMAl + (smooth*(AMAp - AMAl));
      end;
 
AMAl = AMA;
AMAf = AMA;
 
}
To unsubscribe from this group, send an email to:
realtraders-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Attachment: Description: "idg.gif"