How to gat AccountBalance of an specific time?

Back to topics list To post a new topic, please log in or register
avatar
27
farrokhfa 2014.05.17 13:20
 
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.
avatar
56
WDholic 2014.05.17 13:56 #
 

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(); 
 }  
 

avatar
12985
WHRoeder 2014.05.18 15:52 #
 
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
avatar
3
awkWard 2015.05.10 23:53 #
 
WDholic:

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 

Back to topics list  

To add comments, please log in or register