Indicators: Trend Dashboard Indicator - page 2

 

Hi I need to add 2 new Indicators please with a how to Tutorial or guide , can you please guide me


the first is

  if(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)) return(0);
double
   M_0, M_1,                           // Value MAIN at bars 0 and 1
   S_0, S_1,                           // Value SIGNAL at bars 0 and 1
   St_M_0, St_M_1,                     // Value MAIN at bars 0 and 1
   St_S_0, St_S_1;                     // Value SIGNAL at bars 0 and 1
   double Opn=Open_Level*Point;        // Opening level of MACD (points)
   double Cls=Close_Level*Point;       // Closing level of MACD (points)
//-------------------------------------------------------------------- 4 --
   // Parameters of technical indicators:
   M_0=iMACD(Sym,PERIOD_H1,12,26,9,PRICE_CLOSE,MODE_MAIN,0); // 0 bar
   M_1=iMACD(Sym,PERIOD_H1,12,26,9,PRICE_CLOSE,MODE_MAIN,1); // 1 bar
   S_0=iMACD(Sym,PERIOD_H1,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);//0 bar
   S_1=iMACD(Sym,PERIOD_H1,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);//1 bar
 
   St_M_0=iStochastic(Sym,PERIOD_M15,5,3,3,MODE_SMA,0,MODE_MAIN,  0);
   St_M_1=iStochastic(Sym,PERIOD_M15,5,3,3,MODE_SMA,0,MODE_MAIN,  1);
   St_S_0=iStochastic(Sym,PERIOD_M15,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   St_S_1=iStochastic(Sym,PERIOD_M15,5,3,3,MODE_SMA,0,MODE_SIGNAL,1);
//-------------------------------------------------------------------- 5 --
   // Calculation of trading criteria
   if(M_0>S_0 && -M_0>Opn && St_M_0>St_S_0 && St_S_0<St_min)
      return(10);                      // Opening Buy    
   if(M_0<S_0 &&  M_0>Opn && St_M_0<St_S_0 && St_S_0>St_max)
      return(20);                      // Opening Sell 
   if(M_0<S_0 &&  M_0>Cls && St_M_0<St_S_0 && St_S_0>St_max)
      return(11);                      // Closing Buy    
   if(M_0>S_0 && -M_0>Cls && St_M_0>St_S_0 && St_S_0>St_min)
      return(21);                      // Closing Sell         
//-------------------------------------------------------------------- 6 --
   return(0);                          // Exit the user-defined function
  }



  • and I need help making that work in the same Dashboard with the Alert signal , and I need the alert signal as in  


All Indicators are in Sell Signal then I get an Alert,


the 2nd Request is I want to be able to add iCustom to the list of the indicators

https://www.mql5.com/en/code/576


https://www.mql5.com/en/code/22611


===============================
int      SuperTrendHandle;           //handle
double   Supertrend[];               //dynamic array to store the indicator values

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
  //--- Get handle for SuperTrend indicator
  SuperTrendHandle=iCustom(NULL,0,"supertrend",10,3,false);
  return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
      //--- Supertrend START
      //--- check for errors
      if(SuperTrendHandle<0)
        {
         Alert("Error Creating Handles for SuperTrend - error: ",GetLastError(),"!!");
        }
      //--- filling arrays with current values of iCustom
      //--- Copying elements
      CopyBuffer(SuperTrendHandle,0,0,20,Supertrend);
      //--- set indexing of elements as series
      ArraySetAsSeries(Supertrend,true);
      //--- SuperTrend END

      //--- for debugging
      Print("Supertrend: ",Supertrend[0]);
 }
 
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---Indicator  release
   IndicatorRelease(SuperTrendHandle);

  }
===============================

     CopyBuffer(SuperTrendHandle,2,0,20,Supertrend);
SuperTrend
SuperTrend
  • www.mql5.com
SuperTrend indicator.