Thank you Roberto, thank you very much.
I just got around to looking at your code today, but unfortunately it doesn’t do what it’s supposed to.
It’s up to me to make it understandable to you what the code is supposed to do.
So I’ll try it one more time, one last time, to bring in calm.
The code should check after a trade if the capital is higher or lower than the ever reached maximum level of the capital.
If so,
we set the now reached (new) maximum level of the Capital as the new ever reached maximum level of the Capital (as a basis for calculation) and
we continue the trade with lot size = 1
If no,
we calculate the lot size in such a way that when the take profit of the trade is reached, the ever reached maximum level of the capital increases by 1%. Because of the timestop, we will rarely reach the takeprofit of the trade, no problem. But if it is, all previous losses will be compensated and the capital will increase to 101%.