MarketInfo(Symbol(),MODE_TICKVALUE)
TickValue must be used as a ratio not by itself when ticksize != Point.
navid:
hi
how i can calculate Profit/Loss ($) in each pip movement in Market in following Currency :
Of course if you prefer to do it manually, you can use a calculator ...
http://www.babypips.com/tools/forex-calculators/pipvalue.php
navid:
Try this codehi
how i can calculate Profit/Loss ($) in each pip movement in Market in following Currency :
I have one order with (+20 pip) Profit and LotSize (0.04 ) in each following Currency .
EURUSD (Profit = ? $)
USDJPY (Profit = ? $)
GBPJPY (Profit = ? $)
thanks
//------------------------------------------------------ //Calculate for 4 or 5 digits broker int MultiplierPoint=1; if(Digits==3||Digits==5) MultiplierPoint=10; //------------------------------------------------------ int TotalTrades=0; double TotalPips=0; int WinsTrades=0; int LossesTrades=0; double TotalProfitLoss=0; //------------------------------------------------------ //Calculate total profit loss and trades and pips for(int cnt=0; cnt<OrdersHistoryTotal(); cnt++) { OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY); if(OrderType()<=OP_SELL) { if((OrderMagicNumber()==Magic)&&(OrderSymbol()=="EURUSD")) { TotalTrades++; //------------------------------------------------------ //wins orders if(OrderProfit()>=0) { WinsTrades++; TotalProfitLoss+=OrderProfit()+OrderCommission()+OrderSwap(); TotalPips+=(MathMax(OrderOpenPrice(),OrderClosePrice())-MathMin(OrderOpenPrice(),OrderClosePrice()))/(MarketInfo(OrderSymbol(),MODE_POINT)*MultiplierPoint); } //------------------------------------------------------ //Losses orders if(OrderProfit()<0) { LossesTrades++; TotalProfitLoss-=MathAbs(OrderProfit()+OrderCommission()+OrderSwap()); TotalPips-=(MathMax(OrderOpenPrice(),OrderClosePrice())-MathMin(OrderOpenPrice(),OrderClosePrice()))/(MarketInfo(OrderSymbol(),MODE_POINT)*MultiplierPoint); } //------------------------------------------------------ } } } //------------------------------------------------------
pannek:
Try this code
I do some change...
Try this code
double PipValue = MarketInfo(Symbol(), MODE_TICKVALUE) * (Points / MarketInfo(Symbol(), MODE_TICKSIZE));Can this be the right pipvalue ??
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hi
how i can calculate Profit/Loss ($) in each pip movement in Market in following Currency :
I have one order with (+20 pip) Profit and LotSize (0.04 ) in each following Currency .
EURUSD (Profit = ? $)
USDJPY (Profit = ? $)
GBPJPY (Profit = ? $)
thanks