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

Re: [amibroker] Anyone using Amibroker with 6-8 realtime charts? - CPU staying at 100% all the time



PureBytes Links

Trading Reference Links

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greetings Bruiser,
	see interspersed comments.

On Tue, 6 Apr 2004 21:52, bruiserbbq wrote:
> Ok here's what I have got so far ( but still a bit lost):
>
> /*  MMACD - DEMA Offset  */
>
> Value = Param("DEMA OffSet Periods",1,55,9);
> Trigger = Param("Trigger Line",1,55,13);

fine.

> Short =(EMA(Close,3, EMA(Close,5,
> EMA(Close,7,EMA(Close,9,
> EMA(Close,11,EMA(Close,13,

Missing some close parens ')', probably some '+' (given your original code) 
and a terminating semicolon ';'.  Also, unlike MS, AB allows pretty much as 
much whitespace as you want.  Believe me, it makes reading code a *lot* 
easier.  I'd have written the above snippet as...

Short = EMA(Close,3) + EMA(Close,5) + EMA(Close,7) +
        EMA(Close,9) + EMA(Close,11) + EMA(Close,13);

Except I would have used 'ShortTerm' rather than 'Short' as the variable name, 
since 'Short' is a reserved var used by AB as a flag to start a short 
position when backtesting.


> LONG =(EMA(Close,30,EMA(Close,34,
> EMA(Close,38,EMA(Close,42,
> EMA(Close,46,EMA(Close,50,

All the comments above for Short apply here as well. (Also use 'LongTerm', not 
'Long').

> MMACD =((Short-Long)/Long)*100

Missing terminating semicolon.


> MMACD1 =EMA(EMA(MMACD,Value,),Value,);

Too many commas.  They are used to seperate arguements to a function.  Since 
EMA() take 2 args, there should only be one comma (each).

As an asside, a DEMA is *not* an EMA of an EMA, it's a low-lag version of an 
EMA.  AB has it as a builtin function DEMA(), so does MS for that matter.


> MMACD-MMACD1;
> EMA(MMACD-MMACD1,Trigger,);	// too many commas
> 0;

These are unassigned expressions, in MS they will be automatically plotted.  
In AB if you want something plotted, you have to say you want something 
plotted.  So....

Plot(MMACD-MMACD1, "MMACD difference", colorRed);
Plot(EMA(MMACD-MMACD1,Trigger), "MMACD Signal", colorBlue);
Plot(0,"Zero", colorBlack);

Although the last one, the Plot(0...), is probably meant as a grid line, so 
leave it out and just tick the zero box in IB (Indicator Builder).

>
>
> AND HERE'S THE METASTOCK CODE I'M TRYING TO CONVERT:
>
> Value:=Input("DEMA OffSet Periods",1,55,9);
> Trigger:=Input("Trigger Line",1,55,13);
> SHORT:=(Mov(CLOSE,3,E)+Mov(CLOSE,5,E)+
> Mov(CLOSE,7,E)+Mov(CLOSE,9,E)+
> Mov(CLOSE,11,E)+Mov(CLOSE,13,E));
> LONG:=(Mov(CLOSE,30,E)+Mov(CLOSE,34,E)+
> Mov(CLOSE,38,E)+Mov(CLOSE,42,E)+
> Mov(CLOSE,46,E)+Mov(CLOSE,50,E));
> MMACD:=((Short-Long)/Long)*100;
> MMACD1:=Mov(Mov(MMACD,Value,E),Value,E);
> MMACD-MMACD1;
> Mov(MMACD-MMACD1,Trigger,E);
> 0;
>
> Thanks in advance
>

Your welcome.

> Bruiser
> downunder
>

- -- 
	Nigel Rowe
	rho@xxxxxxxxxxxxxxx


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAcyJvBbmcM2pfckkRAh/IAJ9B8/d15ohsMZxRmy1N7rfBqMiuDACgyzxh
c8Cjkha6D/QbZv9lbJsa2uE=
=7Foq
-----END PGP SIGNATURE-----



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/