Friday, July 6, 2018


Step 1.
create bollingerbandsignal file in expert folder and

Step 2. copy paste code given below on your bollingerbandsignal file :
//code start

void OnTick()
//create an empty string for the single
string signal="";
//symbol, period,20 candles, deviation 2, no shift, close price, candle
double LowerBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_LOWER,1); 
double UpperBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_UPPER,1);
// calculate the candle before
double PrevLowerBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_LOWER,2);
double PrevUpperBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_UPPER,2);
// if price is above the last close
if (Ask>Close[1])
//if close2 was below lower band
if (Close[2]<PrevLowerBB)
//if close1 was above lower band
if (Close[1]>LowerBB)
// if price is bellow the last close
if (Bid<Close[1])
// if close2 was above upper band
if (Close[2]>PrevUpperBB)
// if close is below upper band
if (Close[1]<UpperBB)
//Output the signal on the chart
Comment("Current Signaal is :",signal);

//code end

Step 3.
Now open MT4 and go to :
Insert >> Indicator >> Trand >> Bollinger Bands 
Set parameter : Period : 20 , shift : 0 , Deviation 2 , Apply to : close , style : Yellow then OK

Step 4.
Now open MT4 and go to :
Charts >> Template >> save template >> save file as tester.tpl.

Now open MT4 and go to :
View >> strategy test : 
set your symbol
Use date
Visual Mode

3 to 5 signal View on left side on top on your a day

No comments:

Post a Comment