MessageBox in Custom Indicator

 

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)

  {

//---

   

  }

//+------------------------------------------------------------------+


Automated Trading and Strategy Testing
Automated Trading and Strategy Testing
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. Should Trader System Developer Have...
 
johnbenz:I have code custom indicator with messagebox, I dont know why it is not executed or poping up,
  1. 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

  2. Indicators can not wait, they can not call blocking calls like Sleep, OrderSend, WebRequest.

  3. Perhaps you should read the manual. The documentation plainly states
    Note 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
Reason: