I am attempting to code a Tdesk helper ea trading Leon's trading strategy using RSI-X, GANN HILO, MTF HGI using iCustom. The ea will enter a trade when all the indicators line up and exit when H4 RSI-X changes colour on a closed candle. This would give more options to exit when one or two indicators changes colour rather than when all the indicators show opposite signals. This ea could also take advantage of using HGCB 's LIBSSRv5's functionality viz. not buying into a resistance zone or selling into a support zone.
I am using the shell from Steve's ea HGCB after removing the code for candle power. The iCustom codes are shown below
Code: Select all
//MOD HTF RSI-X
datetime OldRsixBarTime=0;
if (UseHtfRsix)
{
//READ HTF RSIX INDI EVERY 5 MINUTES
if (OldRsixBarTime != iTime(Symbol(), PERIOD_M5, 0) )
{
OldRsixBarTime = iTime(Symbol(), PERIOD_M5, 0);
val = RsixVal;
HtfRsixStatus = RsiNoCross;
//Buffer 0 holds cross up
val = iCustom(Symbol(),HtfRsixTimeFrame,"RSI Cross TD V2",0,0);
if (!CloseEnough(val, EMPTY_VALUE) )
{
HtfRsixStatus = RsiCrossUp;
}//if (!CloseEnough(val 0) )
else
{
//Buffer 1 holds cross down
val = iCustom(Symbol(),HtfRsixTimeFrame,"RSI CRoss TD V2",1,0);
if (!CloseEnough(val, EMPTY_VALUE) )
{
HtfRsixStatus = RsiCrossDown;
}//if (!CloseEnough(val 0) )
}
}//if (OldStoIndiReadBarTime[PairIndex] != iTime(symbol, PERIOD_M1, 0) )
}//if (UseHtfRsix)
//////////////////////////////////////////////////////////////////////////////////
//MOD MTF RSI-X
if (UseMtfRsix)
{
//READ MTF RSIX INDI EVERY 5 MINUTES
if (OldRsixBarTime != iTime(Symbol(), PERIOD_M5, 0) )
{
OldRsixBarTime = iTime(Symbol(), PERIOD_M5, 0);
val = RsixVal;
val1 = RsixVal1;
MtfRsixStatus = RsiNoCross;
//Buffer 0 holds cross up
val = iCustom(Symbol(),MtfRsixTimeFrame,"RSI Cross TD V2",0,0);
if (!CloseEnough(val, EMPTY_VALUE) )
{
MtfRsixStatus = RsiCrossUp;
}//if (!CloseEnough(val 0) )
else
{
//Buffer 1 holds cross down
val = iCustom(Symbol(),MtfRsixTimeFrame,"RSI CRoss TD V2",1,0);
if (!CloseEnough(val, EMPTY_VALUE) )
{
MtfRsixStatus = RsiCrossDown;
}//if (!CloseEnough(val 0) )
}
MtfRsix1Status = RsiNoCross;
//Buffer 0 holds cross up
val1 = iCustom(Symbol(),MtfRsixTimeFrame,"RSI Cross TD V2",0,1);
if (!CloseEnough(val1, EMPTY_VALUE) )
{
MtfRsix1Status = RsiCrossUp;
}//if (!CloseEnough(val 0) )
else
{
//Buffer 1 holds cross down
val1 = iCustom(Symbol(),MtfRsixTimeFrame,"RSI CRoss TD V2",1,1);
if (!CloseEnough(val1, EMPTY_VALUE) )
{
MtfRsix1Status = RsiCrossDown;
}//if (!CloseEnough(val 0) )
}
}//if (OldRsixIndiReadBarTime[PairIndex] != iTime(symbol, PERIOD_M5, 0) )
}//if (UseMtfRsix)
/////////////////////////////////////////////////////////////////////////////
//mod GANN HILO
datetime OldGannBarTime=0;
if (UseGannHilo)
{
//reads rsi indi every minute
if (OldGannBarTime != iTime(Symbol(), GannTf, 0) )
{
OldGannBarTime = iTime(Symbol(), GannTf, 0);
val = GannVal;
GannStatus = GannNoCross;
//Buffer 0 hold long signal
val = iCustom(Symbol(),GannTf,"GannHiLo TD V2",0,0);
if (!CloseEnough(val, EMPTY_VALUE) )
{
GannStatus = GannCrossUp;
}//if (!CloseEnough(val 0) )
else
{
//Buffer 1 holds short signal
val = iCustom(Symbol(),GannTf,"GannHiLo TD V2",1,0);
if (!CloseEnough(val, EMPTY_VALUE) )
{
GannStatus = GannCrossDown;
}//if (!CloseEnough(val 0) )
}
}//if (OldRsiIndiReadBarTime[PairIndex] != iTime(symbol, PERIOD_M1, 0) )
}// So far, the ea has failed to send any trades even though the ea compiled without any errors. Perhaps one of our coders could cast an eye on the codes and give your comments where the problem lies.
Thanks in advance.
peter
p.s. I forgot to include the Hgi code as a buy/sell condition in the ea earlier.