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

[amibroker] weighted MA



PureBytes Links

Trading Reference Links






 
Can anyone please 
help me with this indicator.
I want to plot some 
kind of a weighted moving average (fwma, below) but would like to be able to to 
do it by just putting in the time period rather than doing these calculations 
manually and can't figure out how to program it. Could be a bit time consuming 
if I wanted to do a 200 period fwma. In the case below the period is 
12.
e.g. fwma(3 period 
Close)= (C+2(Ref(C,-1))/3+1(Ref(C,-2))/3)/3 or (Close(today) + 
2/3xClose(yesterday) + 1/3xClose(two days ago)) divided by 
three;
The WMA function in 
Amibroker gives a different result than my fwma.
Many thanks if you 
can help.
<SPAN 
class=998571501-13062003>Larry.
fn1=<FONT face=Tahoma color=#0000ff 
size=1>ROC(C,T1);
fwma=(fn1+<FONT 
color=#ff00ff size=1>11*(<FONT color=#0000ff 
size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>1))/12<FONT 
size=1>+10*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>2))/12<FONT 
size=1>+9*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>3))/12<FONT 
size=1>+8*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>4))/12<FONT 
size=1>+7*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>5))/12<FONT 
size=1>+6*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>6))/12<FONT 
size=1>+5*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>7))/12<FONT 
size=1>+4*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>8))/12<FONT 
size=1>+3*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>9))/12<FONT 
size=1>+2*(<FONT 
color=#0000ff size=1>Ref(fn1,-<FONT color=#ff00ff 
size=1>10))/12<FONT 
size=1>+(Ref<FONT 
size=1>(fn1,-11<FONT 
size=1>))/12)/<FONT 
color=#ff00ff size=1>12<FONT 
size=1>;






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.