Hi, everybody
So i look for the solution to convert the profts to pips ...
i use the class CPositionInfo
CPositionInfo _position = new CPositionInfo;
Comment(DoubleToString(position.Profit())); <<<< the value is money
how convert the "position.Profit()" to pips ??
Help me please .... thank you
Use the difference between PriceOpen and PriceCurrent and SYMBOL_DIGITS. Just set your correct symbol:
CPositionInfo my_pos; double difference; my_pos.Select(Symbol()); if(my_pos.PositionType()==POSITION_TYPE_BUY) difference=my_pos.PriceCurrent()-my_pos.PriceOpen(); else difference=my_pos.PriceOpen()-my_pos.PriceCurrent(); long symbol_digits=SymbolInfoInteger(my_pos.Symbol(),SYMBOL_DIGITS); int profit_pips=(int)(difference*MathPow(10,symbol_digits)); Print("Profit in pips: ",profit_pips);
Use the difference between PriceOpen and PriceCurrent and SYMBOL_DIGITS. Just set your correct symbol:
Very nice ... thank you so much
Hi, everybody
So i look for the solution to convert the profts to pips ...
i use the class CPositionInfo
CPositionInfo _position = new CPositionInfo;
Comment(DoubleToString(position.Profit())); <<<< the value is money
how convert the "position.Profit()" to pips ??
Help me please .... thank you
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, everybody
So i look for the solution to convert the profts to pips ...
i use the class CPositionInfo
CPositionInfo _position = new CPositionInfo;
Comment(DoubleToString(position.Profit())); <<<< the value is money
how convert the "position.Profit()" to pips ??
Help me please .... thank you