How To Double The Lot Size Until A Pos. With Profit
-
Hello guys,
I’d like to add a rule to my bot that if there are 3 consecutive losing positions, the bot will open the next (4th) position with double the lot size until a position closes with a profit. Once a position closes with a profit, the bot will revert to opening orders with the initial fixed lot size.
For example, let’s say the fixed lot size is 1. If there are 3 consecutive losing orders, the bot will open the 4th order with 2 lots. If the 4th order also closes with a loss, the bot will open the 5th order again with 2 lots. Finally, if the 5th order closes with a profit, the bot will open the 6th position with 1 lot again.Is that possible? If yes, how can I write it?
Regards,
Engin T. -
Not sure I fully understand the initial premise. Do you mean three simultanous open trades to be in loss right now? Or maybe three confirmed closed trades, all of them in loss?
-
@l-andorrà said in How To Double The Lot Size Until A Pos. With Profit:
Not sure I fully understand the initial premise. Do you mean three simultanous open trades to be in loss right now? Or maybe three confirmed closed trades, all of them in loss?
Thank you for your feedback. I mean “3 confirmed closed trades, all of them in loss... Let’s say there is no open/active trade at the time, however, the last 3 consecutive orders closed in loss in a row. So, bot will open the next trade with the lot size 2 until there’s a closed position which is in profit. Once there is a closed position in profit, the lot size will be 1 again. So, in the future, if there are 3 consecutive orders closed in loss in a row again, the scenario will repeat as above.
For example, as you can see attached, once the order number 10 closes in loss, there will now be 3 consecutive orders closed in loss in a row. So, the lot size of the order number 11 will be 2. And in this case, the order number 11 closes in loss too. So similarly, the lot size of the order number 12 will be 2 as well. But, since the order number 12 closes in profit, the next order which is number 13 has the lot size 1. After that, since there is no 3 consecutive orders in loss yet, the lot size of the every next order is 1. (but if there are 3 orders closed in loss in a row again in the future, the same lot size logic will continue like above)
ss2 -
Hi @l-andorrà. So is it possible; how can I write it? Have a nice day...
Regards...
-
@allstarengin Then you need something like this:

That variable will have to be used on your 'buy/sell now' blocks. Another similar structure for profits willhave to be created to move the value of the lot size to its initial value.
-
@l-andorrà Thank you very very much
Ill try it
Have a good day... Regards... -
@allstarengin You're welcome.