How to terminate EA if target Equity is reached?
-
Dear fxdreema,
Can you give me a clue or template Please, if I would like my EA to self terminate when target equity is reached?
Let say If I start my EA with $1000 and then in a week My equity is increased to $500, then EA should terminate herself.Thank You
-
There is a block "Terminate" (in the lowest category) which will cause the EA to seld-terminate. I think that checking equity is pretty easy with "Condition". It depends on how you want to set this $1000 value - you can manually set it or it can be the balance at the moment when the EA starts to work. Then for which equity we are talking about - the main equity (or profit) of the account or what is generated from all the trades created by the same EA.
-
__There is a block "Terminate" (in the lowest category) which will cause the EA to seld-terminate. I think that checking equity is pretty easy with "Condition". It depends on how you want to set this $1000 value - you can manually set it or it can be the balance at the moment when the EA starts to work. Then for which equity we are talking about - the main equity (or profit) of the account or what is generated from all the trades created by the same EA.[/quote:3asvd6bz]
Thank You very much, I will try and let you know a.s.a.p
-
Dear fxdreema,
Is it true like this?
Or do you have any other template?https://fxdreema.com/shared/fOTr3Rc4e
PS: I just tried and it didn't work
Thanks -
On the left side you have the current unrealized Profit, which is Equity minus Balance and this is only if there is a trade currently opened. This profit is the current result of the currently opened trade/s. If no trades are opened Equity is equal to Balance.
On the right side you have the Initial balance. Compare Equity or Balance with it, not the current unrealized profit.
-
This is working and EA terminated when equity increases to $50
https://fxdreema.com/shared/bcOIe7RUdBut Can you help me how to set this +50 into formula and variable so that I can change it anytime I want in the input parameter, instead of change it in the meta trader editor. I am new to this and still cannot find any clue at all.
And I have been trying so many time but it didn't worked out
Thank youPS: fxdreema is the best EA builder I've ever known. I mean it
-
-
__https://fxdreema.com/help/-/working%20with%20fxdreema/constants%20and%20variables
https://fxdreema.com/demo/mt4-variables[/quote:27tvzfft]Thank you so much
I will check it out and hope I can understand...
Your prompt response is damn fast on the weekend
Sorry to bother you
happy weekend -
Dear Fxdreema,
I found some critical error on my EA, do you know why?
At first she ran well but then I got some message of errorhttps://fxdreema.com/shared/NRJwRZrye
......
fxdreema error.png -
It should be fixed
-
When will you fix it?
I still found the error and EA stops suddenly during BTThanks
-
Yes, I was thinking about another problem. This one is still there and I am investigating it now. It will be fixed eventually.
-
This problem is from the function which is responsible to delete the second OCO pending order when the first one is opened. And normally everything works fine, but in your situation this problem follows another problem. Because you use big lot size, when one of the pending orders is reached, it can't be opened. Instead, it is deleted but for some reason it still can be selected with OrderSelect() in MQL4. That's why this error appears. Before OrderDelete() there is OrderSelect(), but OrderSelect() successfully selects the ticket and then OrderDelete() fails to delete it.
And I'm not sure what to do in this situation. That pending order is not opened as it was expected and because ot that the strategy fails. The error that follows does not allow the EA to continue working, but this is probably better, because do you need such broken EA to continue working?
Even if I mute this error, what to do with this faulty pending order, this is my question?
For trades, if you request such a big lot size, the EA just calculates the biggest possible lot size and uses it, but pending orders are opened on the server. -
Ok Thank You
maybe I should find out any other strategy instead
thank you again -
Actually My strategy is simple and it was working well on previous version of fxdreema.
Just now I tried to make sure that it is working or not and it is not.
Let say, if I open buy sell at the same time, and one of the trades that is going against us will be backed up by Pending stop order at certain point in reverse direction.
it used to work well but now I can do nothing
I was wondering if the off line version is still remain the same as before or you have updated too..
Please let me know, if you can send me a copy of previous version of that offline version that allow me to work with my strategythank you
fxforgood -
I only added the newest MQL compilers in built 100, but all blocks are old.
The last things I did was to enable Strict mode and fix many small issues here and there. As a result at least 2 unexpected problems were reported and in both cases everything worked if I disable Strict mode (remove #property strict). But I tested your idea with and without Strict mode and it failed in both cases, so now I believe that at least I didn't introduced a new problem. Whatever it is, it is old I think. And the problem appears in one function that should close OCO pending orders (when one of them closes => close the other one). And it normally works, but not when one of the orders failed to open because of too big lot size. At least this is what I found to be the problem. I test with initial $1000 dollars and 1 lot appears to be too big.
So.. do you see the same thing on your side? Do you have pending order deleted because it's lot is too big, or I am looking at something else?
-
https://fxdreema.com/shared/CDXjkVAK
Based on that project,
I tried to use 0.1 lot for initial balance of $100,000
there is still an issue of error
but when I turn off the group block of pending order EA runs no problem.
maybe you could fix it cause I could possibly do any wrong perception in developing this project, or maybe you have an alternative to make it through...thank you againBelow is working well but this is not like what I expected
-
this one is doable
-
Now the problem is totally different and is here http://prntscr.com/9e7kty
http://i.imgur.com/dUSTLUa.png