BillySimas, here's the long side Easylanguage code:

Code:

[intrabarordergeneration = true]
input:
ema_fast_len (144),
ema_slow_len (169),
rsi_len (14),
rsi_overbought (65),
rsi_oversold (35)
;
var:
intrabarpersist ema_fast (0),
intrabarpersist ema_slow (0),
intrabarpersist ema_xup_bar (0),
intrabarpersist rsi_val (0),
intrabarpersist last_rsi_oversold_dt (0),
intrabarpersist mp (0),
intrabarpersist ep (0),
intrabarpersist exitbar (0)
;
mp = marketposition(0);
ep = entryprice(0);
ema_fast = xaverage( close, ema_fast_len);
ema_slow = xaverage( close, ema_slow_len);
rsi_val = rsi( close, rsi_len);
if ema_fast crosses above ema_slow then
ema_xup_bar = barnumber;
if rsi_val <= rsi_oversold then
last_rsi_oversold_dt = date;
if mp = 0 then
begin
if mp[1] <> 0 then
exitbar = barnumber;
if ema_xup_bar > exitbar
and ema_fast > ema_slow
and (datetojulian( date) - datetojulian( last_rsi_oversold_dt) <= 5) then
begin
buy 2 contracts next bar at ema_fast + minmove point stop;
end;
end;
if mp = 1 then
begin
sell 2 contracts next bar at ep - (20 * minmove point) stop;
if currentcontracts = 2 then
begin
sell 1 contract next bar at ep + (50 * minmove point) limit;
sell 1 contract next bar at ep + (100 * minmove point) limit;
end;
if currentcontracts = 1 then
begin
sell 1 contract next bar at ep + (100 * minmove point) limit;
if ema_fast < ema_slow then
sell 1 contract next bar at market;
end;
end;