Indicators: Coral

 

Coral:

Coral indicator

Coral

Author: Scriptor

 
Automated-Trading:

Coral:

Author: Scriptor


Good day. Can you suggest and explain better with an example, how to use it correctly in the robot, namely a code example, how to read in the robot its readings.
[Deleted]  

Thanks! not a bad Indicator.

---------------------------

I have modified it a bit so that it could be added to Expert Advisor as a signal indicator.

CoralBrain

Files:
CoralBrain.mq5  14 kb
 
SanAlex:

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.



Thanks. Please provide an example of using its parameter values in the robot.
[Deleted]  
Aleksey Masterov:

Thanks. Please provide an example of using its parameter values in the robot with the code.
//+------------------------------------------------------------------+
//| 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

Files:
 
SanAlex:

To prescribe an indicator instead of MACD

-----------------------

I have attached a ready-made Expert Advisor


О! Senx. I'll be looking into it this week....
[Deleted]  
SanAlex:

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:
Files:
CoralBrain.mq5  17 kb
 
SanAlex:

This one has been redone - the line is displayed and the signal points

Files:

Thanks. I will look...
 

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
Coral
Coral
  • www.mql5.com
Coral indicator
 

Need help to convert the code, which is a part of an indicator ,  from mql5 to mql4.

***

 
Johndcosta:

Need help to convert the code, which is a part of an indicator ,  from mql5 to mql4.

***

Please insert the code correctly: when editing a message, press the button    Codeand paste your code into the pop-up window