I am very grateful for the indication on how to implement a good portfolio management, I did it in a basic way and I have checked Amibroker's superb power.
Not long ago I have programmed this powerful tool and there are things I still do not know, but I recognize a wide range of possibilities.
I have a question that you, surely, can guide me to solve it.
When I set out a maximum trade risk (i.e. 2%), and equity is still small, the loss for that reason is still tolerable.
But when equity increases, although the relative proportion (%) stays, the absolute value is very important, producing big drawdowns and, moreover, I think that they can be avoidable.
I think it would be good to introduce comparisons to the formulas, that if the losses of a trade exceed an absolute large amount (this is a personal estimate), even if it has not exceeded the maximum % risk trade, close your operation.
It would be good to limit the losses caused by a night or day GAP that would skip the stoploss, for example, or simply limit even more current losses when a trade does not work well, without having to reach the necessarily established limit.
It could be of the following style:
If trade loss <2% and trade loss> $ absolute amount, Exit or close the trade.
But I have not found the way to express it in AFL, which can surely be implemented if you can access the loss of the specific trade.
I repeat, thank you for your attention and forgive me for my failure to express the previous problem correctly.