Combining 2 oscillators

 

hello developers

I have a problem which have tried to search the forum on but can't seem to find the solution

I'm trying to combine RSI and MACD, where by RSI " Apply to " will be based on previous indicator data

have tried some few things 


any help or suggestion will be much appreciated

double MC = iMACD(Symbol(),Frame,13,26,9,PRICE_CLOSE,MODE_MAIN,1);
double RSI =iRSI(Symbol(),Frame,14,MC,0);

if(RSI<20 && OrdersTotal()==0)
bool k= OrderSend(Symbol(),OP_BUY,LotSize,Ask,300,300,200,NULL,5566,0,Blue);
    
MACD - Oscillators - Technical Indicators - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
  • www.metatrader5.com
Moving Average Convergence/Divergence (MACD) is a trend-following dynamic indicator. It indicates the correlation between two Moving Averages of a...
 
Adebayo Samson Adewuyi: hello developers. I have a problem which have tried to search the forum on but can't seem to find the solution. I'm trying to combine RSI and MACD, where by RSI " Apply to " will be based on previous indicator data. have tried some few things. any help or suggestion will be much appreciated

It's not possible in simple MQL4 code. It can be done easily on MQL5 but not not MQL4. So, you will have to program the calculation steps yourself to achieve your goal.

Read up on the calculations of the MACD and RSI, and then build an efficient calculation method to apply one to the other.

 
Adebayo Samson Adewuyi: I'm trying to combine RSI and MACD, where by RSI " Apply to " will be based on previous indicator data

What you showed was nonsense. MC was a single double value, the RSI second from the last requires a is a ENUM_APPLIED_PRICE. Nonsense.

Either find it in the code base, or create a new indicator using iMACD and iRSIOnArray

 
William Roeder #: Either find it in the code base, or create a new indicator using iMACD and iRSIOnArray

Thanks for the reminder of iRSIOnArray. I had forgotten that the function was available on MQL4.

iRSIOnArray - Technical Indicators - MQL4 Reference
iRSIOnArray - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iRSIOnArray - Technical Indicators - MQL4 Reference
 
Fernando Carreiro #:

It's not possible in simple MQL4 code. It can be done easily on MQL5 but not not MQL4. So, you will have to program the calculation steps yourself to achieve your goal.

Read up on the calculations of the MACD and RSI, and then build an efficient calculation method to apply one to the other.

Thanks for that

 
William Roeder #:

What you showed was nonsense. MC was a single double value, the RSI second from the last requires a is a ENUM_APPLIED_PRICE. Nonsense.

Either find it in the code base, or create a new indicator using iMACD and iRSIOnArray

Hey, I mentioned that was what I was able to dig up 

I will try using the suggested info

Thanks anyway

Reason: