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
Here is one of my functions that I have modified slightly so it should do as you want.
I have not tested it after modifying it
im using a binary plugin on mt4 (clmforex) and every closed trade gives always profit 0, if its a winner/loser it does it by the balance.
is tried to solve it by the balance, but there is the problem to filter for different symbols... its maybe possible by writing an ea per tf and currencypair.
ive seen that its posting a comment to every closed order if its profitable or not.
when a trade is closed there is 0 profit, and on the new line the profit is shown by the balance.
is there a way to loop through the comments of closed orders with OrderComment(); like:
thanks for your help :)
hi guys, today i tried the following code, seems to work, keep you up to date how its performing :)
hey guys, optimazed little bit, works now pretty good, thanks for your help :)
optimized a little bit, works now pretty good, but the print part at the end is always executed 6 times... why that? do i have to add a break or continue? thanks for your response :)
i tried by putting the break after the first lost order was found, but seems that the Dailyprofit and Totalprofit is not counting correctly... I also noticed that when lot5 is used it doesnt reset losses to 0, it counts up, why that?
in the documentation is written, that i can set a break and then store the values for the variables like losses etc. but when i put the break on top of the loop it doenst work.
can somone help? thanks in advance :)
optimized a little bit, works now pretty good, but the print part at the end is always executed 6 times... why that? do i have to add a break or continue? thanks for your response :)
if (losses == 2) Mylot =Lot3; Print(EAName,">>> Last Order:", last_order_symbol," Losses=",losses);
hello,
the cause for your issues here are some syntax "errors"; in the line above, you have forgot the braces, e.g. your if ends at "Mylot=Lot3;", after that Print() is executed; on the next line, if is checked (as it is supposed to do) but again the next Print() is executed and so on.
Tip: in C you can put commas (,) to group your expressions, but it does not happen in MQL
Back OT, I assume you latest comment has the same syntax issues, but i am not really sure, as all the source code appears in one big line (at least in my browser) and as such i am not in position to tell what happens
best regards