Hello, Any expert could give me the light of how I can sum up total loss/profit of certain day on MT4 ?
thanks
thanks
Grid EA with Stop Loss and Total Basket Profit? 4 replies
Loss calculation does not match loss in backtesting MT4 - why? 6 replies
Where can I find this indicator "loss and repaint"? 2 replies
Where can I find a Breakeven Stop loss EA? 5 replies
How can I find These Values inorder to find resistance and support levels 2 replies
extern string date = "2011.3.1 00:00";
Period: 2012.06.10 23:44 - 2012.07.18 13:48 StartBalance = 1288.25, Gain = 27.95%, MaxDrawDown = 0.01 Monthly Gain: 2012 June 13.68% 2012 July 12.56% Daily Gain: 2012.06.11 0.58% 0.58% 2012.06.14 0.53% 1.11% 2012.06.15 1.36% 2.49% 2012.06.17 0.45% 2.96% 2012.06.18 0.87% 3.85% 2012.06.19 0.26% 4.12% 2012.06.20 0.87% 5.03% 2012.06.21 0.24% 5.29% 2012.06.22 2.23% 7.64% 2012.06.27 0.08% 7.72% 2012.06.28 4.06% 12.10% 2012.06.29 1.41% 13.68% 2012.07.02 0.44% 14.18% 2012.07.03 2.52% 17.06% 2012.07.04 1.39% 18.69% 2012.07.05 0.55% 19.33% 2012.07.06 1.03% 20.56% 2012.07.10 0.05% 20.62% 2012.07.12 1.58% 22.53% 2012.07.13 3.20% 26.45% 2012.07.16 0.08% 26.55% 2012.07.17 1.03% 27.85% 2012.07.18 0.07% 27.95%
Dislikedhey tiger..... it kinda depends on how you intend to select the day.... extern string date = "2011.3.1 00:00"; in this case you would use OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) to talley the results for that day...... or perhaps you might want a running total of every day.... this can be done via an indicator or a funtion of an ea..... the results would be sent using FILE_CSV|FILE_WRITE to your files folder in metatrader..... such as below...... other methods exist..... in any event, the day must be included in your terminals order history.......Ignored
DislikedHello, Any expert could give me the light of how I can sum up total loss/profit of certain day on MT4 ? thanksIgnored
#property strict #property script_show_inputs input datetime StartDate = D'2018.12.06'; input int DurationHours = 24; void OnStart() { double total_day_profit = 0.0; for ( int z = OrdersHistoryTotal()-1; z >= 0; z -- ) { if ( !OrderSelect( z, SELECT_BY_POS, MODE_HISTORY ) ) continue; if ( OrderType() != OP_BUY && OrderType() != OP_SELL ) continue; if ( OrderCloseTime() < StartDate || OrderCloseTime() >= StartDate+DurationHours*60*60 ) continue; total_day_profit += (OrderProfit() + OrderSwap() + OrderCommission()); } Alert( "Profit for ", TimeToString( StartDate, TIME_DATE ), " - ", TimeToString( StartDate+DurationHours*60*60, TIME_DATE ),": ", DoubleToString( total_day_profit, 2 ), " ", AccountCurrency() ); }