Convert tradestation indi "smoothed repulse"

 

Hi , can someone convert these prorealtime indis to mt4?

smoothed repulse :

//Repulse 1

vars:

ZeroLine(0),

Repulse(0),

ForceHaussiere(0),

ForceBaissiere(0);

ForceHaussiere=XAverage(((3*C)-(2*L)-O)/C*100,5);

ForceBaissiere=XAverage((O+(2*H)-(3*C))/C*100,5);

Repulse=ForceHaussiere-ForceBaissiere;

Plot1(Repulse,"Repulse");

Plot2(ZeroLine,"Zero Line");[/CODE]

and

[CODE]//Repulse 2

input:

Length(5);

vars:

Repulse(0),

ForceHaussiere(0),

ForceBaissiere(0);

ForceHaussiere=XAverage(((3*C)-(2*lowest(L,Length))-O[Length])/C*100,5*Length);

ForceBaissiere=XAverage((O[Length]+(2*highest(H,Length))-(3*C))/C*100,5*Length);

Repulse=ForceHaussiere-ForceBaissiere;

Plot1(Repulse,"Repulse(x)");

Thanks

 

MAs

Just for the moving averages?

 

lR

Try the Linear regression factor. In Spain uses good.

 

...

Most repulsive indicator I have ever seen

 

Repulse 1 and Repulse 2

What are the two pieces of code for?

uvmember:
Hi , can someone convert these prorealtime indis to mt4?

smoothed repulse :

//Repulse 1

vars:

ZeroLine(0),

Repulse(0),

ForceHaussiere(0),

ForceBaissiere(0);

ForceHaussiere=XAverage(((3*C)-(2*L)-O)/C*100,5);

ForceBaissiere=XAverage((O+(2*H)-(3*C))/C*100,5);

Repulse=ForceHaussiere-ForceBaissiere;

Plot1(Repulse,"Repulse");

Plot2(ZeroLine,"Zero Line");[/CODE]

and

[CODE]//Repulse 2

input:

Length(5);

vars:

Repulse(0),

ForceHaussiere(0),

ForceBaissiere(0);

ForceHaussiere=XAverage(((3*C)-(2*lowest(L,Length))-O[Length])/C*100,5*Length);

ForceBaissiere=XAverage((O[Length]+(2*highest(H,Length))-(3*C))/C*100,5*Length);

Repulse=ForceHaussiere-ForceBaissiere;

Plot1(Repulse,"Repulse(x)");

Thanks

 
Here you go
regards

mladen

uvmember:
Hi , can someone convert these prorealtime indis to mt4?

smoothed repulse :

//Repulse 1

vars:

ZeroLine(0),

Repulse(0),

ForceHaussiere(0),

ForceBaissiere(0);

ForceHaussiere=XAverage(((3*C)-(2*L)-O)/C*100,5);

ForceBaissiere=XAverage((O+(2*H)-(3*C))/C*100,5);

Repulse=ForceHaussiere-ForceBaissiere;

Plot1(Repulse,"Repulse");

Plot2(ZeroLine,"Zero Line");[/code]and

[code]//Repulse 2

input:

Length(5);

vars:

Repulse(0),

ForceHaussiere(0),

ForceBaissiere(0);

ForceHaussiere=XAverage(((3*C)-(2*lowest(L,Length))-O[Length])/C*100,5*Length);

ForceBaissiere=XAverage((O[Length]+(2*highest(H,Length))-(3*C))/C*100,5*Length);

Repulse=ForceHaussiere-ForceBaissiere;

Plot1(Repulse,"Repulse(x)");

Thanks

Files:
repulse.gif  27 kb
repulse_1.mq4  2 kb
repulse_2.mq4  3 kb
 

Many thanks for the indis!

 

this look like a macd

 

...

josemarcoss

You are right, it is a kind of a MACD

Difference of two EMAs (XAverage is EMA) is by definition a MACD. The difference is in the price and in the way it is calculated. While MACD is difference of two different length EMAs, this one is a difference of two same length EMAs of different "prices"

 

Use repulse2 in EA

Hey guys, I'm new to coding mql so please be gentle with me!

I've used the repulse2 indicator mentioned in this thread and would like to use it in an EA to reference the Smoothed Repulse value. I've got the following code built into my EA and it seems to be giving me incorrect values from alerts I've got set. I've omitted any code not needed for this to make it easier to follow.

Can anyone help me out and point me in the right direction please?

//---- define variables

double Repulse; //Repulse value

double RepBar1; //Repulse of latest bar

double RepBar2; //Repulse of previous bar

//-----------------------------------------------------------------------------------4

//+------------------------------------------------------------------+

//| expert start function (begin main trading program) |

//+------------------------------------------------------------------+

int start()

{

//-----------------------------------------------------------------------------------5

//-----------------------------------------------------------------------------------8

//---- Trading Criteria to define reasons for opening and closing trades (only called if new bar test is passed!)

RepBar2=FuncFindRepulse(2);

Alert("Smoothed Repulse -2 is ",RepBar2);

RepBar1=FuncFindRepulse(1);

Alert("Smoothed Repulse -1 is ",RepBar1);

//-----------------------------------------------------------------------------------12

//---- exiting main start function program

return(0);

}

//---- end of main start function program

//-----------------------------------------------------------------------------------13

//calculate smoothed repulse of given bar

double FuncFindRepulse (int RepulseBar) //define function to calculate smoothed repulse

{

double alpha = 2.0/(1.0+5.0*RepulseLength); //set alpha from RepulseLength

Alert("alpha is ",alpha);

int r=RepulseBar; //set r as Repulse Bar

double curpricea = 100*(3.0*Close[r]-2.0*Low-Open[r+RepulseLength])/Close[r]; //calculate first value of Repulse calcs

Alert("curpricea is ",curpricea);

double curpriceb = 100*(Open[r+RepulseLength]+2.0*High-3.0*Close[r])/Close[r]; //calculate second value

Alert("curpriceb is ",curpriceb);

double prevpricea = 100*(3.0*Close[r+1]-2.0*Low-Open[r+1+RepulseLength])/Close[r+1]; //calculate first value of Repulse calcs

Alert("prevpricea is ",prevpricea);

double prevpriceb = 100*(Open[r+1+RepulseLength]+2.0*High-3.0*Close[r+1])/Close[r+1]; //calculate second value

Alert("prevpriceb is ",prevpriceb);

double pricea = prevpricea+alpha*(curpricea-prevpricea); //set pricea to recalculated value

double priceb = prevpriceb+alpha*(curpriceb-prevpriceb); //set priceb to recalculated value

Repulse = pricea-priceb; //calculate Smoothed Reulse value and set Repulse

return(Repulse); //send Repulse value back to main program

}

 

repulse alerts

is there any way to add alerts to the repulse 2 indicator ??

Reason: