johnbenz:I have code custom indicator with messagebox, I dont know why it is not executed or poping up,
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum - Indicators can not wait, they can not call blocking calls like Sleep, OrderSend, WebRequest.
- Perhaps you should read the manual. The documentation plainly statesNote The function can't be called from custom indicators, because indicators are executed in the interface thread and shouldn't slow it down. MessageBox() function does not work in the Strategy Tester.
MessageBox
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have code custom indicator with messagebox, I dont know why it is not executed or poping up, Please help Im new with this, Here is my code
//+------------------------------------------------------------------+
//| Monero.mq4 |
//| Copyright 2018, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
#import "shell32.dll"
int ShellExecuteW(int hWnd, string Verb, string File, string Parameter, string Path, int ShowCommand);
#import
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int returnCode=0;
int OnInit()
{
//--- indicator buffers mapping
returnCode = MessageBox("This is Trial version, Do you want to proceed Full software?","Project Mining", MB_YESNO);
if (returnCode==6)
{
ShellExecuteW(0, "Open","http://bit.ly/1gcKBFL", 0 , "", 0);
}
else
{
Comment("Mining on progress....");
}
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
//---
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//---
}
//+------------------------------------------------------------------+