PureBytes Links
Trading Reference Links
|
Elegant is in the eye of the beholder, Juan--sorry I meant Jose ;)
<<The purpose of this EMA:
Plot a normal EMA with 200 periods on a chart, and you'll see no plot
for the first 200 periods. My code takes care of that.>>
I believe Dimitris presented [commented] code that plotted in the background color till it was time to be seen.
<<Why - does x get worn out? :)>> Just good form, old boy :)
<<So, any thoughts on why this doesn't work:>>
The code I saw was
----
IIf(display=2, // <-----
Plot(0,"",colorBlue,styleLine),
Plot(Close,"",1,128));
IIf(display=2, // <----
Plot(signals,"EMA signals",colorRed,styleLine),
Plot(EMA1,"EMA",colorRed,styleLine));
----
We all copy Jose, [as with your <<x = IIf(x==1,O,IIf(x==1,H,IIf(x==1,L,IIf(x==1,V,C))));>>], the proof's in remebering to make the
changes you intended before inflicting it on the world.
Regards,
Bob
-----Original Message-----
From: Jose [mailto:josesilva22@xxxxxxxxx]
Sent: Friday, June 13, 2003 9:33 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: EMA/breakout signals composite indicator
Bob, Juan is not here - hope you don't mind if I reply instead... ;)
> You are trying to write a opus; did you proceed incrementally and
get pieces to work?
It's actually very simple code. Elegant if I may say so. There is no
redundant code there anywhere.
The purpose of this EMA:
Plot a normal EMA with 200 periods on a chart, and you'll see no plot
for the first 200 periods. My code takes care of that.
> Perhaps a comment or two would help, as would meaningful variable
names.
Will do that from now on. Used to coding in MetaStock, where coding
space is minimal (2K).
> P = IIf(x==1,O,IIf(x==2,H,IIf(x==3,L,IIf(x==4,V,C)))); // don't
reuse x!!!
Why - does x get worn out? :)
> I haven't a clue what you intend by prds = IIf(Cum(x!=-101)<pds,
Cum(x!=-101),pds);
> the sum of any of the prices arrays will never be negative [and you
reused prds again!!! ].
The reason for this is that I intend to use this EMA on oscillators
with negative values as well, that is, as soon as I find the "P"
variable equivalent of MetaStock.
So, any thoughts on why this doesn't work:
IIf(display=2,
Plot(signals,"EMA signals",colorRed,styleLine),
Plot(EMA1,"EMA",colorRed,styleLine));
// If parameter display choisen = 2, plot EMA crossover signals,
otherwise plot EMA
Why is AB plotting both outputs?
*Jose*
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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|