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

RE: [amibroker] AFL - Translatin TS code



PureBytes Links

Trading Reference Links

Ara,

If you have TS code you are interested in translating, and it is of 
potential interest to others, it's a good risk:reward ratio <g> 
someone will pick it up and translate it if for any reason you are 
unable to and you post it to the board. 

Gordon

--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxxx> wrote:
> The code below gives me an error of:
> Error 3.
> Condition in IF, WHILE, FOR statements
> has to be Numeric or Boolean type
> 
> Problem area highlighted below.
> 
> Anyone see the problem?
> 
> Thanks
> 
> Ara
> 
> PS: Does anyone have this code already (John Ehler's Trendline). 
Trying to convert from Trade Station
> 
> 
> //File: DEV - Ehler Trendline
> 
> Price =(H+L)/2;
> 
> Imult =0.635;
> 
> Qmult =0.338;
> 
> InPhase =0;
> 
> Quadrature =0;
> 
> Phase =0;
> 
> DeltaPhase =0;
> 
> count =0;
> 
> InstPeriod =0;
> 
> Period =0;
> 
> Trendline =0;
> 
> 
> 
> if (LastValue(BarIndex()) > 5)
> 
> //Detrend Price
> 
> {Value3 = Price - Ref(Price,-7);}
> 
> 
> 
> //Compute InPhase AND Quadrature components
> 
> Inphase = 1.25*(Ref(Value3,-4) - Imult*Ref(Value3,-2)) + Imult*Ref
(InPhase,-3);
> 
> Quadrature = Ref(Value3,-2) - Qmult*Value3 + Qmult*Ref(Quadrature,-
2);
> 
> //Use ArcTangent to compute the current phase
> 
> LastInPhase = LastValue(InPhase);
> 
> if (abs(LastInPhase + Ref(LastInPhase,-1)))                  // 
<==== Problem in Ref(LastInPhase,-1)
> 
> {
> 
> //Phase = atan(abs((Quadrature+Ref(Quadrature,-1)) / (InPhase+Ref
(InPhase,-1))));
> 
> a=0;
> 
> }



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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:
     http://docs.yahoo.com/info/terms/