int ProfitTarget = 1000; double TotalProfit=0; { for(int q = 0; q<OrdersHistoryTotal(); q++) { OrderSelect(q,SELECT_BY_POS,MODE_HISTORY); if(OrderCloseTime()>TimeCurrent()-86400) { TotalProfit=TotalProfit+OrderProfit(); } } Print(" Daily Profit: "+ProfitTarget-TotalProfit); }
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
I'm trying to write a code that will make a "Profit Target" which will subtract my profits in the past 24 hours and add my losses. But I think there is something wrong, can anyone help?