#define's for known commands that can be used for PostMessageA() - page 2

 

While we are on this subject . . . maybe someone can help me or educate me . . . or both. My understanding is that this . . .

PostMessageA(chartsChildHandle, MT4InternalMsg, 2, 1);

has the same effect as a Refresh and tries to refresh data from your Broker as well as forcing a tick . . . is there anyway to do this but without refreshing data from your Broker ? I'd like to "tick" my charts so that the Indicator (not a Technical Indicator) running on it updates frequently . . but I don't want to try and get new data from my Broker every 50 ms or they will get annoyed with me very quickly.

 
RaptorUK:

has the same effect as a Refresh and tries to refresh data from your Broker as well as forcing a tick

And yet that command is different to this one

https://www.mql5.com/en/forum/113544

#include <WinUser32.mqh>

#define CHART_CMD_UPDATE_DATA 33324

int hwnd = WindowHandle(Symbol(), Period());
PostMessageA(hwnd, WM_COMMAND, CHART_CMD_UPDATE_DATA, 1);

which agrees with the list of #defines at the start of this thread. As for the question of creating ticks ... I have no clue :-(

 

RaptorUK:

PostMessageA(chartsChildHandle, MT4InternalMsg, 2, 1);

has the same effect as a Refresh and tries to refresh data from your Broker as well as forcing a tick

I watched data packs by Wireshark (http://www.wireshark.org/) and ticking by MT4InternalMsg, 2, 1 did not cause increased network traffic.

But, when I added CHART_CMD_UPDATE_DATA command, there was serious network load.

So I think it's safe using ticks only.

 

Some more HACKs to

start custom indicators

start an EA

start a script

entitled

Execute an existing EA from a script/ea

https://www.mql5.com/en/forum/115967

 

Fake ticks apparently go back quite a while

Use a script to generate a false tick


https://www.mql5.com/en/forum/108921


and the original is actually from MetaQuotes!

https://www.mql5.com/en/forum/45863

 
erzo:

I watched data packs by Wireshark (http://www.wireshark.org/) and ticking by MT4InternalMsg, 2, 1 did not cause increased network traffic.

But, when I added CHART_CMD_UPDATE_DATA command, there was serious network load.

So I think it's safe using ticks only.

OK, I'm sure I tried this and had lots of messages in the terminal Journal . . . I'll try again on Monday. Thanks.
 

Idea for Tick : If TimeLocal() change every second and TimeCurrent() is not, we're on holiday !!!.

Would anyone confirm my finding here, I'm using MT 419

#define MT4_WMCMD_AUTOSCROLL      33017
#define MT4_WMCMD_33230           33230 /* Arrow Down */
#define MT4_WMCMD_33231           33231 /* Arrow Up */

Those three does not cause any effect such auto scroll, arrow up and down, however they does print the number of Bars in Terminal's expert tab.

 

Speaking about tick, I do actually have lots of them, however I don't use them anymore, coz sometime can cause high processor usage.

For example, try, Tick Sender.exe (http://www.psnouvion.com/downloads) .

 
RaptorUK:
OK, I'm sure I tried this and had lots of messages in the terminal Journal . . . I'll try again on Monday. Thanks.
I must have tried something else before . . . this seems to work just great, many thanks erzo :-)
 

Soooo,

After a very hard day's work and experimenting, I feel the necessity to review.

We have been discussing the issue of ticking a chart in order to get better EA performance on execution of orders.

RaptorUK, directed me to this thread, so that I could try out some of the stuff found here, which I did.

My conclusions are as follows:

1. It is quite simple to tick an offline chart with some while loop + sleep(), or another ticker script, or MT4-TickSender.exe.

However, these methods will only work on offline charts with historical data, because there is no need for information exchange

between the server and the client. Everything is done on the clientside (on our computer and our trading platform). Thus, the EA works.

2. When trading online, we get the situation where information exchange between the server and the client takes place.

The server sends an information package including new quotations, some command which triggers the EA's start() function, and

some other command, which sends back information (like OrderSend() or OrderClose() with all the needed details) from the EA to the server.

Therefore, the conclusion must be, that any fake ticking or while looping, or even PostMessageA()-ing can not, actually take any

effect on the EA's execution, unless it is triggered by the server, first. The codes found in this thread, in the aswincmd.mqh file do

generate ticks, but only on the clientside.

The MT4_WMCMD_UPDATE_DATA 33324 does send information to the server, but does not trigger the EA's start() function.

This is not saying that triggering the server to send us the package in fixed intervals instead of the usual way is not possible.

We, just have not yet discovered how. I am sure this has to be by the PostMessageA() - GetMessageA() protocol, because in PHP

the method is similar, only that we have a lot more possibilities with PHP than with MQL. In PHP we use the Post method to send

information to the server, and the Get method to get information from the server.

Here, we need somebody who is an expert in Windows programming.

I subscribe to the motto that when somebody says something is impossible, it only means that this person does not know how to do it!

Reason: