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

Re: [amibroker] AFL basic help needed please



PureBytes Links

Trading Reference Links

Hi Phil,

If this is not exactly what you want it should give you some ideas on how to get there. You can set the BuyPrice and delay (1) via the Backtester settings | Trades tab.

Crossover = Ref( Cross( C, MA( C, 50 ) ), -1 );
HigherHigh = H > Ref( H, -1 );
LowerLow = L > Ref( L, -1 );
Buy = Crossover AND HigherHigh AND LowerLow;
Sell = DayOfWeek() == 5;
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );


Regards,
William Peters
www.amitools.com




Monday, May 23, 2005, 8:27:56 PM, you wrote:
d>    Hello, I've been trying for weeks now on this problem and would very 
d>  much appreciate any guidance . How do I PROPERLY write AFL code for
d>  the 
d>  following:
d>  1st...the  closing price crosses over the 50day moving avg.,(I'm
d>  using 
d>  daily bar chart data ) 
d>  2nd... there is a higher high and higher low on the NEXT BAR ,after 
d>  the 1st condition is met 
d>          If BOTH conditions are met, I then buy the OPEN , on the 
d>  next bar or 3rd bar . 
  
d>  Here is the code I have written :

d>  Crossover=Cross( Close, MA(Close,50) );
d>  Higherhigh = H >Ref(H,-1);
d>  Lowerlow=L > Ref(L,-1);
d>  Buy= crossover AND Higherhigh AND Lowerlow ;
d>  Sell=DayOfWeek()==5; 
  
d>    thank you very much for help here in advance , Phil 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/