Thanks! not a bad Indicator.
---------------------------
I have modified it a bit so that it could be added to Expert Advisor as a signal indicator.
Thank you! Not a bad indicator.
---------------------------
I have modified it a bit so that it could be added to Expert Advisor as a signal indicator.
//+------------------------------------------------------------------+ //| main function returns true if any position processed | //+------------------------------------------------------------------+ bool CSampleExpert::Processing(void) { //--- refresh rates if(!m_symbol.RefreshRates()) return(false); //--- refresh indicators if(BarsCalculated(m_handle_macd)<2 || BarsCalculated(m_handle_ema)<2) return(false); if(CopyBuffer(m_handle_macd,0,0,2,m_buff_MACD_main) !=2 || CopyBuffer(m_handle_macd,1,0,2,m_buff_MACD_signal)!=2 || CopyBuffer(m_handle_ema,0,0,2,m_buff_EMA) !=2) return(false); // m_indicators.Refresh(); //--- to simplify the coding and speed up access //--- data are put into internal variables m_macd_current =m_buff_MACD_main[0]; m_macd_previous =m_buff_MACD_main[1]; m_signal_current =m_buff_MACD_signal[0]; m_signal_previous=m_buff_MACD_signal[1]; m_ema_current =m_buff_EMA[0]; m_ema_previous =m_buff_EMA[1];
//+------------------------------------------------------------------+ //| Check for long position opening| //+------------------------------------------------------------------+ bool CSampleExpert::LongOpened(void) { bool res=false; //--- check for long position (BUY) possibility if(m_macd_current>m_signal_current)
//+------------------------------------------------------------------+ //| Check for short position opening| //+------------------------------------------------------------------+ bool CSampleExpert::ShortOpened(void) { bool res=false; //--- check for short position (SELL) possibility if(m_macd_current<m_signal_current)
Write the indicator instead of MACD
//+------------------------------------------------------------------+ //| Initialisation of the indicators| //+------------------------------------------------------------------+ bool CSampleExpert::InitIndicators(void) { //--- create MACD indicator if(m_handle_macd==INVALID_HANDLE) if((m_handle_macd=iCustom(NULL,0,"CoralBrain"))==INVALID_HANDLE) { printf("Error creating MACD indicator"); return(false); }
-----------------------
Attached ready Expert Advisor
To prescribe an indicator instead of MACD
-----------------------
I have attached a ready-made Expert Advisor
Thank you! Not a bad indicator.
---------------------------
I have modified it a bit so that it could be added to Expert Advisor as a signal indicator.
This one has been reworked - the line is displayed and signal points are also displayed
Files:This one has been redone - the line is displayed and the signal points
Files:I wanted to use this indicator on mt4 platform & so tried to convert it.
pits giving error as the syntax is different , obviously...
but with some modification , I hope it should work.
can anybody help me to convert it to mql4 ?
link of the mql5 version is as below;
https://www.mql5.com/en/code/22496
Need help to convert the code, which is a part of an indicator , from mql5 to mql4.
***
Need help to convert the code, which is a part of an indicator , from mql5 to mql4.
***
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Coral:
Coral indicator
Author: Scriptor