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

Re: [amibroker] Relative Strength Comparitive and ROC (newbie)



PureBytes Links

Trading Reference Links

Anthony, can I ask just one more favour? How can this be optimized?
I have changed your original code (see below) but I'm not smart 
enough to optimize it :-)

xx = EMA(PDI(44)-MDI(44),5);
zz = EMA(EMA(PDI(44)-MDI(44),5),3);

// Close Short & Enter long

Value=EMA(PDI(44)-MDI(44),5);
Trigger=EMA(EMA(PDI(44)-MDI(44),5),3);
Buy= Value > Trigger AND Ref(Value,-1) <= Ref(Trigger,-1);

//Close Long & Enter Short

Value=EMA(PDI(44)-MDI(44),5);
Trigger=EMA(EMA(PDI(44)-MDI(44),5),3);
Sell=Value < Trigger AND Ref(Value,-1) >= Ref(Trigger,-1);

Short=Sell;
Cover=Buy;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

Plot(xx,"",colorGreen,1);
Plot(zz,"",colorRed,1);

Title=Date()+" "+EncodeColor(colorBlue)+Name()+" "+FullName()

+"Directional Oscillator";

PlotShapes(Buy*shapeUpArrow,colorGreen);

PlotShapes(Sell*shapeDownArrow,colorRed);


Cheers Bruiser



------------------------ 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/