Hello David, did you find a solution ?
David Baird: Attached is the .mq4 codefile for a grid system EA.
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)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Attached is the .mq4 codefile for a grid system EA.
Under certain market conditions and with certain settings this EA is net profitable... as long as you keep a constant eye on it and limit its total positions to (for example) 30 by turning it off when the sum of its open positions and pending stop orders reaches 30. Then you have to wait until all the TP and SL points are reached at either the top or the bottom of the grid... take the profit/loss... and then turn the EA back on again to start a new "cycle". Using this methodology the EA returns a net profit... incurring very few losses... which are mostly small.
However, this method defeats the object of auto-trading... one has to watch the EA constantly whilst it is in use... and manually perform the task of limiting the orders total... and then reset the EA after each cycle. I'm virtually tied to my desk when the EA is running! Hardly auto-trading is it?
Left to its own devices the EA can (in certain instances) open up so many positions that it creates a margin call... and wipes my equity (or a fair chunk of it) out. Manually limiting the positions/pending orders prevents this... but I want the EA to "self-limit" itself. Just to be clear... this is not an issue regarding lot size against equity... the grid starts with the minimum lot size my broker will allow... 0.01. The issue is that the grid could (given the right market conditions) open literally hundreds of positions before reaching any "conclusion". It's always the total margin which becomes problematic... not the ensuing profit/loss of the total positions.
Can any bright spark out there assist me by adding a little code to the EA which would enable any user to define a limit for the number of pending orders (or open positions) the EA can commit to?
This would enable the EA to run fully automatically without the risk of cleaning me out... and make me a small net profit return.
I'm happy to define the limit variable inside the codefile itself if necessary... and then compile the .ex4 file... but an input parameter in the EA's "control box" would be a real bonus if that's not too much hassle.
I have tried to do this myself... but I keep getting error messages on debug. I've also tried using a script... but even if that worked I'd still have to load it to the chart again and again manually.
I'm just not at a programming level where I can get this limiting issue resolved inside the EA itself. Can anyone out there assist me by appending some code please?
Many thanks in advance if you can.
David