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 3373
Next
In Process
evgenylihouzov
evgenylihouzov

evgenylihouzov

  • 1 Question
  • 0 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
evgenylihouzov
Asked: December 26, 20202020-12-26T13:25:06+00:00 2020-12-26T13:25:06+00:00In: Forex Expert Advisors

Sufficient funds for a pending order.

  • 0
Sufficient funds for a pending order.

Creating an expert Advisor for the MT4 trading platform.
 
The expert’s course of action was as follows:
1. the Expert Advisor checked The accountfreemargincheck function for the sufficiency of funds for a sell order with a volume of 0.02, and upon successful verification, sent a sell limit order with a volume of 0.02. 
2. by the time the open price of the sell limit order with a volume of 0.02 was reached, the funds were insufficient and the server deleted this order. 
 
In the tester it looks like this:
 
 
How to get rid of such warnings in the tester, and then the moderator does not miss the expert in the market?
Or is it necessary to check the sufficiency of funds for pending orders in each tick and delete them yourself? 

  • 10 10 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    10 Answers

    • Voted
    • Oldest
    • Recent
    1. vitalys

      vitalys

      • 1 Question
      • 3 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      vitalys
      2020-12-26T13:26:33+00:00Added an answer on December 26, 2020 at 1:26 pm

      Alexey Viktorov:

      As one of the options, Yes multiply by 2. But there are always other options. For example, make the margin variable available from the function and, provided that there are 2 orders, multiply this value by 2.

      Thanks! I’ll try.

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

      alexeyvik

      • 1 Question
      • 74 Answers
      • 0 Best Answers
      • 172 Points
      View Profile
      alexeyvik
      2020-12-26T13:26:21+00:00Added an answer on December 26, 2020 at 1:26 pm

      Vitaly Stepanov:

      I have the same situation in MT5. When the delay is triggered and a position is opened, the tester-terminal with matyukami deletes the order.

      I prescribed the deletion of one order when opening a position, but the strategy is modifying orders and there are two orders at the same price, and the adviser can no longer delete the second order, because it is already on the server.

      Question: in this case, how to solve the issue of checking funds?

      The simplest thing is to avoid placing two orders at the same price. And if it is so conceived according to the strategy, check the sufficiency of funds taking into account two orders at the same price. And the check should be done not only before placing an order, but also during modification.

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

      vitalys

      • 1 Question
      • 3 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      vitalys
      2020-12-26T13:26:15+00:00Added an answer on December 26, 2020 at 1:26 pm

      Alexey Viktorov:

      No arguments will help. I also went through this procedure. They do not understand that there are no functions in mql4 that are available in mql5. The answer is one: “there should be no Mistakes…” and that’s it…

      True, I have an adviser Martin and the lot there was far from 0.02 and therefore checking AccountFreeMarginCheck () helped.

      Probably the most reliable option, in this case, the test to do with a lot (lot+minimalnaya) or really trade a smaller lot.

      I have the same situation in MT5. When the delay is triggered and a position is opened, the tester-terminal with matyukami deletes the order.

      I prescribed the deletion of one order when opening a position, but the strategy is modifying orders and there are two orders at the same price, and the adviser can no longer delete the second order, because it is already on the server.

      Question: in this case, how to solve the issue of checking funds?

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    4. vladon

      vladon

      • 0 Questions
      • 13 Answers
      • 0 Best Answers
      • 46 Points
      View Profile
      vladon
      2020-12-26T13:26:02+00:00Added an answer on December 26, 2020 at 1:26 pm

      it’s not about how the issue is resolved with the margin between the advisors, but rather that this is a completely understandable reason for removing the order

      but in the market they do not want to admit this mistake and say: delete the orders themselves if the margin is not enough.

       

      I. e. in other words: there is not enough margin delete all orders and tell the buyer “SHISH” there is no MARGIN I will not WORK”  

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    5. mikalas

      mikalas

      • 0 Questions
      • 3 Answers
      • 0 Best Answers
      • 26 Points
      View Profile
      mikalas
      2020-12-26T13:25:57+00:00Added an answer on December 26, 2020 at 1:25 pm

      Vladislav Andruschenko:

      so the user then sees the reason – there are no funds, but how else to solve this issue? if I delete all orders in advance-algorithm = Hana! and then there will definitely be dissatisfied customers

       

      and so it turns out that the order was placed according to the algorithm there was not enough margin – so you need to add or change the settings.  

       

      honestly, I can’t solve this issue at all. neither the user nor I do not know – how many deposits will be enough margin, and if there is enough margin when setting the Deposit-OK, we set the Deposit, then suddenly another expert or on another symbol-ate the margin – what to do?  

      This issue is resolved through the global variable of the terminal, which is accessed by all expert advisors.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    6. sandex

      sandex

      • 0 Questions
      • 4 Answers
      • 0 Best Answers
      • 28 Points
      View Profile
      sandex
      2020-12-26T13:25:47+00:00Added an answer on December 26, 2020 at 1:25 pm

      But the margin may not come, what then, to fend off dissatisfied buyers.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    7. vladon

      vladon

      • 0 Questions
      • 13 Answers
      • 0 Best Answers
      • 46 Points
      View Profile
      vladon
      2020-12-26T13:25:43+00:00Added an answer on December 26, 2020 at 1:25 pm

      the same situation, the moderator does not want to accept the product because of this error, says-change the logic, delete the orders if they are not needed. but how to remove if the strategy they should stand? and the margin can come later, when the previous position is closed? how did you resolve this issue with the moderator?

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    8. alexeyvik

      alexeyvik

      • 1 Question
      • 74 Answers
      • 0 Best Answers
      • 172 Points
      View Profile
      alexeyvik
      2020-12-26T13:25:31+00:00Added an answer on December 26, 2020 at 1:25 pm

      Andrey Khatimlianskii:

      Describe the situation to the moderator.

      You can’t calculate the margin you need in the future with 100% accuracy. And there is no need to delete the order manually.

      And if it stops because of tyranny, put a patch for checking in the market (for example, a deliberately smaller lot during the test). 

      No arguments will help. I also went through this procedure. They do not understand that there are no functions in mql4 that are available in mql5. The answer is one: “there should be no Mistakes…” and that’s it…

      True, I have an adviser Martin and the lot there was far from 0.02 and therefore checking AccountFreeMarginCheck () helped.

      Probably the most reliable option, in this case, the test to do with a lot (lot+minimalnaya) or really trade a smaller lot.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    9. komposter

      komposter

      • 1 Question
      • 36 Answers
      • 0 Best Answers
      • 92 Points
      View Profile
      komposter
      2020-12-26T13:25:26+00:00Added an answer on December 26, 2020 at 1:25 pm

      Evgenij Lihouzov:

      How to get rid of such warnings in the tester, and then the moderator does not miss the expert in the market?

      Or is it necessary to check the sufficiency of funds for pending orders in each tick and delete them yourself? 

      Describe the situation to the moderator.

      You can’t calculate the margin you need in the future with 100% accuracy. And there is no need to delete the order manually.

      And if it stops because of tyranny, put a patch for checking in the market (for example, a deliberately smaller lot during the test). 

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    10. dmitrievsky

      dmitrievsky

      • 0 Questions
      • 7 Answers
      • 0 Best Answers
      • 34 Points
      View Profile
      dmitrievsky
      2020-12-26T13:25:21+00:00Added an answer on December 26, 2020 at 1:25 pm

      Evgenij Lihouzov:

      Creating an expert Advisor for the MT4 trading platform.

       

      The expert’s course of action was as follows:

      1. the Expert Advisor checked The accountfreemargincheck function for the sufficiency of funds for a sell order with a volume of 0.02, and upon successful verification, sent a sell limit order with a volume of 0.02. 

      2. by the time the open price of the sell limit order with a volume of 0.02 was reached, the funds were insufficient and the server deleted this order. 

       

      In the tester it looks like this:

       

       

      How to get rid of such warnings in the tester, and then the moderator does not miss the expert in the market?

      Or is it necessary to check the sufficiency of funds for pending orders in each tick and delete them yourself? 

      Well, check the sufficiency when approaching the order, for a couple of points. If there is not enough, then delete it.

      • 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 674
    • 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

    RobertFoeta

    RobertFoeta

    • 0 Questions
    • 0 Answers
    Brus Agell

    Brus Agell

    • 1 Question
    • 0 Answers
    pinupcasinoo

    pinupcasinoo

    • 1 Question
    • 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