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

Re: [amibroker] EMA/breakout signals composite indicator



PureBytes Links

Trading Reference Links




Jose,
Are you still using these lines of code? 

----------
<FONT face="Courier New" 
size=3>IIf(display=2,Plot(0,"",colorBlue,styleLine),Plot(Close,"",1,128));IIf(display=2,Plot(signals,"EMA 
signals",colorRed,styleLine),Plot(EMA1,"EMA",colorRed,styleLine));----------
 
I believe, from the HELP files for the IIF() 
function, you need to have IIF() return its value to some variable.  The 
following is from the HELP file for IIF:
 
"The following example shows one common error made with IIF function: IIF( 
condition, result = 7, result = 9 ); // THIS IS WRONG 
 
Correct usage is: result = IIF( condition, 7, 9 ); /* 7 or 9 is *returned* 
and assigned to a variable depending on condition */ "
 
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Jose 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Friday, June 13, 2003 12:34 
PM
  Subject: [amibroker] EMA/breakout signals 
  composite indicator
  Please help this newie... :)I'm trying to get 
  the code below to display either the EMA with price, OR the crossover 
  signals, choice being through the Parameters (Ctrl-R) function.  It 
  doesn't seem to work here, and it plots both instead.Any idea what I'm 
  doing wrong?jose 
  '-)---8<-----------------------/* Exponential Moving 
  Average v1.0 *//* EMA periodicity adapts to low bar count *//* 
  josesilva22@xxxxxxxxx */Title = "EMA/breakout signals";  
  pds = Param("EMA periods",21,1,252,1);x = Param("Op=1 Hi=2 Lo=3 
  Cl=4 Vol=5",4,1,5,1);shift = 1+Param("EMA vertical shift 
  %",0,-100,100,0.01)/100;display = Param("EMA=1, 
  Signals=2",1,1,2,1);x = 
  IIf(x==1,O,IIf(x==1,H,IIf(x==1,L,IIf(x==1,V,C))));prds = 
  IIf(Cum(x!=-101)<pds,Cum(x!=-101),pds);EMA1 = 
  AMA(x,2/(prds+1))*shift;signals = 
  Cross(x,EMA1)+Cross(EMA1,x)*-1;IIf(display=2,Plot(0,"",colorBlue,styleLine),Plot(Close,"",1,128));IIf(display=2,Plot(signals,"EMA 
  signals",colorRed,styleLine),Plot(EMA1,"EMA",colorRed,styleLine));---8<-----------------------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












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.