Topic: How to get Total History Profit from Portfolio ea?
Hi,
how can i get the total Profit of an Portfolio EA?
On normal Eas this kind of code is working well.
double Total_History_Profit()
{
double totalhistoryprofit=0;
int total=OrdersHistoryTotal();
for(int i=0;i<total;i++)
{
if(OrderSelect(i,SELECT_BY_POS, MODE_HISTORY)==true)
{
if(OrderSymbol()==Symbol()&& OrderMagicNumber()==Magic_Number)
if(OrderType()==OP_SELL || OrderType()==OP_BUY)
{
totalhistoryprofit+= OrderSwap()+OrderProfit();
}
}
}
return(totalhistoryprofit);
}
But cause Portfolio have different magicnumbers.. What did i have to put in this line instead of Magic_Number?
if(OrderSymbol()==Symbol()&& OrderMagicNumber()==Magic_Number)