View Single Post
  #36 (permalink)  
Old 08-03-2005, 04:15 PM
ondigio ondigio is offline
Freshman
 
Join Date: Jun 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
ondigio is on a distinguished road
Default

I'm awake! I don't recall whether I had any chocolate dreams, but chances are that I did -- my girlfriend works for Godiva!

I've read through that broker API thread several times already, as I was just as concerned as you when I first learned about the lack of client API for MT4. I'm curious--where did you learn that GAIN's execution time is slow? How slow are we talking about?

I think some further discussion of these 5-second frequency limitations imposed by the DLL is warranted, for anyone (like me) who didn't quite "get it" from reading the rest of this thread. For reference, here is the number of seconds one is supposed to wait between calling certain functions:
  • Login => 1 sec
  • OpenDemoAccount => 30 sec
  • ChangePassword => 60 sec
  • RefreshSecurities, GetTrades, GetTradeHistory, GetNewsBody, GetPrices => 5 sec
  • [Send/Delete/Modify/Close/CloseBy]Order => 5 sec

This was posted in some random thread on the MetaQuotes forum, and has crept its way into the online documentation at several MT3 brokers -- don't ask me why it wasn't in the docs to begin with! Anyway, this list raises some questions:
  1. Do the limits apply individually to each connection, or to all connections as a whole? If it's "all", does that mean all connections to a specific server, from a single IP address, for a specific account, or from a single running process?
  2. Which of these limitations are actually enforced, not just recommended?

From the other comments posted, I'm guessing the answer to #1 is that the limitation is imposed per process, since sccz97 was able to solve the problem by launching separate console applications. From my testing, the limitations do appear to be enforced for RefreshSecurities and GetPrices. I'm not sure about the rest--it's difficult for me to test because my wrapper is currently structured to use a new connection for each call, as recommended by the MetaQuotes guys.

And...
Quote:
Originally Posted by scorpion
In standard account 1 lot of EURUSD = 100,000 units (100k), so the Lots value should be 100 for standard, while 10 for mini. (The Lots parameter expects lot size in kilo)
Quote:
Originally Posted by scorpion
Be careful with currency pair. If you play with GetSecurities(), you will see the lot size of GBPUSD = 70,000 while EURUSD = 100,000 in standard account.
When I first read this thread, I was confused by this. I thought you were stating that all functions expect lots/volume in kilos. For anyone reading along, this only applies to MtGetPrices and scorpion's GetCurrentRate (personally, I call this method "quote", cuz that's what it is!) When passing volume to the Order functions, or when getting it from a trade record, the value is simply multiplied by 100. I'm assuming this is so that fractional sizes as small as 0.01 lot can be represented with an integer instead of a floating point value.

So, you should always use Lots = 100 to place an order for 1 lot, regardless of contract size. In my wrapper, the multiplication and division is handled transparently, so I don't have to think about it. When I want to buy 1 lot, I pass in Lots = 1!

Here's a question, though: I just called MtGetPrices on Alpari's demo server for GBPUSD (where the GBPUSD contract = 70,000) with a lot value of 7, on both a regular and mini demo account. According to your instructions, this would be the correct value to use for 1 mini lot. But I got an INVALID_VOLUME error! The only values that work are multiples of 10. This leads me to believe that, perhaps, the lots parameter to MtGetPrices works the same way as the volume parameter elsewhere--it's simply Lots * 100. Any thoughts?
Reply With Quote

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now

Main Menu

Economic Forecast