идея хорошая
удачи вам
Совсем недавно разбирал подобный индикатор https://www.mql5.com/ru/forum/126925. Этот точно так же можно переделать. Работать быстрее будет. Для советника это довольно актуально.
Совсем недавно разбирал подобный индикатор https://www.mql5.com/ru/forum/126925. Этот точно так же можно переделать. Работать быстрее будет. Для советника это довольно актуально.
Спасибо, Виктор
там ненормирован РСИ и часто просто выглядит в виде вертикальных полос...
надо ввести строчку extern int koeff = 100; и далее, при вычислении девиации:
Deviation = iATR(NULL, 0, nPeriod, i) *koeff; коэффициент подбирать экспериментально...
там ненормирован РСИ и часто просто выглядит в виде вертикальных полос...
надо ввести строчку extern int koeff = 100; и далее, при вычислении девиации:
Deviation = iATR(NULL, 0, nPeriod, i) *koeff; коэффициент подбирать экспериментально...
Хорошая идея, спасибо
Идея Rossi:
/*------------------------------------------------------------------+
| Rsi_Bands_B2.mq4 |
| Copyright © 2010 |
| basisforex@gmail.com |
+------------------------------------------------------------------*/
#property copyright "Copyright © 2010, basisforex@gmail.com"
#property link "basisforex@gmail.com"
//-----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Yellow
//-----
extern int nPeriod = 13;
extern int RossiKoeff = 300;// find value by testing
extern int MaShift = 0;
//-----
double Deviation, r;
double MaBuffer[];
double RSIBuffer[];
//+------------------------------------------------------------------+
int init()
{
SetIndexShift(0, MaShift);
SetIndexShift(1, MaShift);
//-----
SetIndexBuffer(0, MaBuffer);
SetIndexBuffer(1, RSIBuffer);
//-----
SetIndexStyle(0, DRAW_LINE, STYLE_DOT);
SetIndexStyle(1, DRAW_LINE);
//-----
SetIndexLabel(0, "MA");
SetIndexLabel(1, "RSI");
//-----
return(0);
}
//+------------------------------------------------------------------+
int start()
{
int limit;
double a;
int counted_bars = IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars--;
limit = Bars - counted_bars;
for(int i = 0; i < limit; i++)
{
a = 0;
for(int j = 0; j < nPeriod; j++)
{
a = a + (iHigh(NULL, 0, i + j) + iLow(NULL, 0, i + j) + iClose(NULL, 0, i + j) * 2) / 4;
}
MaBuffer[i] = a / nPeriod;
//-----
r = iRSI(NULL, 0, nPeriod, PRICE_WEIGHTED, i);
Deviation = iATR(NULL, 0, nPeriod, i) * RossiKoeff;
//-----
if(iHigh(NULL, 0, i) > MaBuffer[i] && iClose(NULL, 0, i) > MaBuffer[i])
{
RSIBuffer[i] = MaBuffer[i] + r * Point * Deviation;
}
else if(iLow(NULL, 0, i) < MaBuffer[i] && iClose(NULL, 0, i) < MaBuffer[i])
{
RSIBuffer[i] = MaBuffer[i] - (100 - r) * Point * Deviation;
}
else
{
RSIBuffer[i] = MaBuffer[i];
}
}
//-----
return(0);
}
//+------------------------------------------------------------------+
Идея Rossi:
/*------------------------------------------------------------------+
| Rsi_Bands_B2.mq4 |
| Copyright © 2010 |
| basisforex@gmail.com |
+------------------------------------------------------------------*/
#property copyright "Copyright © 2010, basisforex@gmail.com"
#property link "basisforex@gmail.com"
//-----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Yellow
//-----
extern int nPeriod = 13;
extern int RossiKoeff = 300;// find value by testing
extern int MaShift = 0;
//-----
double Deviation, r;
double MaBuffer[];
double RSIBuffer[];
//+------------------------------------------------------------------+
int init()
{
SetIndexShift(0, MaShift);
SetIndexShift(1, MaShift);
//-----
SetIndexBuffer(0, MaBuffer);
SetIndexBuffer(1, RSIBuffer);
//-----
SetIndexStyle(0, DRAW_LINE, STYLE_DOT);
SetIndexStyle(1, DRAW_LINE);
//-----
SetIndexLabel(0, "MA");
SetIndexLabel(1, "RSI");
//-----
return(0);
}
//+------------------------------------------------------------------+
int start()
{
int limit;
double a;
int counted_bars = IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars--;
limit = Bars - counted_bars;
for(int i = 0; i < limit; i++)
{
a = 0;
for(int j = 0; j < nPeriod; j++)
{
a = a + (iHigh(NULL, 0, i + j) + iLow(NULL, 0, i + j) + iClose(NULL, 0, i + j) * 2) / 4;
}
MaBuffer[i] = a / nPeriod;
//-----
r = iRSI(NULL, 0, nPeriod, PRICE_WEIGHTED, i);
Deviation = iATR(NULL, 0, nPeriod, i) * RossiKoeff;
//-----
if(iHigh(NULL, 0, i) > MaBuffer[i] && iClose(NULL, 0, i) > MaBuffer[i])
{
RSIBuffer[i] = MaBuffer[i] + r * Point * Deviation;
}
else if(iLow(NULL, 0, i) < MaBuffer[i] && iClose(NULL, 0, i) < MaBuffer[i])
{
RSIBuffer[i] = MaBuffer[i] - (100 - r) * Point * Deviation;
}
else
{
RSIBuffer[i] = MaBuffer[i];
}
}
//-----
return(0);
}
//+------------------------------------------------------------------+
Но индикатор как не работал так и не работает - снова вертикальные линии! Исправьте!
Идея Rossi:
/*------------------------------------------------------------------+
| Rsi_Bands_B2.mq4 |
| Copyright © 2010 |
| basisforex@gmail.com |
+------------------------------------------------------------------*/
#property copyright "Copyright © 2010, basisforex@gmail.com"
#property link "basisforex@gmail.com"
//-----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Yellow
//-----
extern int nPeriod = 13;
extern int RossiKoeff = 300;// find value by testing
extern int MaShift = 0;
//-----
double Deviation, r;
double MaBuffer[];
double RSIBuffer[];
//+------------------------------------------------------------------+
int init()
{
SetIndexShift(0, MaShift);
SetIndexShift(1, MaShift);
//-----
SetIndexBuffer(0, MaBuffer);
SetIndexBuffer(1, RSIBuffer);
//-----
SetIndexStyle(0, DRAW_LINE, STYLE_DOT);
SetIndexStyle(1, DRAW_LINE);
//-----
SetIndexLabel(0, "MA");
SetIndexLabel(1, "RSI");
//-----
return(0);
}
//+------------------------------------------------------------------+
int start()
{
int limit;
double a;
int counted_bars = IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars--;
limit = Bars - counted_bars;
for(int i = 0; i < limit; i++)
{
a = 0;
for(int j = 0; j < nPeriod; j++)
{
a = a + (iHigh(NULL, 0, i + j) + iLow(NULL, 0, i + j) + iClose(NULL, 0, i + j) * 2) / 4;
}
MaBuffer[i] = a / nPeriod;
//-----
r = iRSI(NULL, 0, nPeriod, PRICE_WEIGHTED, i);
Deviation = iATR(NULL, 0, nPeriod, i) * RossiKoeff;
//-----
if(iHigh(NULL, 0, i) > MaBuffer[i] && iClose(NULL, 0, i) > MaBuffer[i])
{
RSIBuffer[i] = MaBuffer[i] + r * Point * Deviation;
}
else if(iLow(NULL, 0, i) < MaBuffer[i] && iClose(NULL, 0, i) < MaBuffer[i])
{
RSIBuffer[i] = MaBuffer[i] - (100 - r) * Point * Deviation;
}
else
{
RSIBuffer[i] = MaBuffer[i];
}
}
//-----
return(0);
}
//+------------------------------------------------------------------+
Но индикатор как не работал так и не работает - снова вертикальные линии! Исправьте!
в настройках в окошке надо уменьшать koeff до 10 или ниже, пока РСИ не станет "нормальным"
manual tuning for koeff in range 1...500
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Вы принимаете политику сайта и условия использования
RSI Band:
Author: Leonid Basis