You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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);
}
//+------------------------------------------------------------------+Hi Yhkbtdy,
Made the rvi mtf..
Hi Yhkbtdy, Made the rvi mtf..
That's fast!
Thanks !!
Hi Niqcom, Added the mtf.
Thank You So much
Hello MLaden & mrTools,
Could you add arrows which appear on the chartscreen? The indi is attached.
THX a lot Marco
Hi mrtools,
Envelopes mtf ???
Hallo Mladen...
Could you assist me to adds the mtf setting also alerts of this indicator? many thanks before for all your brilliant job
Hi mrtools, Envelopes mtf ???
Hi Casaliss,
Added the mtf to envelopes.
Hallo Mladen... Could you assist me to adds the mtf setting also alerts of this indicator? many thanks before for all your brilliant job
koplak
Here is this version. Some possible issues solved in this one and now you can have values for the whole history without overloading the CPU
________________
PS: did not notice the "alerts" addition. This indicator is a multi time frame but it does not have alerts yet (from the way it works it is not too clear what should the alert exactly be - we can imagine to have a weak and strong down and up level breaks, but then it should be recoded regarding colors too)
Hi Casaliss, Added the mtf to envelopes.
Is it possible to get this with arrows too?
Is it possible to get this with arrows too?
KingOfSand,
Added the arrows.