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

[amibroker] Re: Help! need guru to crack code for newbe



PureBytes Links

Trading Reference Links


Andy - you'll get slightly better results if your MACD<>Signal line 
as opposed to zero.

per1 = Optimize("per1",7,3,22,1);
per2 = Optimize("per2",50,20,70,1);

Buy = WMA(C,per1) > WMA(C,per2) AND MACD()>Signal();
Sell = WMA(C,per1) < WMA(C,per2) AND MACD()<Signal();
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

Also - just type in "MACD" into the Search index of AB and you will 
get plenty of hits.  Look up the 'MACD Optimize' in the AFL library 
and you will learn how to optimize the MACD and Signal also. 

--- In amibroker@xxxxxxxxxxxxxxx, "dalengo" <dalengo@xxxx> wrote:
> 
> Andy,
> --------8<-------------------------------------------------------
> //simple system combining two conditions to be met simultaneously
> 
> per1 = Optimize("per1",7,3,22,1);
> per2 = Optimize("per2",50,20,70,1);
> 
> Buy = wma(c,per1,) > wma(c,per2) and macd()>0;
> Sell = wma(c,per1,) < wma(c,per2) and macd()<0;
> Buy = ExRem(Buy,Sell);
> Sell = ExRem(Sell,Buy);
> --------8<-------------------------------------------------------
> //Note: code snippet below by hairymug generally won't work
> //'cause his AND conditions must be true on the *same* bar,
> //that generally won't happen. 
> //Solution: define the *buy zone* and then remove extra signals.
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "hairy_mug" <WSCHWARZ@xxxx> wrote:
> > 
> > This will get U started;
> > Use this as an examlple and U can code the "sell"...
> > Walt
> > 
> > 
> > L1=optimize("l1",5,3,10,1); 
> > L2=optimize("l2",5,40,60,1); 
> > 
> > buy=cross(wma(c,L1),wma(c,L2)) and cross(macd(),0);
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, Andrew Semryck 
> <andrewsemryck@xxxx> 
> > wrote:
> > > Hello,
> > > 
> > > I'm trying to learn the AFL codeing and was wondering
> > > if someone can write a system formula for me.
> > > 
> > > I want to buy when the 7 Period WMA crosses over the
> > > 50 Period WMA + the MACD crossing over the 0 Line. 
> > > And the opposite for sells.  Also what would the
> > > formula be if I wanted to Optimize the Periods.
> > > 
> > > 
> > > Thanks for your help,
> > > 
> > > Andy
> > > 
> > > 
> > > 
> > > 		
> > > __________________________________ 
> > > Do you Yahoo!? 
> > > Make Yahoo! your home page 
> > > http://www.yahoo.com/r/hs





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/