Lot Multiplier Code.

 

Hello there,


I would like to incorporate a martingale esque lot multiplier system within my expert advisors. I'm a complete mql coding newbie and have some 'm5' files with source code which I would like to play around with.


How simple is it adding new code to pre existing advisors?


There is one 'anti martingale' function which I would like: Say I'm trading with 1 lot. Each loss I decrease the bet by a set amount of 'Lot'. e.g. 1.0, 0.75, 0.5, 0.25... Now, this is where it can get a bit complicated, after the fourth lot decrease I would like to start halving the bet, so: 0.25, 0.13, 0.06, 0.03... until the machine hits the bottom of 0.01 lots. 


I would also like a function whereby after the 4th lot DECREASE, I can set a function; proper martingale, where I double the bet. E.g. say I'm trading 1.0 lot with 100 point sl and 100 point tp on eurusd. so the stop values in dollar go like this: $100, $75, $50, $25. equates to -$200. SO then the machine either halves the fifth bet ect.. or starts doubling when I recalibrate the advisor.


Now, I know this might not be able to be fully automated and require some manual changing, But I am basically requesting from the community 2 sets of code; 


A lot decrease function in 'Lot value'.

A lot halving function or decrease/increase multiplier.


After each win, lot value resets to initial assigned lot value. 


Thanks for helping guys, thought I'd give it a shot here before using freelance. 

 

There are so many 'Martingales' search for them: https://www.mql5.com/en/search#!keyword=Martingale.

Filter for Articles and CodeBase I guess you'll find what you need.

 
william_chapman: I would like to incorporate a martingale esque lot multiplier system within my expert advisors.

Martingale is not a strategy. It's a betting system.

Hedging, grid trading, same as Martingale.
          Martingale, Hedging and Grid : MHG - General - MQL5 programming forum (2016)

Martingale, guaranteed to blow your account eventually. If your strategy is not profitable without, it is definitely not profitable with.
          Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum (2015)

Why it won't work:
          Calculate Loss from Lot Pips - MQL5 programming forum (2017)
          THIS Trading Strategy is a LIE... I took 100,000 TRADES with the Martingale Strategy - YouTube (2020)