Todays Net Profit
Todays Net Profit
17 Sep 2018, 19:59
Hi,
I wrote code for showing some info on chart and I want to show todays total net profit. Can anybody help ?
Replies
iForex2015
18 Sep 2018, 18:16
Hi ,
Yes, I need help to calculate todays profit. For example I have this code for history net profit
var history = History.Where(t => t.SymbolCode == Symbol.Code);
var historyProfit = (int)(history.Sum(t => t.NetProfit));
and I want to show net profit between a particular time (system time) something like this ?
var profitToday = History.Where(t => t.SymbolCode == Symbol.Code && t.ClosedDate.Date == DateTime.Now.Date).Sum(t => t.NetProfit);
Thanks
@iForex2015
PanagiotisCharalampous
19 Sep 2018, 10:43
Hi,
You can try something like this
var profitToday = History.Where(t => t.SymbolCode == Symbol.Code && t.ClosingTime.Year == DateTime.Now.Year && t.ClosingTime.DayOfYear == DateTime.Now.DayOfYear).Sum(t => t.NetProfit);
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Sep 2018, 09:20
Hi,
What kind of help do you need? Calculating today's net profit?
Best Regards,
Panagiotis
@PanagiotisCharalampous