MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Soybean Intermarket 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 Intermarket System


Buy

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,5)>85 AND CROSS(80, IMAX) AND STOCH(15,3)>MOV(STOCH(15,3),4,S) AND ROC(C,2,%)>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


 


Sell Short

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,5) <10 AND CROSS(IMIN,15) AND STOCH(15,3)<MOV(STOCH(15,3),4,S) AND ROC(C,2,%)<-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

 

Source / From: TOP
http://www.activetradermag.com/index.php/c/Strategy_code  

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!