Documente Academic
Documente Profesional
Documente Cultură
Formula:
//+------------------------------------------------------------------+
//| Breakout_RSI.mq4 |
//| http://fxcodebase.com |
//+------------------------------------------------------------------+
#property indicator_buffers 4
double BRSI[];
int init()
IndicatorShortName("Breakout RSI");
IndicatorDigits(Digits);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,BRSI);
SetIndexStyle(1,DRAW_NONE);
SetIndexBuffer(1,BPower);
SetIndexStyle(2,DRAW_NONE);
SetIndexBuffer(2,n);
SetIndexStyle(3,DRAW_NONE);
SetIndexBuffer(3,p);
SetLevelValue(0, Overbought_Level);
SetLevelValue(1, Oversold_Level);
return(0);
int deinit()
return(0);
int start()
if(Bars<=3) return(0);
int ExtCountedBars=IndicatorCounted();
if (ExtCountedBars<0) return(-1);
int limit=Bars-2;
if(ExtCountedBars>2) limit=Bars-ExtCountedBars-1;
int pos;
pos=limit;
while(pos>=0)
Min=MathMin(Low[pos], Low[pos+1]);
Max=MathMax(High[pos], High[pos+1]);
BPrice=(Open[pos+1]+Max+Min+Close[pos])/4.;
BStrength=(Close[pos]-Open[pos+1])/(Max-Min);
BVolume=Volume[pos]+Volume[pos+1];
BPower[pos]=(BPrice*BStrength*BVolume)*Point;
if (BPower[pos]>BPower[pos+1])
p[pos]=MathAbs(BPower[pos]);
n[pos]=0.;
else
n[pos]=MathAbs(BPower[pos]);
p[pos]=0.;
pos--;
pos=limit;
while(pos>=0)
if (Navg!=0.)
{
BRSI[pos]=100.-100./(1.+Pavg/Navg);
else
BRSI[pos]=0.;
pos--;
return(0);
O indicador Breakout RSI é um oscillator baseado no artigo "The Breakout Relative Strength Index" por
Howard Wang na revista "Technical Analysis of Stocks & Commodities" (Setembro 2015).
AvgP - SMA(P,Period)
AvgN - SMA(N,Period)
Caso contrário
P = 0
Caso contrário
N = 0
BPrice = (PrevOpen+Max+Min+Close)/4.0
BStrength = (Close-PevOpen)/(Max-Min)
Max = Max(High,PrevHigh)
Calculation
AvgP - SMA(P,Period)
AvgN - SMA(N,Period)
else P = 0;
else N = 0;
BPrice = (PrevOpen+Max+Min+Close)/4.0;
BStrength = (Close-PevOpen)/(Max-Min);
MaxList = Max(High,PrevHigh);
Var: BPrice(0),BVol(0),BStrength(0),BPower(0),P(0),N(0),BRatio(0),BRSI(0);
BPrice=(O+H+L+C/4);
BVol=Volume+Volume[1];
{BStrength= (Close-Open)/(High-Low);}
BPower=BPrice*BStrength*BVol;
P=0;N=0;
for value0 = 0 to Length -1 begin
End;
plot1(BRSI,"BRSI");
Plot2(OB,"OB");
Plot3(OS,"OS");