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

[amibroker] Successive Buy Statements



PureBytes Links

Trading Reference Links

The following is from Herman van den Bergen's trading system 
development tutorial which can be accessed from Amibroker's support 
page.  My question does not relate to the system (which he suggests 
not be traded).  Rather, my question relates to the use of multiple 
buy statements (the last of which is in a comment but he suggests 
removing the // later).  When Amibroker sees multiple buy (or sell, 
etc) statements, how does it interpret them?  Does it consider them 
all with a subsequent statement modifying the result of the 
previous?  Does the order in which they are stated matter?  

Also, I've read the help file description of the use of = and ==, but 
still not clear when it is appropriate to use one rather than the 
other.

Any help would be appreciated.

/*Smoothed Stochastic CCI*/
P =6;D=DateNum()>1000301;
Blevel =Optimize("BL",12,10,20,1);Slevel = Optimize("SL",70,70,90,1);
StOcci=100*(CCI(6)-LLV(CCI(6),14))/(HHV(CCI(6),14)-LLV(CCI(6),14));
stocci=MA(stocci,5);
Buy=Cross(STOCCI,BLEVEL);Sell= Cross(STOCCI, Slevel);
Buy=D*(Buy);Sell=D*Sell;Short = Sell;Cover = Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
E1=Equity();EM40=MA(E1,40);
XB=Flip(Buy,Sell);XS=Flip(Sell,Buy);
XSH=2*Flip(Short,Cover);XCO=2*Flip(Cover,Short);
XBSH=(XB+XSH);
XSXCO=(XS+XCO);
ASC=Cross(E1,EM40);DESC=Cross(EM40,E1);
// Buy=ASC*(XBSH==1);Sell=DESC*(XSXCO==1);
//Short=ASC*(XBSH==2);Cover=DESC*(XSXCO==2);


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/