PureBytes Links
Trading Reference Links
|
Hi folks,
Below is some templated code I use to test buy and sell signals
against each other within my various systems. It exploits the
optimization function in order to test various indicator combinations
against each other. Has anyone come up with something similar that is
more efficient, code-wise? If so, would you be willing to share your
code?
Thanks,
Brian R.
Here's the full code for your perusal (this is only a code snippet
and must be modified to use) --
BuyRSI1 = Cross(RSI(14),20); // just an example
/// BUY SETTINGS ///
BuyCombo1 = ( Buy_RSI1 AND Buy_ADB1 AND Buy_IFT3 AND Buy_TDP2 AND
Buy_Cancel3);
BuyCombo2 = ( Buy_PVI1 AND Buy_ADB1 AND Buy_IFT3 AND Buy_TDP2 AND
Buy_Cancel2 AND Buy_Cancel3);
BuyCombo3 = ( Buy_PVI1 AND Buy_ADB1 AND Buy_IFT3 AND Buy_TDP2 AND
Buy_Cancel5);
BuyCombo4 = ( Buy_PVI1 AND Buy_ADB1 AND Buy_IFT3 AND Buy_TDP2 AND
Buy_Cancel2 AND Buy_Cancel5);
BuyCombo5 = ( Buy_ADB1 AND Buy_IFT3 AND Buy_TDP2);
// For Buy Optimization ONLY
VarBuy = Optimize("VarBuy",1,1,5,1);
Buy =
IIf(VarBuy==1,BuyCombo1,
IIf(VarBuy==2,BuyCombo2,
IIf(VarBuy==3,BuyCombo3,
IIf(VarBuy==4,BuyCombo4,
IIf(VarBuy==5,BuyCombo5,
0)))))
AND Volume>10000
AND Low>1.30;
// End Buy Optimization
// For Short Optimization ONLY
VarShort = Optimize("VarShort",200,200,207,1);
Short =
IIf(VarShort==200,ShortCombo200,
IIf(VarShort==201,ShortCombo201,
IIf(VarShort==202,ShortCombo202,
IIf(VarShort==203,ShortCombo203,
IIf(VarShort==204,ShortCombo204,
IIf(VarShort==205,ShortCombo205,
IIf(VarShort==206,ShortCombo206,
IIf(VarShort==207,ShortCombo207,
0))))))))
AND Volume>10000
AND Low>5.30;
// End Short Optimization
------------------------ 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/
|