PureBytes Links
Trading Reference Links
|
Hi
Bflori,Try this in the Automatic Analysis window:
diwave=IIf(PDI(14)>MDI(14),1,-1);
<FONT face=Arial
size=2>MACDwave=IIf(EMA(C,12)-EMA(C,26)>EMA(EMA(C,12)-EMA(C,26),9),1,-1);
period = 14;
StochRSI = 100*( ( RSI( period ) - LLV( RSI( period )
, period ) ) / ( ( HHV(RSI( period ) , period ) ) - LLV(RSI( period
),
period ) ) );
SRSIwave=IIf(StochRSI>=50,1,-1);
Buy=mawave+diwave+SRSIwave+MACDwave=4 AND
MA(V,50)>=1000 AND C>=10;
Sell=mawave+diwave+SRSIwave+MACDwave=-4;
Buy AND
BarsSince(Ref(Buy,-1))>BarsSince(Ref(Sell,-1));
-john
----- Original Message ----- From: "bflori"
<bflori@xxxxxxx>To: <amibroker@xxxxxxxxxxxxxxx>Sent: Sunday,
October 26, 2003 11:37 AMSubject: [amibroker] Buy/Sell
Formula> I have the following formula which I wrote for MetaStock
that > functions OK. I'm new to AmiBroker and I would like to reproduce
> this is AFL. I seem to struggle with mistakes. Could anyone give me
> the AFL equivalent code? > >
mawave:=If(Mov(C,5,E)>Mov(C,17,S),+1,-1);>
diwave:=If(PDI(14)>MDI(14),+1,-1);>
MACDwave:=If(Mov(C,12,E)-Mov(C,26,E)>Mov(Mov(C,12,E)-Mov(C,26,E),>
9,E),+1,-1);> SRSIwave:=If(Fml("StochRSI14")>=50,+1,-1);>
> Buy:=(mawave+diwave+SRSIwave+MACDwave)=+4 AND
Mov(V,50,S)>=1000> AND
(C>=10);> Sell:=:=(mawave+diwave+SRSIwave+MACDwave)=-4;>
> Buy AND BarsSince(Ref(Buy,-1))>BarsSince(Ref(Sell,-1))>
> Many thanks,> bflori@xxxxxxx> > > >
> > ------------------------ Yahoo! Groups Sponsor
---------------------~-->> Buy Ink Cartridges or Refill Kits for your
HP, Epson, Canon or Lexmark> Printer at MyInks.com. Free s/h on orders
$50 or more to the US & Canada.>
http://www.c1tracking.com/l.asp?cid=5511>
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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/
> >
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|