|
|
Soybean Combo System by Markos Katsanos |
|
|
Soybean Intermarket divergence system Copyright Markos Katsanos 2009
To recreate the tests click on enhanced system tester, click on new___ system and type the buy, sell, short and buy to cover code. To run the test, click on new simulation, add securities, and select the Soybean Pit Futures Continuous (Reuters Symbol:@:3Sc1).Then select periodicity daily, click on next and select Default size: 50 units. Then click on trade execution, uncheck realistic market prices, select buy price and sell price at close with 1 day delay and fill in the commissions of $100 per transaction.
You will need also to change the first two lines of the code to point to the appropriate folder in your hard drive where the data for Soybean Oil and Corn continuous contacts are located.
If you wish to replicate the test please keep in mind that for the test to begin producing any signals, the indicators used should be first calculated and this requires at least 360 extra bars (514 calendar days) to be loaded.
METASTOCK CODE FOR THE SOYBEAN COMBO SYSTEM
|
|
Buy
SEC1:=Security("C:Metastock DataREUTERSFUTURES@:BOc1",C);
SEC2:=Security("C:Metastock DataREUTERSFUTURES@:Cc1",C);
SEC3:=Security("C:Metastock dataREUTERSFOREX.DXY",C);
SEC4:=Security("C:Metastock dataREUTERSINDEX.CRB",C);
b:=Correl(C,SEC2,100,0)*Stdev(C,100)/(Stdev(SEC2,100)+.001);
a:=mov(C,100,S)-b*MOV(SEC2,100,S);
pred:=b*SEC2+a;DIVERG:=MOV((PRED-C),3,E);
IMC:=(Mov( DIVERG - LLV(DIVERG,200), 3,S) * 100)/(Mov( HHV(DIVERG,200) - LLV(DIVERG,200), 3,S)+.01 ); b1:=Correl(C,SEC1,150,0)*Stdev(C,150)/(Stdev(SEC1,150)+.001);
a1:=mov(C,150,S)-b1*MOV(SEC1,150,S);
pred1:=b1*SEC1+a1;DIVERG1:=MOV((PRED1-C),3,E);
IMS:=(Mov( DIVERG1 - LLV(DIVERG1,200), 3,S) * 100)/(Mov( HHV(DIVERG1,200) - LLV(DIVERG1,200), 3,S)+.01 );
IMAX:=MAX(IMC,IMS);
(HHV(IMAX,5)>85 AND CROSS(80, IMAX) AND STOCH(15,3)>MOV(STOCH(15,3),4,S) AND ROC(C,2,%)>1 ) OR (CROSS(MOV(C,10,E),MOV(C,80,E)) AND MOV(C,10,E)>REF(MOV(C,80,E),-1) AND MOV(SEC3,50,E)<REF(MOV(SEC3,50,E),-1) AND MOV(SEC4,50,E)>REF(MOV(SEC4,50,E),-1))
|
| |
Sell
SEC1:=Security("C:Metastock DataREUTERSFUTURES@:BOc1",C);
SEC2:=Security("C:Metastock DataREUTERSFUTURES@:Cc1",C);
b:=Correl(C,SEC2,100,0)*Stdev(C,100)/(Stdev(SEC2,100)+.001);
a:=mov(C,100,S)-b*MOV(SEC2,100,S);
pred:=b*SEC2+a;DIVERG:=MOV((PRED-C),3,E);
IMC:=(Mov( DIVERG - LLV(DIVERG,200), 3,S) * 100)/(Mov( HHV(DIVERG,200) - LLV(DIVERG,200), 3,S)+.01 ); b1:=Correl(C,SEC1,150,0)*Stdev(C,150)/(Stdev(SEC1,150)+.001);
a1:=mov(C,150,S)-b1*MOV(SEC1,150,S);
pred1:=b1*SEC1+a1;DIVERG1:=MOV((PRED1-C),3,E);
IMS:=(Mov( DIVERG1 - LLV(DIVERG1,200), 3,S) * 100)/(Mov( HHV(DIVERG1,200) - LLV(DIVERG1,200), 3,S)+.01 );
IMIN:=MIN(IMC,IMS);
LLV(IMIN,7)<20 AND IMIN>LLV(IMIN,7)+10 OR C<REF(MOV(C,5,S),-1)-3*ATR(10)
|
| |
Sell Short
SEC1:=Security("C:Metastock DataREUTERSFUTURES@:BOc1",C);
SEC2:=Security("C:Metastock DataREUTERSFUTURES@:Cc1",C);
SEC3:=Security("C:Metastock DataREUTERSFOREX.DXY",C);
SEC4:=Security("C:Metastock DataREUTERSINDEX.CRB",C);
b:=Correl(C,SEC2,100,0)*Stdev(C,100)/(Stdev(SEC2,100)+.001);
a:=mov(C,100,S)-b*MOV(SEC2,100,S);
pred:=b*SEC2+a;DIVERG:=MOV((PRED-C),3,E);
IMC:=(Mov( DIVERG - LLV(DIVERG,200), 3,S) * 100)/(Mov( HHV(DIVERG,200) - LLV(DIVERG,200), 3,S)+.01 ); b1:=Correl(C,SEC1,150,0)*Stdev(C,150)/(Stdev(SEC1,150)+.001);
a1:=mov(C,150,S)-b1*MOV(SEC1,150,S);
pred1:=b1*SEC1+a1;DIVERG1:=MOV((PRED1-C),3,E);
IMS:=(Mov( DIVERG1 - LLV(DIVERG1,200), 3,S) * 100)/(Mov( HHV(DIVERG1,200) - LLV(DIVERG1,200), 3,S)+.01 );
IMIN:=MIN(IMC,IMS);
LLV(IMIN,5) <10 AND CROSS(IMIN,15) AND STOCH(15,3)<MOV(STOCH(15,3),4,S) AND ROC(C,2,%)<-1
OR (CROSS(MOV(C,80,E),MOV(C,10,E)) AND MOV(C,10,E)<REF(MOV(C,10,E),-1) AND MOV(SEC3,50,E)>REF(MOV(SEC3,50,E),-1) AND MOV(SEC4,50,E)<REF(MOV(SEC4,50,E),-1))
|
| |
Buy to Cover
SEC1:=Security("C:Metastock DataREUTERSFUTURES@:BOc1",C);
SEC2:=Security("C:Metastock DataREUTERSFUTURES@:Cc1",C);
b:=Correl(C,SEC2,100,0)*Stdev(C,100)/(Stdev(SEC2,100)+.001);
a:=mov(C,100,S)-b*MOV(SEC2,100,S);
pred:=b*SEC2+a;DIVERG:=MOV((PRED-C),3,E);
IMC:=(Mov( DIVERG - LLV(DIVERG,200), 3,S) * 100)/(Mov( HHV(DIVERG,200) - LLV(DIVERG,200), 3,S)+.01 ); b1:=Correl(C,SEC1,150,0)*Stdev(C,150)/(Stdev(SEC1,150)+.001);
a1:=mov(C,150,S)-b1*MOV(SEC1,150,S);
pred1:=b1*SEC1+a1;DIVERG1:=MOV((PRED1-C),3,E);
IMS:=(Mov( DIVERG1 - LLV(DIVERG1,200), 3,S) * 100)/(Mov( HHV(DIVERG1,200) - LLV(DIVERG1,200), 3,S)+.01 );
IMAX:=MAX(IMC,IMS);
HHV(IMAX,7)>70 AND IMAX<HHV(IMAX,7)-10 OR C>REF(MOV(C,5,S),-1)+3*ATR(10)
|
|
|
|
| Source / From: |
TOP |
| http://www.activetradermag.com/index.php/c/Strategy_code |
|
|