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
Thanx guys for helping. I think I could solve the problem. I have merged the conditions of closed order profit into one. After closing (trigger or SL,TP) the code will check the last closed order. And this checking is independent from the closing criteria.
Conditions: liveorder=false: no running trade ; last_profit=false: profit of closed trade did not get earlier ;
The first closed trade (magic number, symbol) is the trade what I want to get, so with OrderProfit I will get what I am looking for.
Thx for hint (conditions, loop, decrement loop etc.)!
I have another problem. I don't want to start for this a new topic, I share here:
I want to open(create) a file for writing & reading, but it doesn't work
I get always errorcode. What could be wrong?
filename=terminal_data_path+"\\MQL4\\Files\\"+filename_temp;
Ty WHRoeder!
I used search, but this topic what you have linked I did not find. Thats why I asked. Btw thx for help.
I am confused. What could be wrong with file write?
total_profit is double. It's writing something out, I see 8 bytes filelength. It's recomended to close file after each write and read? Or could be stay opened?
if I don't use:
but:
FileWriteDouble(filehandle,total_profit,DOUBLE_VALUE);
It's working.
total_profit is double. It's writing something out, I see 8 bytes filelength. It's recomended to close file after each write and read? Or could be stay opened?
Ty, from your answer the 3nd I did not know. In first version I have kept open and I got 16 bytes. If I read it back got wrong result. Now I close it after each write and as you wrote I got a rewrited file. Thats what I want.
WHRoeder I like to ask something about indicators crossing. Example: moving average. How can I avoid the off-key crossing? Sometimes the indicators are crossing each other but after the candle closing I see no crossing. If my EA under the candle time after "crossing" take a trade, it could be off-key after the candle closing. I hope it is understandable. As I am thinking in my EA I will check the 0. and the 1st shifted indicators if I want to get the crossing. But this thinking leads sometimes off-key crossing. Could you please help me?