# 请问大神，怎么获取当前持有订单的利润点数。

jinchunlong2020:

 int i=0; //用來指定 單張訂單的double OrderProfitPoint=0;if(OrderSelect(i, SELECT_BY_POS)==true) OrderPrifitPoint=OrderProfit()*Point;Print(OrderPrifitPoint);

 double AccountProfitPoint=AccountInfoDouble(ACCOUNT_PROFIT)*Point;Print(AccountProfitPoint);

jinchunlong2020:

OrderProfit()；当前订单利润。

double pronft=;

if(OrderSelcet(12010,1,0)){

pronft=   OrderProfit()+   OrderCommission()+  OrderSwap();}

pronft这个变量的值等于12010这个单子的利润+手续费+隔夜费；

```double FloatingProfit(bool returnMaxProfit = true)
{
if(PositionsTotal() == 0) return 0;
static double maxProfitPoints = 0.0;
double ProfitPoints  = 0.0;
double openPrice     = PositionGetDouble(POSITION_PRICE_OPEN);
long   positionType  = PositionGetInteger(POSITION_TYPE);
ENUM_POSITION_TYPE TypeBuy  = POSITION_TYPE_BUY  ;
ENUM_POSITION_TYPE TypeSell = POSITION_TYPE_SELL ;
double price = positionType == TypeBuy ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID) ;
if(PositionGetDouble(POSITION_PROFIT) > 0 && PositionGetString(POSITION_SYMBOL) == _Symbol)
ProfitPoints = positionType == TypeBuy ?  price - openPrice  : openPrice - price;
if(ProfitPoints > maxProfitPoints)
maxProfitPoints = ProfitPoints;
return returnMaxProfit ? maxProfitPoints : ProfitPoints;
}
double ProfitPoint      = FloatingProfit(false);  // 获取实时浮动盈利的点数
double MaxFloatingPoint = FloatingProfit(true);   // 获取最大浮动盈利的点数```