Apply to: previous indicators data

 

Good day fellas

Can someone kindly assist me in coding a RSI(10) with a [SMA(10), Apply To: Previous Indicators Data...] Like so:

(iRSI(NULL,0,10,PRICE_CLOSE,0)>iMA(NULL,0,10,0,MODE_SMA,.......,0) The blank part I want it to be Applied To: Previous Indicators Data.

Your assistance will be highly appreciated.

 
Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
STOP LOSS CHANGE EXPERT FUNCTION ON ALL TRADES (EXCEPT HEDGE TRADES)? On all open positions, before hedging , , excluding hedging trades from this EA, change stop loss to 50 on all open positions, pending stop loss level if 50 ;if 0 no change , if 50 change to 50 stop loss change happens on any position with stop >50 condition for stop loss...
 
Mdali Nkosi:

Good day fellas

Can someone kindly assist me in coding a RSI(10) with a [SMA(10), Apply To: Previous Indicators Data...] Like so:

(iRSI(NULL,0,10,PRICE_CLOSE,0)>iMA(NULL,0,10,0,MODE_SMA,.......,0) The blank part I want it to be Applied To: Previous Indicators Data.

Your assistance will be highly appreciated.

are you asking for something like this?

int moving_average_period=10;

double rsi[];
ArraySetAsSeries(rsi,true);
int h_rsi=iRSI(_Symbol,_Period,moving_average_period,PRICE_CLOSE);
CopyBuffer(h_rsi,0,0,4,rsi);

double sma_with_rsi[];
ArraySetAsSeries(sma_with_rsi,true);
int h_sma_with_rsi=iMA(_Symbol,_Period,moving_average_period,0,MODE_SMA,iRSI(_Symbol,_Period,moving_average_period,PRICE_CLOSE));
CopyBuffer(h_rsi,0,0,4,sma_with_rsi);

 
hello? , hope you all doing good. can someone kindly.create a simple moving average and BollingerBands Condition to Buy And To sell using  "previous indicator Data"?......
 


cowmodee
:

are you asking for something like this?


Thanks for your suggest!

 

It is easy. 


// for example: Create a handle to some indicator, I will use Triple Exponencial here as an example:


int iTEMA_handle = INVALID_HANDLE;

// Load the indicator.. put some values.. price etc.. 
iTEMA_handle   = iTEMA(NULL,PERIOD_CURRENT,18,0,PRICE_WEIGHTED);


// Now lets create another indicator..(iAMA for example) and make it work on the Previous indicator data:
int iAMA_handle = INVALID_HANDLE;
iAMA_handle   = iAMA(NULL, PERIOD_CURRENT,44,2,65,0, iTEMA_handle);

//Notice that, instead of passing a PRICE as last argument of iAMA indicator, I passed the iTEMA handle!
// That is it.. 
// iAMA indicator will be applied over the result of the previous indicator data.. 





Notice that, instead of passing a PRICE as last argument of iAMA indicator, I passed the iTEMA handle (which is the handle of the previous indicator) as a source of PRICE. (last argument)

That is it..

iAMA indicator will be applied over the result of the previous indicator data.. 



I hope this is what you have asked for :) 

: Sometimes I understand and reply what was not the real purpose of the OP question... because of lack of attention (defict of attention which I have at a very high level.. sorry.) please correct me if I did such mistake.