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

Re: [amibroker] Question-ADX afl



PureBytes Links

Trading Reference Links




Brian,
Check the Users Guide for the syntax for WriteIf 
and Ref.
I also noticed that there are times when nothing 
is written in the TITLE line, for instance when MAADX is 19.6642. You will need 
to adjust your conditions to capture that situation.
 
Compare with yours:
 <FONT 
size=2>
/*ADX Line with 
colors*/
MAADX = Ref<FONT 
size=2>(ADX<FONT 
size=2>(14<FONT 
size=2>),-1<FONT 
size=2>);
//Cond1 - Strong TREND <FONT 
size=2>
Cond1 = (MAADX >= <FONT color=#800080 
size=2>30);
//Cond2 - Weak TREND 
Cond2 = (MAADX >= <FONT color=#800080 
size=2>20) <FONT color=#ff0000 
size=2>AND (MAADX <= <FONT color=#800080 
size=2>29);
//cond3 - No Trend 
Cond3 = (MAADX >= <FONT color=#800080 
size=2>15) <FONT color=#ff0000 
size=2>AND (MAADX <= <FONT color=#800080 
size=2>19);
//Cond4 - Spring 
Cond4 = (MAADX < 15<FONT 
size=2>);
Color =IIf<FONT 
size=2>(Cond1 ,colorGreen<FONT 
size=2>, IIf(Cond2 
,colorYellow, 
IIf<FONT 
size=2>(Cond3,colorOrange<FONT 
size=2>,colorRed<FONT 
size=2>)));
Plot(MAADX,<FONT 
size=2>"MAADX",Color,1<FONT 
size=2>);
PlotGrid<FONT face=Verdana 
size=2>(15<FONT face=Verdana 
size=2>,0<FONT face=Verdana 
size=2>);
Title = <FONT 
size=2>Name() + " ADX Trend Values: 
Yesterday = " + WriteVal<FONT 
size=2>(MAADX,1.4) +<FONT 
color=#8b0000 size=2>
EncodeColor( <FONT 
size=2>colorGreen )+WriteIf<FONT 
size=2>(Cond1," Strong TREND "<FONT 
size=2>,"")+<FONT 
color=#8b0000 size=2>
EncodeColor( <FONT 
size=2>colorYellow )+WriteIf<FONT 
size=2>(Cond2," Weak TREND "<FONT 
size=2>,"")+<FONT 
color=#8b0000 size=2>
EncodeColor( <FONT 
size=2>colorOrange )+WriteIf<FONT 
size=2>(Cond3," No Trend ",<FONT 
size=2>"")+
EncodeColor( <FONT 
size=2>colorRed )+WriteIf<FONT 
size=2>(Cond4," Spring ",<FONT 
size=2>""); 
 
-CS
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=cadvantag@xxxxxxxxxxxxxx 
  href="">Brian 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, August 03, 2003 2:01 
  PM
  Subject: [amibroker] Question-ADX 
  afl
  I am trying to use ADX(14) in a afl that will show color 
  and labels to indicate strength on trend. My goal was for the color of the 
  adx line to remain a continuum based on the parameters and the label or 
  header to show a current status of the trend. I keep getting error 
  messages on this formula can someone help me 
  please.Brian  /*ADX Line with colors*/MAADX = 
  ADX(14);//Cond1 - Strong TREND  Cond1 = (MAADX >= 
  30);//Cond2 - Weak TREND   Cond2 = (MAADX >= 20)AND 
  (MAADX <= 29);//cond3 - No Trend    Cond3 = (MAADX 
  >= 15) AND (MAADX <= 19);//Cond4 - Spring    
  Cond4 = (MAADX < 15);Graph0 = MAADX;Graph0Style = 
  1;Graph0Color =IIf(Ref(Cond1) > 0 ,colorGreen) AND IIf(Ref(Cond2) > 
  0 ,colorYellow) AND IIf(Ref(Cond3) > 0 ,colorOrange) AND 
  IIf(Ref(Cond4) > 0 ,colorRed);Title = Name() + 
  "   ADX Trend Values:  Yesterday =" + 
  WriteVal(Ref(MAADX,-1)) +WriteIf(Cond1==1," Strong TREND  ", 
  WriteIf(Cond2==1," Weak TREND   ", 
  WriteIf(Cond3==1,"   No Trend    ",WriteIf(Cond4==1," 
  Spring    ")))); Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







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.