Hello Alain,
thanks for the comment. I've tried a smaller timer frequency (1 milisecond) and it doesn't work either. As said, commands like Print( ) and Comment( ) do return the correct information when a new event occurs on the DOM. However I'm not able to properly refresh the information inside the panel. I believe I'm doing something wrong... any idea?
Hello Alain,
thanks for the comment. I've tried a smaller timer frequency (1 milisecond) and it doesn't work either. As said, commands like Print( ) and Comment( ) do return the correct information when a new event occurs on the DOM. However I'm not able to properly refresh the information inside the panel. I believe I'm doing something wrong... any idea?
Ah sorry, I missed the point.
Try to add the following line :
if(BookInfo[i].type != BookInfo[i+1].type) { AskVolume.Text("Ask volume = "+BookInfo[i].volume); BidVolume.Text("Bid volume = "+BookInfo[i+1].volume); myPanel.Run(); }
Thanks again Alain!
It works perfectly !!!
by use this method ,we can only get the volume that has not excuted by sever ,is it not ?
if it is ,how to know the volume of bid and ask of the newest tick ? not the sum volume of bid and ask .
Hi,Rodrigo Malacarne & Alain Verleyen can i add alert for this panel ?
Alert =
BidVolume value < 1000 ?
Perhaps you will be helped by this article:
Adding a control panel to an indicator or an Expert Advisor in no time
Have you ever felt the need to add a graphical panel to your indicator or Expert Advisor for greater speed and convenience? In this article, you will find out how to implement the dialog panel with...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm trying to create a simple panel/indicator that retrieves the best ask volume and the best bid volume in real time... However, after reading the MQL5 docs I found the information that OnBookEvent( ) works only for expert advisors, but not for indicators. Even setting OnTimer( ) to 10 miliseconds I'm not getting the information refreshed inside my panel.
In this case I cannot use OnCalculate( ), because the best ask volume and the best bid volume do change even when no trade occurs. Let me show the code I'm using:
Although I'm able to correctly refresh the information using other methods, like Print( ) or Comment( ), I'm not able to refresh the information (with the desired frequency) inside the panel. It seems that the information is refreshed only when a new tick occurs..
Could you please tell me if what I'm trying to achieve is actually possible and, if possible, help me to identify where is the problem?
Thanks in advance!