Hi,
Is there an EA that limits the net open position? For example, say I set a max lot size for eurusd to be limited to 1 lot. I go long 0.5 eurusd and next time I go long 0.6 it blocks the trade since 1.1 breaches the limit of 1. But if I go short 1.1 lot, net position becomes -0.6 so that trade goes through.
Thanks!
- One position has two deals, how to close one of them?
- Firebird EA
- Maximum allowed lot size limit
secondary:
Hi,
Hi,
Is there an EA that limits the net open position? For example, say I set a max lot size for eurusd to be limited to 1 lot. I go long 0.5 eurusd and next time I go long 0.6 it blocks the trade since 1.1 breaches the limit of 1. But if I go short 1.1 lot, net position becomes -0.6 so that trade goes through.
Thanks!
You can use PositionsGetTotal() to loop through existing positions and check their symbol to add up each symbol's open position(s') lot size; then compare with your limit before sending new orders for same symbol.
you can also create your own trading panel that adheres to this rule and add it to the default template .
You would need to manually trade via that however (to open trades)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register