New Version of MetaTrader 4 Client Terminal Build 419 - page 4

 
traderjoel:
How? Can you give me an example?
Sit in a while loop waiting for the volume to increase by 1 . . . then you have your next tick. If you miss it then I don't think you can ever get it.
 

Back then, the broker still use 4 digit instead of 5 digits. So there's not much tick coming in.

I'm not worry about missing tick as long as the missing tick is not 100 points away, or 50 points when I'm scalping. So it's kind a funny when one's having such big issue on this. However you entitled to your own opinion and I appreciate your opinions highly - and those also my opinion.

If you worry about missing tick - you should use imported function. MetaQuotes's Stanislav Starikov, explain to me that can be done. He said, " There is no problem. Create new thread in your imported function and immediately return from it. EA will work parallel with this thread. But you should provide synchronization routines yourself ".

I did test this with MT4 and MT5, including calling different imported function in each iteration of tight loop, it works better with MT5, and I don't miss a tick. However synchronizing imported function, was not easy part at all :(.

If you know Windows programming, you're surely know about Window Message, and how message was posted, queue, and archived. Sometime an app does not respond at all to the last message (read Tick), is because the app was busy processing previous message (read : previous tick) and that how we get what we called "Windows not responding".

I really don't miss a tick.

 

jcc and onewithzachy, thank you very much for explanation ! :)

At least now I understand the rationale behind the decision to use such an algoritm. And I agree, it has solid ground. Since I don't have Windows programming experience, I will probably look for alternative solutions. Broker's API is a solution, but it would cost me 600$ a month. For the time being this option is unfeasible.

I know that it is possible get quotes directly from the server by using WINFO/QUOTES commands, but this method is good only if you're interested a most recent snapshot. Is there a command that would subscribe to a continuous data feed? It would be great if I could get data for my black box this way and then send trading orders back to MT4 using some kind of messaging (MQ or similar).

 
traderjoel:

I know that it is possible get quotes directly from the server by using WINFO/QUOTES commands [...]

MetaQuotes are in the process of changing the network protocol. You're absolutely not meant to communicate directly with an MT4 Server without using the MT4 client terminal: http://forexmagnates.com/metaquotes-warns-and-sues-providers-that-hack-its-protocols
 

I was just looking for a solution to my problem. When I couldn't find any standard solution, I've started looking for an "alternative" one.

 

I think that people from metaqoutes could give us (other programmers / developers of mql4) some simple function, such as:

bool AccountIsECN() - returning false for Market Maker or true for ECN/STP account type.


Also MarketInfo(symbol, MODE_POINT) value is size of point, then where is size of pips? Especially for ECN accounts...

I mean the value indicating where is whole pips?

I propose to add MODE_PIPS, eg: if Digits = 5, then MODE_PIPS should be 0.0001 or 4 and one more egzample, if some index have Digits = 2, the MODE_PIPS should be 0.1 or 1.

Why MetaTrader know when SL and TP can be set during OrderSend (F9 dialog) and programmer does not know this while making mql4 script!!!

 

I always know 1 2 3 .. :D Looks coders are lazzy


"bool AccountIsECN() - returning false for Market Maker or true for ECN/STP account type."

Should be enumeration as case.. marketexecutcin,instant,nohedge,etc..

 
reptile:
Should be enumeration as case.. marketexecutcin,instant,nohedge,etc..

Ok, enumeration would be great too, but what was that hard, that "they" don't do that long time ago?

Why programmer must gues or ask user to put what type account is he/she playing on?

Please, for all other programmers, give us this small useful function !!!

You done this in mql5, there must be some way to output this information to mql4 scripts.

 

There is simple case.. need to rebuild mt4 as mt5..

https://forum.mql4.com/47037/page3

Add.. post here

Yes.. big true.. but why in new build is more bug than previous and previous? Isn't strange? Some bugs when save img.. who and why want broken this stupis descrb. ? He? Lol.. I'm suprised day after day with b419



 
RaptorUK:
Sit in a while loop waiting for the volume to increase by 1 . . . then you have your next tick. If you miss it then I don't think you can ever get it.

Just tried to put it into the loop but the results didn't got any better.

int init() {
   while(!IsStopped()) {
      if(RefreshRates()) {
         Print(StringConcatenate("[",Volume[0],"] ",DoubleToStr(Bid,Digits)));
      }
      Sleep(1);
   }
}

int start() {
}

2012.04.23 19:29:56     testTicks EURUSD,M1: [11] 1.31339
2012.04.23 19:29:50     testTicks EURUSD,M1: [10] 1.31336
2012.04.23 19:29:37     testTicks EURUSD,M1: [9] 1.31334
2012.04.23 19:29:37     testTicks EURUSD,M1: [8] 1.31332
2012.04.23 19:29:31     testTicks EURUSD,M1: [7] 1.31329
2012.04.23 19:29:31     testTicks EURUSD,M1: [4] 1.31327
2012.04.23 19:29:30     testTicks EURUSD,M1: [2] 1.31332

Any other ideas how to capture every single tick?

Reason: