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

[amibroker] Scripting - Macros - Application Automation...



PureBytes Links

Trading Reference Links

Hi
 I am trying to convert a TS4 file to Amibroker format it includes 
if else statements and I get the following error message and don't 
know what to do

Error 3.
Condition in IF, WHILE, FOR statements
has to be Numeric or Boolean type.
You can not use array here,
please use [] (array subscript operator)
to access array elements

The following is the code I am using.

Length = 10;
if (HHV(H,Length) - LLV(L,Length) > 0 AND C - LLV(L,Length) > 0) 
SloFastK = (EMA((Close - LLV(L,Length)) / (HHV(H,Length) - LLV
(L,Length)) * 100,3)); 
else (SloFastK = 0); 
// Calculate raw stochastic using xma from above (SloFastK) 
Value1 = LLV(SloFastK,Length);
Value2 = HHV(SloFastK,Length) - Value1;
Value3 = SloFastK;

if Value2 > 0 then
	NewFastK = (Value3 - Value1) / Value2 * 100
else 
	NewFastK = 0;

Cycle = Factor * NewFastK + (1 - Factor) * Ref(Cycle,-1);
Plot(Cycle,"DGL-Cycle-10",colorYellow); 


What do I need to do to make this work as I have other files that 
use if else statements that I would like to use.
Thanks
Ernie



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/