{
CashCow automated trading system
Architect: Jack Hershey
Version 0.1
11 Dec 2008
}
variables:
FastK5( 0 ), FastD5( 0 ), SlowK5( 0 ), SlowD5( 0 ),
FastK14( 0 ), FastD14( 0 ), SlowK14( 0 ), SlowD14( 0 ) ;
if Time > 945 and Time < 1600 then begin
Value1 = Stochastic( H, L, C, 5, 2, 3, 1, FastK5, FastD5, SlowK5, SlowD5 ) ;
Value2 = Stochastic( H, L, C, 14, 1, 3, 1, FastK14, FastD14, SlowK14, SlowD14 ) ;
condition1 = CurrentBar > 2 and FastK5 crosses over 50 ;
if condition1 and marketposition = 0 then
Buy ( "FastK5LE" ) 1 contract this bar at close ;
condition2 = CurrentBar > 2 and FastK5 crosses below 50 ;
if condition2 and marketposition = 0 then
Sellshort ( "FastK5SE" ) 1 contract this bar at close ;
condition3 = CurrentBar > 2 and (SlowK14 < SlowD14) and (SlowK14 crosses below 80) ;
if condition3 and marketposition > 0 then
Sell ( "SlowK5LX" ) 1 contract this bar at close ;
condition4 = CurrentBar > 2 and (SlowK14 > SlowD14) and (SlowK14 crosses above 20) ;
if condition4 and marketposition < 0 then
buytocover ( "SlowK5SX" ) 1 contract this bar at close ;
variables: MACDVal( 0 ), MACDMA( 0 ), MACDHist( 0 ) ;
MACDVal = MACD( Close, 5, 13 ) ;
MACDMA = XAverage( MACDVal, 6 ) ;
MACDHist = MACDVal - MACDMA ;
{
condition5 = CurrentBar > 2 and absvalue( MACDVal ) < 1.4 ;
if condition5 and marketposition > 0 then
Sell ( "MACDLX" ) this bar at close ;
if condition5 and marketposition < 0 then
Buytocover ( "MACDSX" ) this bar at close ;
}
end;
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;