[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


Thanks.  I purchased PowerScan so that I could get some code from 
that as a starting place.  I actually believe in simple systems to 
begin with.  One other code I am working on is to buy a stock that 
has broken above the 50 day SMA and retested it and held, with the 
50 day SMA now in an uptrend on the retest.  Sell on a break of the 
50 day.  Very simple, yet productive. The only way to win the game 
is by following the money, and institutions add to positions on 
tests of MA's.  (The trouble is in making sure you have the first 
retest.  I'll work on it until I get completely stonewalled before I 
ask for help.  I'll never learn AFL otherwise.) 

I'm sure eventually I will try and develop some indicators to play 
with, but for now I only want to do what I know works for me.

Thanks again.   

--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> 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@x...] 
> 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 --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/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/