Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 2603
Next
In Process
scriptong
scriptong

scriptong

  • 2 Questions
  • 37 Answers
  • 0 Best Answers
  • 94 Points
View Profile
  • 0
scriptong
Asked: December 26, 20202020-12-26T12:24:42+00:00 2020-12-26T12:24:42+00:00In: Forex Expert Advisors

Checking the robot for Yandex. Market

  • 0

Roman Starinskij:
Who knows how to fix it? Here is a screenshot of the error and part of the code

The check is simply not done. The function is called and that’s it. Everything is described in the documentation and there is an example of using it.

AccountFreeMarginCheck

Returns the amount of free funds
that will remain after opening the specified order at the current price on the current
account.

double  AccountFreeMarginCheck(
   string symbol, / / symbol
   int     cmd,        // trading operation
   double volume / / number of lots
   );
  • 3 3 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    3 Answers

    • Voted
    • Oldest
    • Recent
    1. nume

      nume

      • 0 Questions
      • 2 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      nume
      2020-12-26T12:24:55+00:00Added an answer on December 26, 2020 at 12:24 pm

      Vitalii Ananev:

      AccountFreeMarginCheck returns a double instead of a Boolean value. You use the result of the function in the if statement.  For any value of the AccountFreeMarginCheck function other than zero, the result of implicit type conversion will be true. 

      It is more correct to write:

      ….

      Now it is clear why many people complain about the service market.

      It’s not just those who can’t pass the test because of inattention who complain. Also complain about those who made the code 2 weeks ago, it passed the test, since then really little has changed, but the new version can no longer pass the test. And all changes in the new version concern 2 lines and do not concern the definition of the volume!! Since yesterday I see the error no trading operations, maybe holidays, and the check is still disabled?!

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. vitales

      vitales

      • 1 Question
      • 22 Answers
      • 0 Best Answers
      • 66 Points
      View Profile
      vitales
      2020-12-26T12:24:49+00:00Added an answer on December 26, 2020 at 12:24 pm

      Roman Starinskij:

      Thank you for your help, really missed it from the documentation.
      Updated the code

      Waiting for the result from the tester 🙂

      AccountFreeMarginCheck returns a double instead of a Boolean value. You use the result of the function in the if statement.  For any value of the AccountFreeMarginCheck function other than zero, the result of implicit type conversion will be true. 

      It is more correct to write:

      if ((AccountFreeMarginCheck(Symbol(), OP_BUY, lot)>0) && GetLastError() != 134)

      ….

      Now it is clear why many people complain about the service market.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. evillive

      evillive

      • 0 Questions
      • 3 Answers
      • 0 Best Answers
      • 26 Points
      View Profile
      evillive
      2020-12-26T12:24:45+00:00Added an answer on December 26, 2020 at 12:24 pm

      Roman Starinskij:

      Thank you for your help, really missed it from the documentation.
      Updated the code

      if (AccountFreeMarginCheck(Symbol(), OP_BUY, lot) && GetLastError() != 134)
         result = OrderSend(Symbol(), OP_BUY, lot, price, orderSlippage(), sl, tp, systemGetName(), SystemMagic, 0, clrBlue);

      Waiting for the result from the tester 🙂

      The code has not become better, still the function is only called, and nothing is done with the result of the call. At least compare the return value with some amount, chtoli…

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 681
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Related Questions

    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    Users

    Leonardcig

    Leonardcig

    • 0 Questions
    • 0 Answers
    DennisByday

    DennisByday

    • 0 Questions
    • 0 Answers
    Haroldmeary

    Haroldmeary

    • 0 Questions
    • 0 Answers

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved