
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
now it doesn't divide the lot
Why do you divide the lot and then multiply it by 2?
Sorry it's an error when i paste the code , still have the same problem
micoul81: Sorry it's an error when i paste the code , still have the same problem
Sorry it's an error when i paste the code , still have the same problem
Hello micould81,
did you manage to fix your code? could you let me know where and how you implemented your PartClose function in the main EA? I have tried but I cannot managed to get the EA to loop in and through the partClose function?
thanks
Hello micould81,
did you manage to fix your code? could you let me know where and how you implemented your PartClose function in the main EA? I have tried but I cannot managed to get the EA to loop in and through the partClose function?
thanks
You could also try following the suggestions here, go through your code and try to see in yours something similar is happening, and try to correct it as WHRoeder and GumRai are telling micould81 to do. I know your code is not likely to be exactly the same, but it is a starting point. Then, if you are able to fix your code, you could also post a before and after here, so people can see what was wrong, and what you did to fix it.
JD4,
I have tried several approach mostly based on the work of Mr. Hopwood. the problem is that the PartClose function doesn t get call so I have tried micould81 approach, keeping the start() as it is now, and same issue, that is the reason of my question, where should i put the call for the partClose function. As it stands atm.
I am still in the process of learning how to code in MQL, so while I can recommend something on my similar class knowledge of Java, it is likely to be bad information, so I am sometimes leery to share unless I know for sure. Judging by what little snippet of code you posted here (good function names btw), if it were me, I would have the PartClose get called from within your LookForTradeClosure function, as it would seem to be the most likely place you would have the code to decide if you wanted to close part of your trade.
Another possibility I have seen other people use, but this could offset any profits depending on your broker's pricing structure, is open multiple trades at the same time. And if certain points are hit, close out 1 or more of the individual trades.