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

OT - RE: [amibroker] Re: Previous close prices on n = -1 MACD cross?



PureBytes Links

Trading Reference Links

I have been using AB for nearly 3 years I think. 
It took about 3 months initially as I had never programmed a chart package
like this before to become proficient enough to proceed past simple
formulae. But then 3 years ago there was a lot less to learn :)

I started simple to learn how to put codes together by just learning basic
tasks and using simple built in indicators. Once I understood basic
explore/scan/backtest and chart codes I then started with making my own more
complex codes. 

A big suggestion to all starters, do not try to do complex codes or
functions. Keep it Simple!

Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: Quad Rate Serial Abby [mailto:quad_pumped_abby@xxxxxxxxx] 
Sent: Wednesday, December 22, 2004 7:51 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Previous close prices on n = -1 MACD cross?



Thanks Graham.  I see the answer was obvious for you too.  Thanks a 
lot for your help.  How long did it take you to become proficient in 
AFL?  I'm reading as much as I can but it is still confusing.  At 
least I used to be somewhat adept at FORTRAN, which probably helps 
me understand the flow structure better than someone with no 
previous programming experience, but I'm still pretty much lost.  

--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> Hope this helps
> 
> M_LINE = MACD(RET_1, RET_2);
> S_LINE = Signal(RET_1, RET_2, RET_3);
> 
> PRES_CROSS = Cross(M_LINE, S_LINE);
> //PREV_CROSS = Cross(M_LINE, S_LINE);
> 
> 
> PREV_CLOSE = ValueWhen(Cross(M_LINE, S_LINE), C, 2);//added comma 
and
> changed 1 to 2 as the 1 will be last cross (present)
> 
> Cheers,
> Graham
> http://e-wire.net.au/~eb_kavan/
> 
> -----Original Message-----
> From: Quad Rate Serial Abby [mailto:quad_pumped_abby@x...] 
> Sent: Wednesday, December 22, 2004 6:58 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Previous close prices on n = -1 MACD cross?
> 
> 
> 
> I am trying to write code that will return the closing price on 
the 
> date of the last cross of the signal line by the MACD line prior 
to 
> a cross of the same type occuring today.  I have a selectio of 
code 
> here, but am getting a syntax error trying to use the ValueWhen 
> function.  Does anybody see anything wrong with this? TIA.
> 
> RET_1 = Prefs( 11 );
> RET_2 = Prefs( 12 );
> RET_3 = Prefs( 13 );
> 
> M_LINE = MACD(RET_1, RET_2);
> S_LINE = Signal(RET_1, RET_2, RET_3);
> 
> PRES_CROSS = Cross(M_LINE, S_lINE);
> PREV_CROSS = Ref(Cross(M_LINE, S_LINE), -1);
> 
> PREV_CLOSE = ValueWhen(Ref(Cross(M_LINE, S_LINE), -1) C, 1);
> 
> 
> 
> 
> 
> 
> 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






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/