OrderSendResult

 

Hello, i can't make an request with TRADE_ACTION_DEAL in Python.

In AccountInfo my balance is 2000.0 and when I want to make a trade, in comment says No money and i don t know why.

The account is demo from [broker name redacted] and recently I ran out of money on my account.

Can anybody help me ?

 

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

 
preunkb: Hello, i can't make an request with TRADE_ACTION_DEAL in Python. In AccountInfo my balance is 2000.0 and when I want to make a trade, in comment says No money and i don t know why. The account is demo from [broker name redacted] and recently I ran out of money on my account. Can anybody help me ?

You must properly calculate your volume (lots) so as not to exceed the required margin.

In fact you should be calculating it primarily based on the risk or stop-loss size and the margin only in a secondary condition.

order_calc_margin

Return margin in the account currency to perform a specified trading operation

order_calc_profit

Return profit in the account currency for a specified trading operation

Documentation on MQL5: Python Integration / order_calc_margin
Documentation on MQL5: Python Integration / order_calc_margin
  • www.mql5.com
order_calc_margin - Python Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5