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

RE: [amibroker] Renko chart code revC



PureBytes Links

Trading Reference Links

Looks like Don's Bressert DSS, Ernie.
You don't need if/else.
Either form Booleans directly and multiply by them
----
go = (HHV(H,Length) - LLV(L,Length) > 0 AND C - LLV(L,Length) > 0);

SloFastK = go*(EMA((Close -
LLV(L,Length))/(HHV(H,Length)-LLV(L,Length))*100,3));
-----
or, better, use Nz
---
SloFastK = Nz(EMA((Close - LLV(L,Length))/(HHV(H,Length)-LLV(L,Length))
* 100,3));
---
Using AMA for your xma,  a 1st shot at the final code is
---
Length = 10; Factor = 0.6;
SloFastK = Nz(EMA((Close - LLV(L,Length))/(HHV(H,Length)-LLV(L,Length))
* 100,3));

// Calculate raw stochastic using xma from above (SloFastK)
Value1 = LLV(SloFastK,Length);
Value2 = HHV(SloFastK,Length) - Value1;
Value3 = SloFastK;

NewFastK = Nz(Value3 - Value1) / Value2 * 100;

Cycle = AMA(NewFastK, factor);
Plot(Cycle,"DGL-Cycle-10",colorYellow);
-----


Bob


-----Original Message-----
From: Ernie Newman [mailto:ewn87544@xxxxxxxxxxx]
Sent: Friday, August 13, 2004 12:46 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Help with Error Message


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




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







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