it tries to copy the closed orders profits into an array and use it further for grossloss, grossprofit , winrate , totaltrades , pf . it doesn't show anything today. yesterday worked fine.
- The script creates the objects in OnStart. Script then exits and deletes them in OnDeinit. You shouldn't see anything, ever.
for (i=0;i<=ordershistory;i++) { ticket=OrderSelect(i,SELECT_BY_POS,MODE_HISTORY );
OrderSelect does not return a ticket. The last iteration will always fail. Check your return codes for errors, report them. Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.

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
it's a script that shows statistics of the account in some text labels. it's not working although yesterday worked when i made it. it seems that somehow it doesn't reach the objectsettext command . deinit also not working. objectcreate works. this script compiles without errors. that's my problem.