Termos de Referência
Profitrobots bot: https://profitrobots.com/Home/NotificationsMT4
the msg showed on discord should look like this:
if an order is opened:
('Symbol', 'Date, time') '# of Lots' 'Long or short' Position 'Opened', 'Entered' at 'price level'
(XAUUSD, 13/05/2022 17:06:23) 1.5 Lot Long Position Opened, Entered at 1823.15
if an order is closed:
('Symbol', 'Date, time') '# of Lots' 'Long or short' Position 'Closed', 'Exited' at 'price level'
(XAUUSD, 13/05/2022 17:06:23) 1.5 Lot Long Position Closed, Exited at 1823.15
#import "AdvancedNotificationsLib.dll"
void AdvancedAlert(string key, string text, string instrument, string time, string text);
#import
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
datetime last_date;
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
if (last_date != Time[0])
{
AdvancedAlert("##Discord Channel Key Here##", "", _Symbol, TimeToStr(TimeCurrent(),TIME_SECONDS), "GMT+3");
last_date = Time[0];
}
//--- return value of prev_calculated for next call
return(rates_total);
}