EA on offline chart, Can Start function be triggered on offline charts ? - page 2

To add comments, please log in or register
qjol
3196
qjol  

since B600> strings are unicode so ... see here

it sais:

Unicode and ANSI names

PostMessageW (Unicode) and PostMessageA (ANSI)

of course PostMessageA works just fine because in this case it's not string related

but i decided to adapt everything it's my choice

Daniel Petrovai
412
Daniel Petrovai  
qjol:

since B600> strings are unicode so ... see here

it sais:

Unicode and ANSI names

PostMessageW (Unicode) and PostMessageA (ANSI)

of course PostMessageA works just fine because in this case it's not string related but i decided to adapt everything

it's my choice


Got the code into my script, all working as good as before, got handle of the window, post the msg, EA is just as dead as before.

The ticker works well but start() isn't called by the terminal on the offline chart !

What I hope to understand now is why I don't need a false tick or anything for the terminal to call the start function of an indicator on an offline chart, they all work just fine as new data comes from the feeder

but that data feed doesn't work with the EA ?

Is there a way to test if the window received the tick ?

qjol
3196
qjol  
thrdel:

Is there a way to test if the window received the tick ?

of course

Return value

Type:

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError returns ERROR_NOT_ENOUGH_QUOTA when the limit is hit.

it's all in here

   if(hwnd!=0)
     {
      PostMessageW(hwnd,WM_COMMAND,33324,0); // update the chart
      int msg = RegisterWindowMessageW("MetaTrader4_Internal_Message");
      if (PostMessageW(hwnd, msg, 2, 1) == 0) //fake a tick
         Print(kernel32::GetLastError());
      else
         Print("Fake Tick triggered");
     }
Daniel Petrovai
412
Daniel Petrovai  
qjol:

of course

Return value

Type:

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError returns ERROR_NOT_ENOUGH_QUOTA when the limit is hit.

it's all in here



qjol:

of course

Return value

Type:

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError returns ERROR_NOT_ENOUGH_QUOTA when the limit is hit.

it's all in here


Yes, if the post message fails but that doesn't tell if the message is posted and still in a Que or was received by the window intended to .

I was looking at the GetMessage to force the window to receive the msg from the poster hwnd, but that doesn't seem to be included in the user32.dll

qjol
3196
qjol  
then use SendMessageW instead so you can make sure the message has been send
Daniel Petrovai
412
Daniel Petrovai  
qjol:
then use SendMessageW instead so you can make sure if the message has been send

I'm positive the message has been sent. The EA on the offline window doesn't get started by the terminal so I'm not sure what's blocking the receiver.
qjol
3196
qjol  

you wrote

thrdel:

Yes, if the post message fails but that doesn't tell if the message is posted and still in a Que or was received by the window intended to .


the solution is SendMessageW

SendMessage function

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.
qjol
3196
qjol  

i think i know what your problem is

what do you use to generate the offline chart ? periodconverter ? script or indicator ?

Daniel Petrovai
412
Daniel Petrovai  
qjol:

i think i know what your problem is

what do you use to generate the offline chart ? periodconverter ? script or indicator ?


Renko_Live EA
qjol
3196
qjol  
can you post the code or PM to check it out
123
To add comments, please log in or register