Help With My EA

 

I keep getting this no money(error 134) Error when the strategy tester tries to Test the Ea on 1m timeframe ?

test on EURUSD,H1 (netting)
strategy tester report 21 total trades
test on XAUUSD,D1 (netting)
strategy tester report 16 total trades
test on GBPUSD,M30 (netting)
strategy tester report 9 total trades
test on EURUSD,M1 (netting)
 2021.04.01 17:53:00   current account state: Balance: 1.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 0.00, FreeMargin: 1.00
 2021.04.01 17:53:00   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 235.28, FreeMargin: -234.28
 2021.04.01 17:53:00   not enough money [instant buy 0.2 EURUSD at 1.17640]
 2021.04.01 17:53:00   failed instant buy 0.2 EURUSD at 1.17640 [No money]
 2021.04.01 17:53:20   current account state: Balance: 1.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 0.00, FreeMargin: 1.00
 2021.04.01 17:53:20   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 235.30, FreeMargin: -234.30
 2021.04.01 17:53:20   not enough money [instant buy 0.2 EURUSD at 1.17650]
 2021.04.01 17:53:20   failed instant buy 0.2 EURUSD at 1.17650 [No money]
 2021.04.01 17:53:40   current account state: Balance: 1.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 0.00, FreeMargin: 1.00
 2021.04.01 17:53:40   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 235.23, FreeMargin: -234.23
 2021.04.01 17:53:40   not enough money [instant buy 0.2 EURUSD at 1.17615]
 2021.04.01 17:53:40   failed instant buy 0.2 EURUSD at 1.17615 [No money]
 2021.04.01 17:53:59   current account state: Balance: 1.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 0.00, FreeMargin: 1.00
 2021.04.01 17:53:59   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 235.27, FreeMargin: -234.27
 2021.04.01 17:53:59   not enough money [instant buy 0.2 EURUSD at 1.17634]
 2021.04.01 17:53:59   failed instant buy 0.2 EURUSD at 1.17634 [No money]
 2021.04.02 15:38:00   current account state: Balance: 1.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 0.00, FreeMargin: 1.00
 2021.04.02 15:38:00   calculated account state: Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 235.63, FreeMargin: -234.63
 2021.04.02 15:38:00   not enough money [instant buy 0.2 EURUSD at 1.17814]
 2021.04.02 15:38:00   failed instant buy 0.2 EURUSD at 1.17814 [No money]
 2021.04.02 15:38:20   current account state: Balance: 1.00, Credit: 0.00, Commission: 0.00, Accumulated: 0.00, Assets: 0.00, Liabilities: 0.00, Equity 1.00, Margin: 0.00, FreeMargin: 1.00
there are no trading operations
 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 

Obviously your EA is not properly calculating the volume correctly to account for margin requirements and available balance.

It even indicates that in the report with a negative value for the Free Margin.

Read and apply the following please ...

Articles

The checks a trading robot must pass before publication in the Market

MetaQuotes, 2016.08.01 09:30

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
Fernando Carreiro #:

Obviously your EA is not properly calculating the volume correctly to account for margin requirements and available balance.

It even indicates that in the report with a negative value for the Free Margin.

Read and apply the following please ...

Tried everything the issue still there ! i even tried a upload the same code that worked before but still get that issue ?

 
Moustapha Boulouz #: Tried everything the issue still there ! i even tried a upload the same code that worked before but still get that issue ?

I repeat ... "obviously your EA is not properly calculating the volume correctly to account for margin requirements and available balance. It even indicates that in the report with a negative value for the Free Margin."

Calculate your margin requirements and compare it with the available free margin before placing an order.

OrderCalcMargin

Calculates the margin required for the specified order type, in the deposit currency

 
Comments that do not relate to this topic, have been moved to "Off-topic MT4/mql4 questions.".
Off-topic MT4/mql4 questions.
Off-topic MT4/mql4 questions.
  • 2023.08.30
  • www.mql5.com
I apologise for digressing from the main topic of the forum. I want to write a program, but I don't know where to start...
Reason: