How at create Alerts for Multi Timeframes bar sizes in real time

 

I am trying to create a alert indicator that is attached to a chart, say EURUSD, and will monitor multiple timeframes and charts,  and it will create alerts when large candle sizes occur

for instance say a  current candle on eurusd, has a big spike in volume and a movement of say 500 points, I want to alerts to fire off

== ALERT - LARGE CANDLE >500 PPOINTS - EURUSD ==

-- alert triggers mp3 file for the alert sound

also if the large movements occurs on the eurusd, usdjpy, audcad all at the same time, then we would get multiple alerts fired off



I have put together a basic settings below, how would be the best way to proceed with this in mt5



//+------------------------------------------------------------------+
//|                                  Detect_Bars_With_Alerts_MTF.mq5 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 28 // the number of buffers needed for the indicator
//--- input parameters
input string Symbols="AUDCAD,AUDCHF,AUDJPY,AUDNZD,AUDUSD,CADCHF,CADJPY,CHFJPY,EURAUD,EURCAD,EURCHF,EURGBP,EURJPY,EURNZD,EURUSD,GBPAUD,GBPCAD,GBPCHF,GBPJPY,GBPNZD,GBPUSD,NZDCAD,NZDCHF,NZDJPY,NZDUSD,USDCAD,USDCHF,USDJPY";
input int  BarSize=100;    // Bar pip size to detect and alert on
input bool AlertOnM1=true;
input bool AlertOnM5=true;
input bool AlertOnM15=true;
input bool AlertOnM30=true;
input bool AlertOnH1=true;
input bool AlertOnH4=true;
input bool AlertOnD1=true;
input bool AlertOnW1=true;
input bool AlertOnMN1=true;
//+------------------------------------------------------------------+
//| alert sounds                                                     |
//+------------------------------------------------------------------+
input bool   EnableSoundAlerts  = true;
input string M1SoundFileName    = "bigBar_M1.mp3";
input string M5SoundFileName    = "bigBar_M5.mp3";
input string M15SoundFileName   = "bigBar_M15.mp3";
input string M30SoundFileName   = "bigBar_M30.mp3";
input string H1SoundFileName    = "bigBar_H1.mp3";
input string H4SoundFileName    = "bigBar_H4.mp3";
input string D1SoundFileName    = "bigBar_D1.mp3";
input string W1SoundFileName    = "bigBar_W1.mp3";
input string MN1SoundFileName   = "bigBar_MM1.mp3";
//+------------------------------------------------------------------+
//| //END alert sounds                                               |
//+------------------------------------------------------------------+


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,audcad,INDICATOR_DATA);
   SetIndexBuffer(1,audchf,INDICATOR_DATA);
   SetIndexBuffer(2,audjpy,INDICATOR_DATA);
   SetIndexBuffer(3,audnzd,INDICATOR_DATA);
   SetIndexBuffer(4,audusd,INDICATOR_DATA);
   SetIndexBuffer(5,cadchf,INDICATOR_DATA);
   SetIndexBuffer(6,cadjpy,INDICATOR_DATA);
   SetIndexBuffer(7,chfjpy,INDICATOR_DATA);
   SetIndexBuffer(8,euraud,INDICATOR_DATA);
   SetIndexBuffer(9,eurcad,INDICATOR_DATA);
   SetIndexBuffer(10,eurchf,INDICATOR_DATA);
   SetIndexBuffer(11,eurgbp,INDICATOR_DATA);   
   SetIndexBuffer(12,eurjpy,INDICATOR_DATA);
   SetIndexBuffer(13,eurnzd,INDICATOR_DATA);
   SetIndexBuffer(14,eurusd,INDICATOR_DATA);
   SetIndexBuffer(15,gbpaud,INDICATOR_DATA);
   SetIndexBuffer(16,gbpcad,INDICATOR_DATA);
   SetIndexBuffer(17,gbpchf,INDICATOR_DATA);
   SetIndexBuffer(18,gbpjpy,INDICATOR_DATA);
   SetIndexBuffer(19,gbpnzd,INDICATOR_DATA);
   SetIndexBuffer(20,gbpusd,INDICATOR_DATA);
   SetIndexBuffer(21,nzdcad,INDICATOR_DATA);   
   SetIndexBuffer(22,nzdchf,INDICATOR_DATA);
   SetIndexBuffer(23,nzdjpy,INDICATOR_DATA);
   SetIndexBuffer(24,nzdusd,INDICATOR_DATA);
   SetIndexBuffer(25,usdcad,INDICATOR_DATA);
   SetIndexBuffer(26,usdchf,INDICATOR_DATA);
   SetIndexBuffer(27,usdjpy,INDICATOR_DATA);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,      // Size of input time series
                const int prev_calculated,  // Bars processed at the previous call
                const datetime &time[],     // Opening time
                const double &open[],       // Open prices
                const double &high[],       // High prices
                const double &low[],        // Low prices
                const double &close[],      // Close prices
                const long &tick_volume[],  // Tick volumes
                const long &volume[],       // Real volumes
                const int &spread[])        // Spread
  {
//---
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
  1. xop32I am trying
    int OnCalculate(...){
       return(rates_total);
    }
    That's not a try. You haven't stated a problem. Show us your attempt (using CODE button) and state the nature of your problem.
              No free help
              urgent help.

  2. #property indicator_chart_window
    :
       SetIndexBuffer(0,audcad,INDICATOR_DATA);
       SetIndexBuffer(1,audchf,INDICATOR_DATA);
       SetIndexBuffer(2,audjpy,INDICATOR_DATA);
    :
    What are you going to draw on the main chart when your data is from other symbols?