Multi Timeframe Indicators - page 559

 
wccmcd:
Dear mladen,

the bug of MTF_MegaTrend_Bar_4TFNextM6.mq4 is a "mirror line" at the bottom of four "normal" bars, as you can see in the pic. I saw you fixed this bug for verson "NextM9.mq4", so I wonder if you can fix it for this "NextM6" version, too.

Also I would like an autodisplay switch, to keep the bar's period fixed when I change main chart's period. This will be very helpful for me to accomplish my trade.

Thank you very, very much for your reply.

Dear MLaden,

Could you make this indi into 1 TF visible (1 bar) and not 4?

THX a lot for your help Marco

 
Marco320:
Dear MLaden,

Could you make this indi into 1 TF visible (1 bar) and not 4?

THX a lot for your help Marco

Marko,

Simply use only one time frame in all 4 time frame parameters

 

Dear MLaden,

Thx but you only can switch off the colors for the specific bar but it's ok

Best Regards Marco

 
Marco320:
Dear MLaden,

Thx but you only can switch off the colors for the specific bar but it's ok

Best Regards Marco

Marco

If you set all the time frames to same time frame, you will have all same values at the 4 rows and it will look as if it is only one row (having all the values exactly the same)

 

By the way Mladen, this bug happens on MT4 build 509.

wccmcd:
Dear mladen,

the bug of MTF_MegaTrend_Bar_4TFNextM6.mq4 is a "mirror line" at the bottom of four "normal" bars, as you can see in the pic. I saw you fixed this bug for verson "NextM9.mq4", so I wonder if you can fix it for this "NextM6" version, too.

Also I would like an autodisplay switch, to keep the bar's period fixed when I change main chart's period. This will be very helpful for me to accomplish my trade.

Thank you very, very much for your reply.

 
wccmcd:
By the way Mladen, this bug happens on MT4 build 509.

wccmcd

I know

It is a case when a SetIndexEmptyValue() is set to one value and then in a code not that value is used to clean buffer value but some other (usually it goes that empty value is set to 0 using SetIndexEmptyValue() and then in the code EMPTY_VALUE is used to clean the buffer, or vice versa)

It can not be done so and even though it is a bug of metatrader it is a coding error too and is completely avoidable

 
wccmcd:
By the way Mladen, this bug happens on MT4 build 509.

Wccmcd, just to add the MegaTrend is a Hull Moving average there is a 4 tf version posted here https://www.mql5.com/en/forum/181187/page6 it is colored based on the slope of Hull also.

 

Wow, that's a quick reply, thank you Mladen. But too bad it's out of my knowledge... so the simple conclusion is? :D:D

mladen:
wccmcd

I know

It is a case when a SetIndexEmptyValue() is set to one value and then in a code not that value is used to clean buffer value but some other (usually it goes that empty value is set to 0 using SetIndexEmptyValue() and then in the code EMPTY_VALUE is used to clean the buffer, or vice versa)

It can not be done so and even though it is a bug of metatrader it is a coding error too and is completely avoidable
 

I'll definately go and check it out. Thanks!

mrtools:
Wccmcd, just to add the MegaTrend is a Hull Moving average there is a 4 tf version posted here https://www.mql5.com/en/forum/181187/page6 it is colored based on the slope of Hull also.
 

Hi all my friends

I would like to set the following mq4 to MTF.

I want you to rewrite it.

RVI mq4

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

//| Relativ Vigor Index.mq4 |

//| Copyright ゥ 2005, MetaQuotes Software Corp. |

//| MetaTrader 5 Trading Platform / MetaQuotes Software Corp. |

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

#property copyright "Copyright ゥ 2005, MetaQuotes Software Corp."

#property link "http://www.metaquotes.net/"

//---- indicator settings

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Green

#property indicator_color2 Red

//---- indicator parameters

extern int ExtRVIPeriod=10;

//---- indicator buffers

double ExtRVIBuffer[];

double ExtRVISignalBuffer[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicator buffers mapping

SetIndexBuffer(0,ExtRVIBuffer);

SetIndexBuffer(1,ExtRVISignalBuffer);

//---- indicator line

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

//---- drawing settings

SetIndexDrawBegin(0,ExtRVIPeriod+3);

SetIndexDrawBegin(1,ExtRVIPeriod+7);

//---- name for DataWindow and indicator subwindow label

IndicatorShortName("RVI("+ExtRVIPeriod+")");

SetIndexLabel(0,"RVI");

SetIndexLabel(1,"RVIS");

//---- initialization done

return(0);

}

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

//| Relativ Vigor Index |

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

int start()

{

int i,j,nLimit,nCountedBars;

double dValueUp,dValueDown,dNum,dDeNum;

//----

if(Bars<=ExtRVIPeriod+8) return(0);

//----

nCountedBars=IndicatorCounted();

//---- check for possible errors

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

//---- last counted bar will be recounted

nLimit=Bars-ExtRVIPeriod-4;

if(nCountedBars>ExtRVIPeriod+4)

nLimit=Bars-nCountedBars;

//---- RVI counted in the 1-st buffer

for(i=0; i<=nLimit; i++)

{

dNum=0.0;

dDeNum=0.0;

for(j=i; j<i+ExtRVIPeriod; j++)

{

dValueUp=((Close[j]-Open[j])+2*(Close[j+1]-Open[j+1])+2*(Close[j+2]-Open[j+2])+(Close[j+3]-Open[j+3]))/6;

dValueDown=((High[j]-Low[j])+2*(High[j+1]-Low[j+1])+2*(High[j+2]-Low[j+2])+(High[j+3]-Low[j+3]))/6;

dNum+=dValueUp;

dDeNum+=dValueDown;

}

if(dDeNum!=0.0)

ExtRVIBuffer=dNum/dDeNum;

else

ExtRVIBuffer=dNum;

}

//---- signal line counted in the 2-nd buffer

nLimit=Bars-ExtRVIPeriod-7;

if(nCountedBars>ExtRVIPeriod+8)

nLimit=Bars-nCountedBars+1;

for(i=0; i<=nLimit; i++)

ExtRVISignalBuffer=(ExtRVIBuffer+2*ExtRVIBuffer+2*ExtRVIBuffer+ExtRVIBuffer)/6;

//----

return(0);

}

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

Reason: