Sunday, July 8, 2018

Parabolic SAR Signal

Step 1.
create ParabolicSARsignal file in expert folder and

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

void OnTick()
{
// String variable for the signal
string signal="";
//We calculate the Parabolic SAR Indicator
double MySARValue = iSAR(_Symbol,_Period ,0.02,0.2,0);
// if the Parabolic SAR Value is below the Bid Price
if (MySARValue<Bid)
{//create a buy signal
signal="buy";
}
// if the Parabolic SAR Value is above the Ask Price
if (MySARValue>Ask)
{//create a sell signal
signal="sell";
}
//Output the signal on the chart
Comment("MySARValue : ",MySARValue,"\n","Current Signaal is :",signal);
}

//+------------------------------------------------------------------+
//code end
Step 3.
Now open MT4 and go to :
Insert >> Indicator >> ParabolicSARsignal
Set parameter : Step : 0.02, Maximum : 0.2 , style : Yellow then OK

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

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

Step6.
View signal on left side on top in your chart.

No comments:

Post a Comment