TimmyHanke wrote: Wed Apr 11, 2018 2:30 am
here is one already made that probably will suit what you want .
Thanks for reply,
I want to use those functions in my expert,then functions must to check a defined magic number and symbol.
The expert that you introduced,only close orders in profit/loss that we set,But i want:
First function, calculate the profit of the
last N orders for Specified order type.
Example:
if N=5 and typeOfOrder=OPP_BUY, function return the Amount of profit/Loss of Last 5 order
Code: Select all
double LastNorderProfit (int N , int typeOfOrder)
{
...
return(SumOflast_N_orderProfit)
}
=============
The second function ,close
last/first X orders for Specified order type.
Example:
if X=2 and typeOfOrder=OPP_BUY and LastOrFirst=0, function must to close last 2 Buy Orders.
Code: Select all
void CloseLast_X_order( int X,int typeOfOrder,LastOrFirst)
{
...
}
(comment: if we want to close Last X orders,LastOrFirst=0 and if we want to close First X orders,LastOrFirst=1)
Thanks again