Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
RSI_Directions_Lib_Sample
//+------------------------------------------------------------------+
//| RSI_Directions_Lib_Sample.mq4 |
//| Copyright © 2009, TheXpert |
//| theforexpert@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, TheXpert"
#property link "theforexpert@gmail.com"
#include <Indicator_Painting.mqh>
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_color3 Red
extern int RSIPeriod = 9;
extern int AppliedPrice = 0;
// buffers
double Values[]; // Ñîáñòâåííî çíà÷åíèÿ
double Growing1[]; // ïåðâûé áóôåð ðîñòà
double Growing2[]; // âòîðîé áóôåð ðîñòà
int DigitsUsed = 5;
int EmptyValueUsed = 0;
int init()
{
IndicatorBuffers(3);
// àññîöèèðóåì áóôåðû
SetIndexBuffer(0, Values);
// èç-çà îñîáåííîñòåé ðåàëèçàöèè íåîáõîäèìî, ÷òîáû áóôåð ñî
// çíà÷åíèÿìè èìåë ìåíüøèé èíäåêñ, ÷åì âñïîìîãàòåëüíûå áóôåðû
SetIndexBuffer(1, Growing1);
SetIndexBuffer(2, Growing2);
// çàäàåì íàñòðîéêè äëÿ áóôåðîâ
SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexStyle(2, DRAW_LINE);
return(0);
}
int start()
{
int toCount = Bars - IndicatorCounted();
// Ñ÷èòàåì çíà÷åíèÿ
for (int i = toCount - 1; i >=0; i--)
{
Values[i] = NormalizeDouble(iRSI(Symbol(), 0, RSIPeriod, AppliedPrice, i), DigitsUsed);
}
// Ìåòèì óðîâíè ðîñòà -- óðîâíè ïàäåíèÿ àâòîìàòè÷åñêè âûäåëÿòñÿ ñàìè
MarkGrowing(Values, Growing1, Growing2, toCount - 1, 0, EmptyValueUsed);
return(0);
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---