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);
}



Sample





Analysis



Market Information Used:



Indicator Curves created:


Implements a curve of type DRAW_LINE

Indicators Used:

Relative strength index


Custom Indicators Used:

Order Management characteristics:

Other Features: