Beggining to create an EA, need some help.
-
Hello guys
Im having trouble on how to start building this EA. In fact what I need the EA to do is:
1 - I will open a trade manually such a buy with 0.01 lots. For example EURUSD at 1.3250
2 - The EA will set the TP to 20pips and SL to 40pips.
3 - Once the trade is open and TP and SL are defined, the EA must put a Sell stop order (pending) with 0.03 lots at 1.3230 with 20pips on TP and 40pips on SL.
4 - If the price goes down and activate the pending order, the EA must put a Buy Stop order (pending) with 0.06 lots at 1.3250, and again with 20pips on TP and 40pips on SL.
5 - This will go on untill TP and SL are hit.The lots are going to double from the last pending order. Except the first pending order that will have 3x the lot size of the trade I manually open.
Don't know if I was clear enough
Can someone help me through this?
Thanks -
I did this EA several years ago and on paper it seems like a very good idea but it ended up failing. It failed when it got into a channel that stayed flat, so it kept opening orders with progressive lot sizes until margin ran out. I don't mean to spoil your idea, just giving you a warning. I have seen commercial ea's on mql5 that do the same thing.
I did a number of adjustments including widening the channel, progressing the lot sizes slower etc. I got it to work but could never get the death bugs out of it.
-
@line Thanks for your reply!
Glad to know you've tested it before. You're absolutely right about the problems involving such EA. I'm not gonna use it on live account, otherwise it will blast my account. Just tryin' on a demo. And I wanna try to modificate some settings to use it at specific times of the day.
Any chance you still have that EA you developed? If you have it I'll be pleased if you can send me to try it!
-
@vitormdt this strategy is what I have been battling with for some time now but could not get the coding... because I was not a programmer....
-
I am making sure I understand your project. Here is what I did, I set up 2 lines, if the price hit the top line (a buy) then it would look for a take profit. If the price did not hit the black line, then a sell order was placed at a higher lot size, for example 1.5x the buy.
If that buy/sell did not meet the take profit and price returned back to the black line, then another buy was issued with 1.5x the sell lot. Keep repeating until take profit is hit.

-
@vitormdt said in Beggining to create an EA, need some help.:
@line Thanks for your reply!
Glad to know you've tested it before. You're absolutely right about the problems involving such EA. I'm not gonna use it on live account, otherwise it will blast my account. Just tryin' on a demo. And I wanna try to modificate some settings to use it at specific times of the day.
Any chance you still have that EA you developed? If you have it I'll be pleased if you can send me to try it!
I am also interested. Could you please share your demo project?
-
That was some time ago, let me see if it is in my backup. It was written 5 years ago which probably means it cannot be used today since Metatrader changed their format.
The problem with any progression lot size ea is that there is no place to get out unless you complete the cycle. If you get out in the middle, you have incurred a potentially large loss.
-
Check this: https://fxdreema.com/builder/shared/2fi7fHKsc
-
Interesting. Thank you very much.