This is their current version in EasyLanguage
{
CashCow automated trading system
Architect: Jack Hershey
Version 0.3
12 Dec 2008
New functionality: Context Supression Logic. Diagnostic Module.
New enhancements: Better organized code structure for natural reading.
Bug fixes: none
}
//Data Module
variables:
Stoch5FastK( 0 ), Stoch5FastD( 0 ), Stoch5SlowK( 0 ), Stoch5SlowD( 0 ),
Stoch14FastK( 0 ), Stoch14FastD( 0 ), Stoch14SlowK( 0 ), Stoch14SlowD( 0 ),
MACDVal( 0 ), MACDMA( 0 ), MACDDiff( 0 ),
TimeOK(False),
VolumeOK(False),
CurrentbarOK(False),
LongOK(False),
ShortOK(False),
DateOK(False);
//Formula Module
Value1 = Stochastic( H, L, C, 5, 2, 3, 1, Stoch5FastK, Stoch5FastD, Stoch5SlowK, Stoch5SlowD ) ;
Value2 = Stochastic( H, L, C, 14, 1, 3, 1,
Stoch14FastK, Stoch14FastD, Stoch14SlowK, Stoch14SlowD ) ;
MACDVal = MACD( Close, 5, 13 ) ;
MACDMA = XAverage( MACDVal, 6 ) ;
MACDDiff = MACDVal - MACDMA ;
//Context Supression Logic
if Time > 945 and Time < 1600 then TimeOK = True else TimeOK = False;
if Volume of 1 bar ago > 20000 then VolumeOK = True else VolumeOK = False;
if currentbar > 2 then CurrentbarOK = True else CurrentbarOK = False;
if MACDDiff > 0 then LongOK = true else LongOK = false; //Needs to be validated and then tuned.
This is another condition that needs to be added. The MACD>than it's signal line
if MACDDiff < 0 then ShortOK = true else ShortOK = false; //Needs to be validated and then tuned.
Another, MACD<smamacd
Julian dates, not sure what the conversion is, apparently only for testing
if date = 1081210 then DateOK = true else DateOK = false; //Only used during testing phase.
if CurrentBarOK and TimeOK and DateOK then
begin
If all those
//Entry Logic
if VolumeOK then //enter only when volume greater than 'Medium'
begin
if LongOK and Stoch5FastK crosses above 50 and Stoch5FastK > Stoch5FastD and marketposition = 0 then
Buy ( "S5FKLE" ) 1 contract this bar at close ;
if ShortOK and Stoch5FastK crosses below 50 and Stoch5FastK < Stoch5FastD and marketposition = 0 then
Sellshort ( "S5FKSE" ) 1 contract this bar at close ;
end;
//Reverse logic
If VolumeOK then
begin
if ShortOK and marketposition > 0 and Stoch5FastK crosses below 50 then
sellshort ( "S5FKRS" ) 1 contracts this bar at close ;
if LongOK and marketposition < 0 and Stoch5FastK crosses above 50 then
buy ( "S5FKRL" ) 1 contracts this bar at close ;
end;
//Exit Logic
{ Hold Logic. Tee up stub for later.
if absvalue( MACDVal ) < 1.4 then }
if {(Stoch14SlowK < Stoch14SlowD) and} (Stoch14SlowK crosses below 80) and marketposition > 0 then
Sell ( "S14SKLX" ) 1 contract this bar at close ;
if {(Stoch14SlowK > Stoch14SlowD) and} (Stoch14SlowK crosses above 20) and marketposition < 0 then
buytocover ( "S14SKSX" ) 1 contract this bar at close ;
if marketposition > 0 and Stoch14SlowK crosses below Stoch14SlowD then
sell ( "S14KDLX" ) 1 contract this bar at close ;
if marketposition < 0 and Stoch14SlowK crosses above Stoch14SlowD then
buytocover ( "S14KDSX" ) 1 contract this bar at close ;
if marketposition > 0 and Stoch5FastK crosses below 50 then
sell ( "S5FKSX" ) 1 contracts this bar at close ;
if marketposition < 0 and Stoch5FastK crosses above 50 then
buytocover ( "S5FKLX" ) 1 contracts this bar at close ;
//Diagnostic Module
{Remove brackets and define date to enable.
if date = 1081210 then
Print(File("c:\log.txt"), time, Stoch5FastK, Stoch5FastD, Stoch5SlowK, Stoch5SlowD,
Stoch14FastK, Stoch14FastD, Stoch14SlowK, Stoch14SlowD,
MACDVal, MACDMA, MACDDiff, " ",Volume[0]);
if date = 1081210 then
Print(Stoch5FastK, Stoch5FastD, Stoch5SlowK, Stoch5SlowD,
Stoch14FastK, Stoch14FastD, Stoch14SlowK, Stoch14SlowD,
MACDVal, MACDMA, MACDDiff, " ",Volume[0]);
}
end;
//End of Day Module
if Time > 1600 and marketposition > 0 then sell ( "EODLX" ) next bar at market;
if Time > 1600 and marketposition < 0 then buytocover ( "EODSX" ) next bar at market;
Changing the MACDVAl turned mine into a jackpot with 1 loser out of 20