+ Reply to Thread
Results 1 to 9 of 9

Thread: Zero margin returned by SLM/GKFX MT4

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    5

    Zero margin returned by SLM/GKFX MT4

    I'm working on an EA that works fine with all brokers except SLM/GKFX. The problem is that the parameters related to margin return zero. How do I get the same calculation they have in their online Margin Calculator (http://www.gkfx.co.uk/margin-calculator), but from within the MT4 platform ?

  2. #2
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    383
    Hi rjay,

    Quote Originally Posted by rjay View Post
    I'm working on an EA that works fine with all brokers except SLM/GKFX. The problem is that the parameters related to margin return zero.
    You could examine the use of the "SmartFix" variable in the source of Ray the Random Robot to see if that throws any light on your problem.

    Failing that I don't suppose you have a snippet of code we could take a look at do you?

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  3. #3
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    I am already using the SmartFix code but it seems to only relate to 4 & 5 digit instruments.

    I have a broader problem in that I can't replicate the margin calculations they get with their Margin Calculator. My code works fine on other brokers, just not SLM/GKFX

  4. #4
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    383
    Hi rjay,

    Like I said, a snippet of code would be handy, otherwise we're working in the dark. Doesn't
    Code:
    Margin = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
    do what you require?

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  5. #5
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    Yes I would like to use that but
    MarketInfo(Symbol(),MODE_MARGINREQUIRED)
    returns 0

    According to the doc, for all these parameters we should get something but we get 0
    MODE_MARGININIT 29 Initial margin requirements for 1 lot.
    MODE_MARGINMAINTENANCE 30 Margin to maintain open positions calculated for 1 lot.
    MODE_MARGINHEDGED 31 Hedged margin calculated for 1 lot.
    MODE_MARGINREQUIRED 32 Free margin required to open 1 lot for buying.

  6. #6
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    I pretty much only trade SP500SB and EURUSDSB .. what values do you get for those instruments ?

  7. #7
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    383
    Hi rjay,

    Quote Originally Posted by rjay View Post
    I pretty much only trade SP500SB and EURUSDSB .. what values do you get for those instruments ?
    Just tried MODE_MARGINREQUIRED in a script - for EURUSDSB = 138.11, and for SP500SB = 363.99.

    The others do indeed return zero.

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  8. #8
    Junior Member
    Join Date
    Oct 2010
    Posts
    5
    OK thanks - it seems that it works on the live platform but not the demo !! I'd been testing (for many hours) on the demo, trying to get it to work. Hearing that it worked for you made me investigate more.

    Thanks for your help.

  9. #9
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    383
    Hi rjay,

    Quote Originally Posted by rjay View Post
    OK thanks - it seems that it works on the live platform but not the demo !!
    That's intriguing, because my test was on a demo account!!

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts