Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1491

 
I have written an Expert Advisor - simulator for semi-automatic trading in Tester mode with Visualisation, to test trading strategies. Trades are opened manually on M5 and accompanied automatically or manually. Market situation analysis should be done manually on H1 and D1, the issue is related to these timeframes. We need to open two windows that draw candles for the specified timeframes (without looking into the future). What are the possible options? Is it possible to open charts in separate tabs, in which candlesticks will be drawn as we move through the history in the Tester itself?
 
grezky semi-automatic trading in Tester mode with Visualisation, to test trading strategies. Trades are opened manually on M5 and accompanied automatically or manually. Market situation analysis should be done manually on H1 and D1, the issue is related to these timeframes. We need to open two windows that draw candles for the specified timeframes (without looking into the future). What are the possible options? Is it possible to open charts in separate tabs that will draw candlesticks as we move through the history in the Tester itself?

It is enough to request any chart property in OnInit, let it be the candlestick opening price of the required TF, and such a chart will be opened. Then you can manually set any template to this chart. MQL tools will not work.

 
Alexey Viktorov #:

It is enough to request any chart property in OnInit, let it be the candlestick opening price of the required TF, and such a chart will be opened. Then you can manually set any template to this chart. MQL tools will not work.

Now I found out that I turned to the MT5 thread, but the EA was written for MT4...
And if I write an indicator that draws MTF candlesticks (for a higher timeframe) in another window and from the EA connect it via iCustom - will it work?
Or can iCustom only get values from indicators, but not draw them?
 
Alexey Viktorov #:

It is enough to request any chart property in OnInit, let it be the candlestick opening price of the required TF, and such a chart will be opened. Then you can manually set any template to this chart. MQL tools will not work.

Now I have thought - it is possible to specify the current time in the Expert Advisor while working in the tester and pass this time to a global/terminal variable. In another window will run an indicator on H1 or D1, which when the terminal is disconnected from the Internet will read the specified time and draw a 'black square'? This black square will close bars to the right of the specified time. You will get something like in the picture below.

How to make the indicator continuously check the values of terminal variable, if MT4 is not connected to the Internet and does not receive ticks?



Files:
BlackBox.jpg  83 kb
 
grezky #:

How to make the indicator continuously check terminal variable values, if MT4 is not connected to the internet and does not receive ticks?
By timer.
 
grezky #:
Now I thought - it is possible to specify the current time in the Expert Advisor while working in the tester and transfer this time to a global/terminal variable. In another window will run an indicator on H1 or D1, which when the terminal is disconnected from the Internet will read the specified time and draw a 'black square'? This black square will close bars to the right of the specified time. You will get something like on the picture below.

How to make the indicator continuously check the values of terminal variable, if MT4 is not connected to the Internet and does not receive ticks?



.

It is easier, cheaper and more useful to master MQL5 and check a worthless idea than to make perversions and get the same unsatisfactory result. If the strategy is profitable, why should it be run in a tester?

 
Sergey Gridnev #:
By timer.
I.e. in the loop inside start() every few milliseconds to check the value of the terminal variable?
In such a solution is probably bad that the Expert Advisor will already finish its work, and the indicator will continue to load the system with checks?
 
grezky #:
I.e. in the loop inside start() check the value of the terminal variable every few milliseconds?
No.
Look at OnTimer().
 
Alexey Viktorov #:

It is easier, cheaper and more useful to master MQL5 and test a worthless idea than to make perversions and get the same unsatisfactory result. If the strategy is profitable, why should it be tested in a tester?

We are talking about manual trading on price action, it is necessary to develop skills, get practical experience.
The Expert Advisor-simulator is already ready, we just need to screw to it higher timeframes for analysis, not to look into the future.
If the 'black square' idea works, there is not much to do - I did not know that MTF in visualisation mode is not supported, it would be even easier.

 
Sergey Gridnev #:
No.
OnTimer() take a look.
Thanks!
Reason: