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

RE: [amibroker] BarsSince Question



PureBytes Links

Trading Reference Links




Hello,
 
I don't solve this problem:
I am trying in afl to get a variable period ATR in 
minutes Bars
in this example I use Ema instead of 
wilders....
 

M1= H-L;
M2= Ref<FONT 
size=1>(C,-1)- 
H;
M3= Ref<FONT 
size=1>(C,-1)- 
L;
TR = Max(<FONT 
color=#0000ff size=1>Max(<FONT color=#0000ff 
size=1>abs(M2),<FONT color=#0000ff 
size=1>abs(M3)), M1);
start=Day<FONT 
size=1>()>Ref<FONT 
size=1>(Day<FONT 
size=1>(),-1<FONT 
size=1>);
Len=<FONT color=#0000ff 
size=1>BarsSince(start)+<FONT color=#ff00ff 
size=1>1;<FONT face="Courier New" color=#008000 
size=1>
//Len=40;
Factor = 2<FONT 
face="Courier New" size=1>/(Len+<FONT face="Courier New" color=#ff00ff 
size=1>1);<FONT color=#0000ff 
size=1>
Plot(<FONT color=#0000ff 
size=1>ValueWhen(<FONT face="Courier New" 
size=1>Len==<FONT face="Courier New" color=#ff00ff 
size=1>40,<FONT 
face="Courier New" color=#0000ff size=1>AMA(<FONT 
face="Courier New" size=1>TR,<FONT face="Courier New" 
size=1>Factor)<FONT face="Courier New" 
size=1>),""<FONT 
size=1>,2,<FONT 
color=#ff00ff size=1>1);<FONT color=#0000ff 
size=1>
Plot(<FONT color=#0000ff 
size=1>ValueWhen(<FONT face="Courier New" 
size=1>Len==<FONT face="Courier New" color=#ff00ff 
size=1>40,<FONT 
face="Courier New" color=#0000ff size=1>EMA(<FONT 
face="Courier New" size=1>TR,<FONT face="Courier New" 
color=#ff00ff size=1>40)<FONT face="Courier New" 
size=1>),""<FONT 
size=1>,3,<FONT 
color=#ff00ff size=1>1);
 
I suppose that for a given 
bar, when the variable period == 40 ( for example), the results of variable 
ATR( with use of AMA)
must be the same as the 
ATR(40);
and it is not the 
case????
Any Idea 
Why???
 
<FONT face=Arial 
size=2>Stephane


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








Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.