Thread: Ask!
View Single Post
  #696 (permalink)  
Old 08-02-2007, 04:52 AM
flexie flexie is offline
Member
 
Join Date: Feb 2006
Posts: 35
flexie is on a distinguished road
trading stats

use this code:

// ************************************************** *************************
int stats()
{
int i, vOrders;

// current CP profit
vOrders = OrdersTotal();
Profit = 0;
PipsProfit = 0;
for(i=vOrders-1;i>=0;i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderSymbol() == Symbol())
{
Profit += OrderProfit();
if (OrderType() == OP_BUY) PipsProfit += ((Bid - OrderOpenPrice())/Point);
else if (OrderType() == OP_SELL) PipsProfit += ((OrderOpenPrice() - Ask)/Point);
}
}
}
// potential risk
// max positions
}

Profit & PipsProfit will need to be declared outside the program, then display then on the screen with your favorite method. Comments if nothing else.

Mark
Reply With Quote