Is there an EA that caps the open lot size for a given symbol?

 
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!
 
secondary:
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)