Get Profit

 
Hi can somebody tell me how to calculate profit for all orders in the history ?
 
ankitkalindi:
Hi can somebody tell me how to calculate profit for all orders in the history ?
Loop through them, one by one, keep a running total of OrderProfit()
 
thanks for your reply sir but can you give me some example to calculate the net profit .
 
ankitkalindi:
thanks for your reply sir but can you give me some example to calculate the net profit .
OrderProfit() is the net profit . . . what more do you need ? do you want me to write the code for you ?
 
ankitkalindi:
thanks for your reply sir but can you give me some example to calculate the net profit .

double Calculateallnettoprofit()
    {
     double profits;
     for (int ioht=OrdersHistoryTotal() -1; ioht >= 0; ioht--) 
       { 
        OrderSelect(ioht, SELECT_BY_POS, MODE_HISTORY);
        if(OrderType() == OP_BUY || OrderType() == OP_SELL)
               {               
                profits += OrderProfit() + OrderCommission() + OrderSwap();
               } 
       }                            
     return (profits);
    } 
 

Terminal ==> Account History

Colom Profit ==> (select) All History

 
Thanks sir
 
sir if we have a special symbols and digits like 3, 5 then how can i do that
 
ankitkalindi:
sir if we have a special symbols and digits like 3, 5 then how can i do that


if you wanna write a program and you don't know the basics you can't

you have to learn the basics and practise with simple programs first

but if you can read the code and understand what that code does line for line

then you can make a different logic for how it has to trade and try to make that change

 
sir is this profit come is in pips ?
 
deVries:


if you wanna write a program and you don't know the basics you can't

you have to learn the basics and practise with simple programs first

but if you can read the code and understand what that code does line for line

then you can make a different logic for how it has to trade and try to make that change


thanks for your sir i will doing that sir can you tell me that the net profit is coming is in pips or i have to convert it
 
sir can you tell me how to convert the profit value in pips ?