Not able to buy or sale when testing my code.

 

I'm trying to test my code but I keep getting the below errors/messages which prevents me from buying or selling. Thoughts?

2017.05.08 08:46:29.749    2017.04.02 21:08:59   current account state: Balance: 10000.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 10000.00, Margin: 0.00, FreeMargin: 10000.00
2017.05.08 08:46:29.749    2017.04.02 21:08:59   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 10000.00, Margin: 10662.00, FreeMargin: -662.00
2017.05.08 08:46:29.749    2017.04.02 21:08:59   not enough money [market sell 0.10 EURUSD]
2017.05.08 08:46:29.749    2017.04.02 21:08:59   Order send sell failed with error: 4756

 
flwilliams87:

I'm trying to test my code but I keep getting the below errors/messages which prevents me from buying or selling. Thoughts?

2017.05.08 08:46:29.749    2017.04.02 21:08:59   current account state: Balance: 10000.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 10000.00, Margin: 0.00, FreeMargin: 10000.00
2017.05.08 08:46:29.749    2017.04.02 21:08:59   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 10000.00, Margin: 10662.00, FreeMargin: -662.00
2017.05.08 08:46:29.749    2017.04.02 21:08:59   not enough money [market sell 0.10 EURUSD]
2017.05.08 08:46:29.749    2017.04.02 21:08:59   Order send sell failed with error: 4756


I'm new to this forum but I think it's always useful to include the code of your EA

 

Your FreeMargin -662.00 is less than your broker allowed.

You have two options : up you equity or your leverage.

Anybody kwows how can I match 'calculated account state : Assets' or my broker requirements with code ?

 
Xesan:

Your FreeMargin -662.00 is less than your broker allowed.

You have two options : up you equity or your leverage.

Anybody kwows how can I match 'calculated account state : Assets' or my broker requirements with code ?

This is my answer :

https://www.mql5.com/en/articles/22

Limitations and Verifications in Expert Advisors
Limitations and Verifications in Expert Advisors
  • www.mql5.com
When creating an algorithm for automated trading you should be able not only to process the prices for making trade signals, but to be able to get a lot of auxiliary information about limitations imposed on the operation of Expert Advisors. This article will tell you how to: Get information about trading sessions; Check if you have enough...
 

With 1:1 leverage you need $100'000 to open 1 lot on a forex pairs with USD as base currency.

As already suggest, you need to increase your balance or your leverage.

 

OP posted in May 2017.

I guess that he might have lost interest by now.

 
Keith Watford:

OP posted in May 2017.

I guess that he might have lost interest by now.

You are totally right, I found in the latest topics due to answer before mine and I though was actual... I don't checked the open date