- Logic Error - Please Help me..
- How to get AccountProfit of an specific time?
- Wishlist for future versions
count your current balance with your today profit
double todayprofit=0; datetime Openday= iTime(Symbol(),PERIOD_D1,0); for(int xx=OrdersHistoryTotal()-1;xx>=0;xx--) { if(!OrderSelect(xx,SELECT_BY_POS,MODE_HISTORY))continue; if(OrderCloseTime()<Openday)break; if(OrderType()<2)todayprofit+=OrderProfit()+OrderSwap()+OrderCommission(); }
farrokhfa: Is there any code, function or something which is able to return Account Balance of an specific time? For example at the beginning of the day. | Could EA Really Live By Order_History Alone? - MQL4 forum |
count your current balance with your today profit
I tried this, but it does not work for me...
Alert( "aaaaa1",TimeToStr(TimeCurrent()),AccountBalance() );
Print( "1Time=",TimeToStr(TimeCurrent()),AccountBalance() );
I see no alerts with my values in,
What I was trying to do is to display my balance on a tick by tick where the current price of the instrument is printed at the top left of my screen...
GBPUSD,M15 1.15234 1.15756 1.52013 1.152320
}
my last transactions has done on ' '2024-02-27 '
use the code above to calculate Account Balance At The Beginnig of Day
-
Why did you post your MT5 code in the MT4 forum?
-
Do you really expect that people are still watching this thread after nine (9) years?
Don't resurrect old threads without a very good reason. A lot has changed since Build 600 and Higher. (2014) -
Total Profit is OrderProfit() + OrderSwap() + OrderCommission(). Some brokers don't use the Commission/Swap fields. Instead, they add balance entries. (Maybe related to Government required accounting/tax laws.)
"balance" orders in account history - Day Trading Techniques - MQL4 programming forum (2017)Broker History FXCM Commission - «TICKET»
Rollover - «TICKET»? >R/O - 1,000 EUR/USD @0.52 ? #«ticket» N/A OANDA Balance update
Financing (Swap: One entry for all open orders.)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use