Hi All,
I'm new in coding and trying to modify an EA. Basically I'm trying to add SuperTrend indicator into an EA.
I've added the indicator like this
and created a condition like this
So i want it to sell if price closes below SuperTrend line.
Doesn't give any compiling errors but doesn't work properly either, any feedback would be highly appreciated.
cheers
mem
I'm new in coding and trying to modify an EA. Basically I'm trying to add SuperTrend indicator into an EA.
I've added the indicator like this
Inserted Code
//---- input parameters extern bool use_xsupertrend=true; extern int SuperTrend.Period=10; extern int SuperTrend.Multiplier=2.618; extern int xsupertrend_shift=0;
Inserted Code
double xsupertrend=iCustom(Symbol(),0,"xSuperTrend",SuperTrend.Period,SuperTrend.Multiplier,PRICE_CLOSE,xsupertrend_shift);
and created a condition like this
Inserted Code
if(!use_bb && !use_xsupertrend) { if(High[bb_shift]>upBB && PRICE_CLOSE<xsupertrend) return(sell); if(Low[bb_shift]<loBB && PRICE_CLOSE>xsupertrend) return(buy); }
So i want it to sell if price closes below SuperTrend line.
Doesn't give any compiling errors but doesn't work properly either, any feedback would be highly appreciated.
cheers
mem
Attached File(s)
xSuperTrend.mq4
4 KB
|
448 downloads