Code flexible money management

 

Hello everyone, 

Can somebody help with this request: I want to change the % risk at each trade from 1 to 5% for example and back to 1% or the half of the last %risk following the winning rows and losing rows.
like first winning 1%, second 2% till 5. If loser I will decrease by the half of the last %risk or simply back to 1% to begin afresh.

How can I code it?

 
Help you with what? You haven't stated a problem, you stated a want.
You have only four choices:
  1. Search for it,
  2. Beg at Will code your trading systems for free - Free Expert Advisors - Trading Systems - MQL5 programming forum, or Coding help - MQL4 and MetaTrader 4 - MQL4 programming forum, or Need help with coding - General - MQL5 programming forum, or Free MQL4 To MQL5 Converter - General - MQL5 programming forum, or Requests & Ideas (MQL5 only!).
  3. learn to code it. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
  4. or pay (Freelance) someone to code it.
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help
          urgent help.
Reason: