I am attempting to code an ea using a Pin Bar indicator using Steve's shell ea. The code is shown below. I would be very grateful if one of our expert coders could have a look and see if it is correct.
Thanks in advance.
peter
Code: Select all
static datetime OldPBBarTime;
if(OldPBBarTime!=iTime(Symbol(),TradingTimeFrame,0))
{
OldPBBarTime=iTime(Symbol(),TradingTimeFrame,0);
PBStatus = PBnosignal;
//Buffer 0 holds a buy pin bar - green up
val = iCustom(Symbol(), TradingTimeFrame, "PinBar", 0, 1);
if (!CloseEnough(val, EMPTY_VALUE) )
{
PBStatus = PBbuysignal;
}//if (!CloseEnough(val 0) )
else
{
//Buffer 1 hods a sell pin bar - red down
val = iCustom(Symbol(), TradingTimeFrame, "PinBar", 1, 1);
if (!CloseEnough(val, EMPTY_VALUE) )
{
PBStatus = PBsellsignal;
}//if (!CloseEnough(val 0) )
}
}//if(OldPBBarTime!=iTime(Symbol(),TradingTimeFrame,0))