Elite indicators :) - page 447

Mladen Rakic
151721
Mladen Rakic  

Advance decline line - smoothed version ...

A variation on advance decline line indicator ...


I was thinking that a decline or advance as it is defined (difference between current close and open) is OK when it comes to daily charts but for intra-day charts it is rather counterproductive. So decided to try something else. This one can use a smoothed price (averaged price) as a criteria for advances or declines (so not smoothing the result, but using average for calculation instead). That way a lot of noise is filtered out and with mild smoothing, lag is minimal. Also, if you set the smooth parameter to <= 1, it will give almost the same results (almost, since it depends on the price you are using and in case of using close price, previous bars close should match current bar open but sometimes there will be differences (it is broker dependent),) but those differences in that special case should be marginal

Here is an example of advance decline line with 10 period ema smoothed close price as criteria.

PS: one parameter needs explanation. UseExactChangedBars. If it is set to true, then the indicator is trying to find out exactly which f the symbols has most bars changed and it uses that number as a number of bars recalculated. But that means also that as much symbols you include in the symbols list that much instances of the indicator will be loaded too. It sometimes can slow down the trading platform (especially when changing time frames or initially placing it n chart. Hence, one can decide if he/she wants that check all the time or not. If it is turned of, it is advisable to change time frames form time to time. Mostly there should be no difference if it is turned off, but occasionally there will be some minor differences in that mode.

updated version posted here: https://www.mql5.com/en/forum/general

Boris
677
Boris  

Great work !

....many thanks to you again for this great work. You are a real Super Moderator ...

arnaudlx
3
arnaudlx  

great indi

Hi Mladen,

Thank you for this interesting indicator.. really really good idea..

That will be interesting to have a 'centered' version with a zero line ? Do you think it's possible ?

thanks

A.

jackjones
189
jackjones  

Hi, can any tell me why this indicator and alert is popping up about 15 messages and sending about 30 emails on a single alert?

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 Red

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

extern int Back=4;

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

double ExtMapBuffer1[];

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

int init(){

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0,167);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexEmptyValue(0,0.0);

return(0);

}

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

int start(){

int i,j,pos;

for(i=Bars-IndicatorCounted()-1;i>=0;i--){

if ((HighLow))

Alert ("Inside bar alert ",Symbol()+" "+Period()+": Buy Alert @ "+DoubleToStr(Ask,Digits));

SendMail (StringConcatenate(Symbol()," Daily inside bar"),StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," Possible daily inside bar "));

{

pos=i;

for(j=i+1;j<i+Back;j++)

if ((High[j]-Low[j])<(High-Low))

pos=j;

if (pos==i)

ExtMapBuffer1=(High+Low)/2;

}

}

return(0);

}

thanks

Mladen Rakic
151721
Mladen Rakic  

...

You have to limit the number of alerts raised. The simplest way is to do something like this (this is just the start() and one possible way how number of alarts can be limited to 1 per bar)

int start()

{

int i,j,pos;

static datetime lastTime=0;

for(i=Bars-IndicatorCounted()-1;i>=0;i--)

{

if ((HighLow) && lastTime!=Time[0])

{

lastTime = Time[0];

Alert ("Inside bar alert ",Symbol()+" "+Period()+": Buy Alert @ "+DoubleToStr(Ask,Digits));

SendMail (StringConcatenate(Symbol()," Daily inside bar"),StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," Possible daily inside bar "));

}

pos=i;

for(j=i+1;j<i+Back;j++)

if ((High[j]-Low[j])<(High-Low)) pos=j;

if (pos==i) ExtMapBuffer1=(High+Low)/2;

}

return(0);

}
jackjones:
Hi, can any tell me why this indicator and alert is popping up about 15 messages and sending about 30 emails on a single alert?

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 Red

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

extern int Back=4;

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

double ExtMapBuffer1[];

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

int init(){

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0,167);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexEmptyValue(0,0.0);

return(0);

}

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

int start(){

int i,j,pos;

for(i=Bars-IndicatorCounted()-1;i>=0;i--){

if ((HighLow))

Alert ("Inside bar alert ",Symbol()+" "+Period()+": Buy Alert @ "+DoubleToStr(Ask,Digits));

SendMail (StringConcatenate(Symbol()," Daily inside bar"),StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," Possible daily inside bar "));

{

pos=i;

for(j=i+1;j<i+Back;j++)

if ((High[j]-Low[j])<(High-Low))

pos=j;

if (pos==i)

ExtMapBuffer1=(High+Low)/2;

}

}

return(0);

}

thanks
wojek
159
wojek  

'divergence' project

Mladen, some time ago you wrote that you worked on a special divergence indicator/project (?). Will it be based on particular indicator(s) - such as CCI, MACD and/or other oscillators, or rather something more general?

Mladen Rakic
151721
Mladen Rakic  

...

Actually it is not based on any indicator (and that is the goal that I am trying to achieve)

It should be able to compare any value against price and (with some tolerance) it should be able to compare peaks. And the last part (the "peaks") is what is killing me : the problem is that peaks can not be determined without repainting - recalculating which makes any divergence good in hindsight and not so useful in real time. That is the problem I would like to try to solve ... after that all one would need to do is to specify a current value of anything (value from any other indicator) that should be compared to prices and a function should be able to find divergences

You might have noticed that in the mean time I even tried a slope divergence (which is close to a run-time divergence but it should have some criteria to compare different slope lengths against each other) All in all, it reminds of a head breaking problem in the end : when one thinks of it it seems simple, but when trying to code it it becomes just more and more complicated and I hate that

wojtek.paul:
Mladen, some time ago you wrote that you worked on a special divergence indicator/project (?). Will it be based on particular indicator(s) - such as CCI, MACD and/or other oscillators, or rather something more general?
wojek
159
wojek  

yes, it sounds very interesting and the problem you described is by no means trivial, but I'm sure you will find a solution; thank you for the detailed explanation

maybe, something like a zigzag (e.g., that one which is used within the Semafor indicator, so it draws its last line without a delay) could help - it determines some local high (or low, respectively), and when the price decreases (increases) by certain amount (of pips)*, it would be the first high (or low) to determine a possible divergence; next, when - and if - the zigzag will change its position to another, subsequent higher high (or lower low), and then the price will decrease (increase) by certain amount*, it would be the second, and final high (or low) to determine the divergence... (??) it's a general idea, I don't know whether it makes sense and can be programmed successfully.

* or the next candle is closed (but not 'much lower' than the last zigzag position), or an indicator - maybe on a faster (smaller) TF - gives a signal, etc.

William Snyder
9496
William Snyder  

This is VQ - zero line histo with mtf, divergence, and alerts.

updated version posted here: https://www.mql5.com/en/forum/general

Hercs
2970
Hercs  

MTF version of "RSI TM smoothed nrp"

Hi Mladen, do we have an MTF version of the Tim Morris Smoothed nrp RSi by any chance? I cannot find it on the Thread, but maybe you have a copy still?

Would appreciate having a copy.

Thanks in advance.