Wishes for MQL5 - page 99

 
Henry_White >> :

What I would like to see in future releases:

  1. Ability to execute its procedures outside the content of the tick handler (for MT4 this is start()) (e.g. in a separate track, for calculation of statistics, optimisation, etc.),
  2. The simplest functions for mouse handling. For example, on "OnClick" event it is possible to get pointer coordinates in MT dimension (on X - bar index, on Y - y-coordinate of the current window.

1. What prevents it now?

2. In MQL5, EAs will be able to handle window events (EMNIP).

 
TheXpert >> :

1. What's in the way right now?

Well if you know how, I would be very grateful if you could share this skill/knowledge.

 
TheXpert >> :

2. In MQL5 the Expert Advisors will be able to handle the window events (EMMNIP).

The ChartEvent event handler will only be available in EAs, by the way... Quite a strange discrimination ))) I think the necessity is the same in indicators (the Expert Advisors do not need it).

 
Henry_White >> :

Well, if you know how, I would be very grateful if you could share that skill/knowledge.

Not like two fingers on the asphalt, but you can. Connect dll, call calculations in a new thread - WinAPI will help here, termination by timer or callback.

Henry_White >> :

The ChartEvent event handler will be available only in Expert Advisors, by the way... Quite a strange discrimination ))

I don't like it either. But now the indices are not linked to the chart.

 
TheXpert >> :

Not like two fingers on the asphalt, but it is possible. Connect dll, make calculations in a new thread - WinAPI will help here, finish by timer or callback.

I was thinking about the DLL variant, but it is not quite clear to me how to get CORRECT access to time series, plus the values of more than 10 different indicators, and all this at a decent depth over the history. And if we consider that the calculation time takes more than a minute (I work with minutes), then it is absolutely unclear, where pointers DLL will refer to after adding a new bar in the client terminal. And we also need to return a couple dozens of calculated parameters and add various charts to the price series. It is not trivial, all in all...

Having looked at all this and estimated how much time I'd need for experiments and various checks and debugging, I wrote a time-cluster processing in MQL... It works, but... It's not nice. But my soul demands it! ))) And it's already the 21st century... And you want to live up to the age. ))

 

I propose to clarify (define) the concept of "point".

A pip is the 5th significant digit: 1.2345.

If a quote is represented by another digit (1.23456) and spread = 0.00018, then the spread in pips is 1.8 p, not 18 p.

This will introduce uniformity in terminology and avoid confusion.

 
SK. >> :

I propose to clarify (define) the concept of "point".

A pip is the 5th significant digit: 1.2345.

If a quote is represented by another digit (1.23456) and spread = 0.00018, then the spread in pips is 1.8 p, not 18 p.

That will introduce uniformity in terminology and avoid confusion.

You are absolutely right - brokers write "spread 1.8" on their websites, not 18 - they know exactly what they do :)

 

Функция OnCalculate() вызывается только в пользовательских индикаторах
при необходимости произвести расчет значений индикатора по событию Calculate.

I still have no idea how I can make an indicator with objects and without knowing the number of bars changed

 

I see there is a printf function

and how great it would be to get another sprintf



 
Roffild >> :

I still have no idea how I can make an indicator with objects and without knowing the number of modified bars

The MQL5 help states:

int OnCalculate (const int rates_total, // the size of input timeseries
const int prev_calculated, // bars processed at previous call
const datetime& time[], // time
const double& open[], // Open
const double& high[], // High
const double& low[], // Low
const double& close[], // Close
const long& tick_volume[], // Tick Volume
const long& volume[], // Real Volume
const int& spread[] // Spread
);

The relationship between the value returned by OnCalculate() and the second input parameter prev_calculated should be noted. The parameter prev_calculated when calling the function contains a valuereturned by OnCalculate() on previous call. This allows for economical algorithms for calculating the custom indicator in order to avoid repeated calculations for those bars that haven't changed since the previous call of this function.

For this, it is usually enough to return the value of the rates_total parameter, which contains the number of bars in the current function call. If since the last call of OnCalculate() price data have changed (a deeper history has been loaded or history blanks have been filled), the value of the input parameter prev_calculated will be set to zero by the terminal.

Reason: