RSI indicator - page 94

Tam
197
Tam  
mladen:
the 0 to 1 histogram or a histogram with original values?



With rsx values with histogram color changes on slope changes

Mladen Rakic
183057
Mladen Rakic  
TamFX:


With rsx values with histogram color changes on slope changes

That would mean that the signal line crossing coloring would have to be ignored. Is that what you had in mind?

Tam
197
Tam  
mladen:
That would mean that the signal line crossing coloring would have to be ignored. Is that what you had in mind?

Forgot about that part. Disregard the request then. Thanks

ac_boerse
14
ac_boerse  

Hello mladen,

please can you post the "reveng emasri" as MTF.

I try a the moment to code mql4 a read a lot about it, but i dont can make it to works.

I tried it with:

Buffer1=iCustom(NULL,5,"RevEng EmaRsi",45,14,PRICE_CLOSE,1,0,i);

Thanks for your help.

Mladen Rakic
183057
Mladen Rakic  
ac_boerse:
Hello mladen,

please can you post the "reveng emasri" as MTF.

I try a the moment to code mql4 a read a lot about it, but i dont can make it to works.

I tried it with:

Buffer1=iCustom(NULL,5,"RevEng EmaRsi",45,14,PRICE_CLOSE,1,0,i);

Thanks for your help.

ac_boerse

If you are trying to use buffer from an EA it will not work

Try something like this :

double currntValue =iCustom(NULL,5,"RevEng EmaRsi",45,14,PRICE_CLOSE,1,0,0);

but if I were you I would avoid the shit parameter (the "1" in that call) and use index for that instead (the last parameter) and then it will work with no problem

ac_boerse
14
ac_boerse  

thanks for your answer, but i want an indicator as MTF. As I read, you need to have an buffer.

it tried it with

double currntValue =iCustom(NULL,5,"RevEng EmaRsi",0,i);

Buffer1=currntValue;

but thats not work.

Is it possible that you write the RevEng Ema as an MTF indicator

Mladen Rakic
183057
Mladen Rakic  
ac_boerse:
thanks for your answer, but i want an indicator as MTF. As I read, you need to have an buffer.

it tried it with

double currntValue =iCustom(NULL,5,"RevEng EmaRsi",0,i);

Buffer1=currntValue;

but thats not work.

Is it possible that you write the RevEng Ema as an MTF indicator

Those two lines you posted should already get 5 minute values

But they do not show anything where the error could be. Post the full source code or else I doubt that anybody can help you (it is like trying to see the world through a 1/2 millimeter hole)

ac_boerse
14
ac_boerse  

here is the complete code:

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 Blue

#property indicator_width1 2

double Buffer1[];

double currntValue;

// Initialisierung zum Indikatorstart

int init()

{

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,Buffer1);

return(0);

}

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

// Deinitialisierung zum Indikatorende

int deinit()

{

return(0);

}

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

// Hauptroutine

int start()

{

int counted = IndicatorCounted();

if (counted < 0) return (-1);

if (counted > 0) counted--;

int limit = Bars-counted;

for (int i=0; i < limit; i++)

{

currntValue =iCustom(NULL,5,"RevEng EmaRsi",0,i);

Buffer1=currntValue;

}

return(0);

}

krelian99
1202
krelian99  
ac_boerse:
here is the complete code: ...

What he means is that you must upload the source file RevEng EmaRsi.mq4

iCustom(NULL,5,"RevEng EmaRsi",0,i); is just a function call, but he needs the code of the function that is contained in the mq4

ac_boerse
14
ac_boerse  

here is the code for the RevEng EmaRSi

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

//| Swing line.mq4 |

//| |

//| Avgust 2003 issue |

//| Technical Analysis of Stocks and Commodities |

//| Giorgos Siligardos' article "Reverse Engineering RSI (II)” |

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

#property copyright "mladen"

#property link "mladenfx@gmail.com"

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 DarkViolet

#property indicator_width1 2

//

//

//

//

//

extern int EmaPeriod = 45;

extern int WildPeriod = 14;

extern int Price = PRICE_CLOSE;

extern int Shift = 1;

double ema[];

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

SetIndexBuffer(0,ema); SetIndexShift(0,Shift);

return(0);

}

int deinit()

{

return(0);

}

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int start()

{

int counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

//

//

//

//

//

for(int i=limit; i>=0; i--)

{

double price = iMA(NULL,0,1,0,MODE_SMA,Price,i);

double price1 = iMA(NULL,0,1,0,MODE_SMA,Price,i+1);

double emaRsi = iEma(iRSI(NULL,0,WildPeriod,Price,i),EmaPeriod-1,i,0);

double value1 = 0; if (price>price1) value1 = price-price1;

double value2 = 0; if (price1>price) value2 = price1-price;

double aup = iEma(value1,WildPeriod,i,1);

double adp = iEma(value2,WildPeriod,i,2);

//

//

//

//

//

if ((100.0-emaRsi)!=0)

double x = (WildPeriod-1.0)*(adp*emaRsi/(100.0-emaRsi)-aup);

else x = 0;

if (x>=0)

ema = price+x;

else

if (emaRsi!=0)

ema = price+x*(100-emaRsi)/emaRsi;

else ema = price;

}

return(0);

}

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

double workEma[][3];

double iEma(double price, double period, int r, int instanceNo=0)

{

if (ArrayRange(workEma,0)!= Bars) ArrayResize(workEma,Bars); r = Bars-r-1;

//

//

//

//

//

double alpha = 2.0 / (1.0+period);

workEma[r] = workEma[r-1]+alpha*(price-workEma[r-1]);

return(workEma[r]);

}