Convert Commission+Swap into PIP and add that PIP value with open order price

 

Hello brothers,

I would like to know how to convert a order commission + swap value into PIP and I need to add that PIP value with Open order value... (So i'll get exact open order price value)


Thanks in Advance.

 
I must say that your question requires a little more detail. We would like to know if you want to implement your conversion (or calculation) in an Expert Advisor or you just want to do the calculation yourself and know the value you will get. The first case is a little bit challenging especially if you are new to programing with MQL4 (for MT4 platform). Now the second case - by order commission I believe you mean the spread value for an open position. It is listed on the market watch of your metatrader. As for swap, right click an instrument on the market watch and click 'specification'. You need to convert SWAP and SPREAD (the commision) to POINTS by multiplying each by the POINT value of the instrument you have selected, then add the results you get to your Open order value. Hope this helps.
 
Here you go bro.,,   Kindly forgive me if i post again about this, I'm not a good programmer.,
 
Saravanakumar D: I would like to know how to convert a order commission + swap value into PIP and I need to add that PIP value with Open order value... (So i'll get exact open order price value)
  1. How does adding anything "with Open order value" give "exact open order price value?" Question makes no sense unless you mean the break even price (include commission & swap.)
  2. Do the math.
    • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
    • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip)
    • Do NOT use TickValue by itself - DeltaPerLot
    • You must normalize lots properly and check against min and max.
    • You must also check FreeMargin to avoid stop out
 
Saravanakumar D: Here you go bro.,,   Kindly forgive me if i post again about this, I'm not a good programmer.,
Your code is only good if the account currency is USD, the symbol is xxxUSD and the size of one lot means DeltaPerLot is exactly $100 USD. That is why it fails for you except for gold.
Reason: