Cromo:
Hi, I use below code to check daily profit. I will stop EA when daily profit reached to the target.
But when I first time attach the EA on the chart and check the daily profit value, it shows account equity.
I wonder why...
It should be zero when I attach the EA for the first time.
Where do you print the value?
Keith Watford:
Where do you print the value?
HI, I just print as comment.
Comment ("daily_profit="+daily_profit())
But why it shows equity?
Cromo:
HI, I just print as comment.
But why it shows equity?
I don't see how it can show the equity.
Search in your code for another Comment() that may be overwriting it.
Why you cycle two times orders?
The second cycle is wrong, daily profits are generated from order that has OrderCloseTime >= today, not the open time.
You are counting two times profits of order opened today and one time orders opened before today.
Be sure of history period selected in your MT4 platoform, ordershistorytotal loads orders from it.
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
Hi, I use below code to check daily profit. I will stop EA when daily profit reached to the target.
But when I first time attach the EA on the chart and check the daily profit value, it shows account equity.
I wonder why...
It should be zero when I attach the EA for the first time.