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

RE: [amibroker] Can AB pass parameter values between indicators?



PureBytes Links

Trading Reference Links




<FONT 
face="Courier New" color=#000000 size=3>Error 3.Condition in IF, WHILE, FOR 
statementshas to be Numeric or Boolean type.You can not use array 
here,please use [] (array subscript operator)to access array 
elements
The 
specific error is looking, I believe, for a fixed number. You might try adding 
TD1=Lastvalue(TD1) under the line 54 which will then look to the number stored 
in the Last occurrence of TD1 but..... on my computer this just takes you 
to another error which is an endless loop which needs to be 
addressed....
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: wongloktim 
[mailto:wloktim@xxxxxxxxxxxxxx]Sent: Thursday, January 29, 2004 8:41 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Need 
helip to convert Gann Swing from FibornacciTrader into AFL 
CodeMy AFL 
Code:--------------------------------------------------------------function 
GannSwing(H,L,C){/*{Market swing is defined as:  Up = 2 higher 
highs,  Down = 2 lower lows.}*/  
Us=BarsSince(Sum(H>Ref(H,-1),2)==2);  
Ds=BarsSince(Sum(L<Ref(L,-1),2)==2);  
Hc=HighestSince(Us==0,H,1);  Lc=LowestSince(Ds==0,L,1);  
Sd1=IIf(Us==0,     IIf((L!=Lc) AND 
(Ref(L,-1)!=Lc),     1,     
0),     IIf(Ds==0,     
IIf((H!=HC) AND (Ref(H,-1)!=Hc),     
-1,     0),     0));  
Sd2=IIf(Sd1==1,     IIf(Ref(BarsSince(Sd1==1),-1) 
>     
Ref(BarsSince(Sd1==-1),-1),     
1,     0),     
IIf(Sd1==-1,     IIf(Ref(BarsSince(Sd1==1),-1) 
<     
Ref(BarsSince(Sd1==-1),-1),     
-1,     0),     0));  
TD1=ValueWhen(Sd2!=0,Sd2,1);    return 
TD1;}BarHigh=0;BarLow=0;for(i=0; i<BarCount; 
i++){ M=GannSwing(H,L,C);  MyHigh=-9999;  
MyLow=9999;  while(M>0)  { 
if(H[i]>=MyHigh)     { 
MyHigh=H[i];       
BarHigh=i;}       }   
Swing[BarHigh]=MyHigh;  while(M<0)  { 
if(L[i]<=MyLow)     { 
MyLow=L[i];       BarLow=i;  }  
  }   
Swing[BarLow]=MyLow;}-----------------------------------------------------------------------------------------------------------------------ERROR 
Message-------------------------Line 54, Column 
1:       BarLow=i;  }  
  }   Swing[BarLow]=MyLow;}^Error 
3.Condition in IF, WHILE, FOR statementshas to be Numeric or Boolean 
type.You can not use array here,please use [] (array subscript 
operator)to access array elementsCan anyone  help me to 
complete it and show me where is the 
errorThankSend 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 


Yahoo! Groups Links
  To visit your group on the web, go to:<A 
  href="">http://groups.yahoo.com/group/amibroker/  

  To unsubscribe from this group, send an email to:<A 
  href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 



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 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.