Hi, I Hope somebody can help
-
Im trying to create an EA for MT4. My goal is to buy and sell at the same time, with each trade set for a 10 pip tp. Once either one is hit I want another buy and sell open at that price. same as the next tp and next tp.
Also need help figuring out how to close all positions once daily equity target has been hit. Would appreciate any help at all -
There you go: http://fxdreema.com/shared/r5wg6gZtc
Convert it to MQL4 so you will have a better understanding of each block.
-
Thank You very much. I will try it out. That was a super quick response. Appreciate it
-
You're welcome!
'ON_OFF_Switch' has to be a variable instead of a constant. My fault!
-
It wouldnt open any positions. Have I made a mistake shared/zBGIbeHR
-
-
@cpt_cook Add 'On_Off_Switch' variable (blue-boxed instead of orange-boxed) wherever it is being used.
-
Brilliant thank you. The only thing is that it doesn't open a new buy and sell when one of the positions hits take profit
-
Are you sure? It has to.
Just download this project and import it into your account: http://fxdreema.com/shared/wkMBR4cme

-
@tpt is there any smart way to make it cover the spred?
in my strategy tester backtest it looks like its slowly losing becouse of the spred, would be interesting to get it break even -
@tho401 I'm not sure exactly. Do you mean covering the spread by extending the take-profit price to 10pips + the spread size?
-
@tpt yes, but that woul bring some risk too.
making such a EA break enen (plus minus zero) would make it valuable for Rebate trading, if the brokerage pays back 4$ - 8$ rebate per standart lot. It would Generate spreads/Turnover, from which the brokerage pays you back 60-80%
i guess its impossible to cover the spread risk free, it would involve risk no matter how its attempted.
-
@tpt Thats amazing. Risky but really good. Thank you very much. I was expecting about 50 blocks to make that.
-
@tpt See the idea behind it is having 1 buy and one sell. if for example the buy hits its 10 pips TP its opens another buy and sell. Then imagine in this scenerio the price comes back to where the first trades were bought. The EA closed all positions because we have hit our equity daily target.
For example;
1rst Buy/Sell
Buy 10pip profit/Sell broke even
2nd Buy/Sell
Buy 10 pip loss and sell 10 pip profitSo we still come out at ten pips. Even if the second buy take profit gets hit then the price falls back to the second trade levels we still have a 10 pip profit and all trades close automatically.
I know trades trade may keep going up in price but if it mostly bounces back eventually. I've been doing this manually and 9 times out of 10 its profitable but a lot of effort for 10 pips. Can you help adjust or is this eactly what the EA is doing?
-
@cpt_cook Yes, that's exactly what the EA does.
The technique you refer to is called grid trading. Google it and you'll find a bunch of useful information.