#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property indicator_chart_window
//---
extern int PeriodMiliSeconds=250; // Period in miliseconds
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnInit()
{
EventSetMillisecondTimer((int)MathMax(PeriodMiliSeconds,16));
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnDeinit(const int Des)
{
EventKillTimer();
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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(0);
}
//+------------------------------------------------------------------+
#import "user32.dll"
int RegisterWindowMessageW(string lpString);
int PostMessageW(int hWnd,int Msg,int wParam,int lParam);
#import
#define WM_COMMAND 0x0111
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnTimer()
{
static bool inUpdate=false;
if(inUpdate) return;
inUpdate=true;
static int handle=0;
if(handle == 0) handle = RegisterWindowMessageW("MetaTrader4_Internal_Message");
if(handle!=0)
{
ChartSetSymbolPeriod(0,NULL,0);
PostMessageW(Whandle,WM_COMMAND,33324,0);
PostMessageW(whandle,handle,2,1);
}
inUpdate=false;
}
//+------------------------------------------------------------------+
#property link "https://www.mql5.com"
#property version "1.00"
#property indicator_chart_window
//---
extern int PeriodMiliSeconds=250; // Period in miliseconds
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnInit()
{
EventSetMillisecondTimer((int)MathMax(PeriodMiliSeconds,16));
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnDeinit(const int Des)
{
EventKillTimer();
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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(0);
}
//+------------------------------------------------------------------+
#import "user32.dll"
int RegisterWindowMessageW(string lpString);
int PostMessageW(int hWnd,int Msg,int wParam,int lParam);
#import
#define WM_COMMAND 0x0111
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnTimer()
{
static bool inUpdate=false;
if(inUpdate) return;
inUpdate=true;
static int handle=0;
if(handle == 0) handle = RegisterWindowMessageW("MetaTrader4_Internal_Message");
if(handle!=0)
{
ChartSetSymbolPeriod(0,NULL,0);
PostMessageW(Whandle,WM_COMMAND,33324,0);
PostMessageW(whandle,handle,2,1);
}
inUpdate=false;
}
//+------------------------------------------------------------------+
Attached File(s)
AutoRefresh.mq5
4 KB
|
564 downloads