Help on RSI please. - page 2

 
Fire wrote >>

Phy,

My intention, I want to add one more window, in it I will have RSI and an EMA of the RSI in the RSI window.

Is this possible?

Dear Guru,

I have tried for hours, but not getting any where, can any one please help,

Thanks.

 

You keep asking questions, show the code you have so far.

 
phy wrote >>

You keep asking questions, show the code you have so far.

Thanks Phy,

I admit I do not know how to handle this arrays iMAOnArray(), thus I could not find a way to walk arround to get my idea on.

"

I want to add one more window, in it I will have RSI and an EMA of the RSI in the same RSI window

"

I thought a function plug in will help, but it is not working, I mean:

"

int start()
{
iRSI(NULL,0,12,Bid,0);
iMA(NULL,0,3,0,MODE_EMA,iRSI(NULL,0,12,PRICE_CLOSE,0),0);
return(0);
}

"

but when I do (RSI on price and MA on price) it works.

"

int start()
{
iRSI(NULL,0,12,Bid,0);
iMA(NULL,0,3,0,MODE_EMA,Bid,0);
return(0);
}

"

I do not know will you mind if you guide me with a snip code, I will study it. I will appreciate.

 
//+------------------------------------------------------------------+
//|                                                    MA_On_RSI.mq4 |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Red

int rsi_period = 14;
int ma_period = 5;
int ma_method = 0;
int ma_shift = 0;
int applied_price = 0;

//---- buffers
double rsi[];
double rsima[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,rsi);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,rsima);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    repaintable_bars = Bars - IndicatorCounted();
   
   for(int shift = repaintable_bars; shift >= 0; shift--){
   rsi[shift] = iRSI(Symbol(), 0, rsi_period, applied_price, shift);
   }
   for(shift = repaintable_bars; shift >= 0; shift--){
   rsima[shift] = iMAOnArray(rsi, 0, ma_period, ma_shift, ma_method, shift);
   }
   return(0);
  }
//+------------------------------------------------------------------+
 
Fire:

Phy,

My intention, I want to add one more window, in it I will have RSI and an EMA of the RSI in the RSI window.

Is this possible?

Any one want to help me, I could not get this right. please.

 

I have no idea what you are looking for. Have a nice day.

 
phy:

I have no idea what you are looking for. Have a nice day.

Sorry Phy,

I over looked your code, I just noted there is a snip code made by you. I THANK YOU the code.


I run your code, I got this message on the journal: "SetIndexBuffer function must be called from custom indicator only"


And got the RSI line only, please comment, thanks.

 
Fire:

Sorry Phy,

I over looked your code, I just noted there is a snip code made by you. I THANK YOU the code.


I run your code, I got this message on the journal: "SetIndexBuffer function must be called from custom indicator only"


And got the RSI line only, please comment, thanks.


Phy Did you run the code did you got the same error as I said, how can we get around this error

 

This code is an indicator, not an EA

 
phy:

This code is an indicator, not an EA

Phy,

Thanks for sticking on with me on this topic.

Lets look at the default example (MACD Sample) found in the experts folder, they used MACD to decide entry & exit.

Same I want to use the RSI & RSI's EMA crossing to take entry. Thus I am trying to like them.

Can you please guide, if we want me to your indicator code, how can I link to my EA?

Reason: