Searched a while till I got so I think it could be usefull...everyones invited to look over the code and comments welcome!
I used the information I got over several sources...
As Script! Greetings from munich :-)
Question: In the Loop:
I used the information I got over several sources...
As Script! Greetings from munich :-)
Question: In the Loop:
- I m really sure: I have to use OrderProfit()+OrderCommission()+OrderSwap() instead of OrderProfit()!? Is this so?
- And what about the SPREAD.......it is just in the Orderprofit cause it is in the difference of buy and sell!
Inserted Code
//****************************************************************** // calcProfitInPoints //****************************************************************** int calcProfitInPoints() { int res; int profitAllTrades=0; double valOfPoint = MarketInfo(Symbol(), MODE_TICKVALUE) * MarketInfo(Symbol(), MODE_POINT) / MarketInfo(Symbol(), MODE_TICKSIZE); for (int i = OrdersHistoryTotal()-1; i >= 0; i--) { res=OrderSelect(i, SELECT_BY_POS, MODE_HISTORY); if (OrderSymbol()==Symbol()){ profitAllTrades+=(int)round(OrderProfit()/ (valOfPoint * OrderLots())) ; } } // for return profitAllTrades; }
Attached File(s)
Test - calcProfitInPoints -Upload.mq4
4 KB
|
244 downloads
Vucking good EA coder... https://t.ly/AZjRM
#14 All Time Return:
535.0%