Forum

Maximum amount of open orders in one time

Hello guys. I would like to know maximum amount of open orders in one time when backtasting some strategy. And sum of lot size of those opened orders should be helpful aswell. I managed to create calculatior of currently opened orders, but I do not know how to store the highest value and highest

Counting profit for all open BUY / SELL orders

Hello guys. Iam trying to count current profit for all buy/ sell open orders. I got so far: double CheckBuyProfit(){ double profit=OrderProfit() + OrderSwap() + OrderCommission(); if ( OrdersTotal ()> 0 ){ for ( int i = 0 ; i < OrdersTotal () ; i++ ) { if (

Increasing lot size when current order is in negative profit.

Hello guys. Iam trying to achieve increasing lot size for future order (long or short) when current order (long or short) is in negtavie profit. There can be maximum of two current orders in the same time. I've got so far: double LotSize= 0.01 ; bool CanOpenBuy= true ; bool CanOpenSell= true ; void

Do not trade current candle again after reaching stoploss level

Hello guys, Iam pretty new to this MQL5 coding, but I manage to make my own EA in last 3 days and it seems to be working very well. Iam now fixing some issues to improve the EA. My problem is that when is one trade closed by stoploss then alogirthm open new trade in current cadle (if coditions