So I found that this is possible in MQL. I searched documentation and I tinkered with the custom indicator MACD.mq4, that comes standard with MT4.
Here is what I have come up with: MARSI.mq4 see attachment. Hmmmm. Can't Upload *.mq4 Then copy/past
It shows: RSI in separate window.
It shows: MA of RSI in that window
It shows: 2 levels
But how do I use this custom indicator in FxDreema ?
//+------------------------------------------------------------------+
//| Custom MARSI.mq4 |
//| Copyright
2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright
2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_level1 45
#property indicator_level2 55
//---- indicator parameters
extern int RSI_Period=10;
extern int MA_Period=10;
//---- indicator buffers
double RSI_Buffer[];
double MA_Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexDrawBegin(1,MA_Period);
IndicatorDigits(Digits);
//---- indicator buffers mapping
SetIndexBuffer(0,RSI_Buffer);
SetIndexBuffer(1,MA_Buffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("RSI("+RSI_Period+")MA("+MA_Period+")");
SetIndexLabel(0,"RSI");
SetIndexLabel(1,"MA on RSI");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| RSI and Ma on RSI |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; i<limit; i++)
RSI_Buffer*= iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, i);
//---- signal line counted in the 2-nd buffer
for(i=0; i<limit; i++)
MA_Buffer*=iMAOnArray(RSI_Buffer,Bars,MA_Period,0,MODE_SMA,i);
//---- done
return(0);
}
//+------------------------------------------------------------------+