Price Per pip - page 2

 

LEHayes, it's ok if you totally ignore my post. I have nothing but respect for your experience, but sometimes even the smartest can miss something. Your problem sounds a lot like TickValue, which is why I ask. This is the best explanation I can find that resembles your problem. From the Book, maybe this can help :

The size of one standard lot for the same symbol may vary in different dealing centers.
The required amount of free assets for opening a one-lot order is inversely proportional to the amount of the provided leverage. At the same time, the cost of 1 point in the deposit currency for a symbol does not relate to the provided leverage.

Table 3. Possible combinations of 1-lot cost and 1-point cost (deposit currency is US dollar).
Dealing Center 1 Dealing Center 2 Dealing Center 3
Buy Sell 1pt Buy Sell 1pt Buy Sell 1pt
EUR/USD 1296.40 1296.20 10.00 1296.50 1296.20 10.00 1000.00 1000.00 10.00
GBP/USD 1966.20 1966.00 10.00 1376.48 1376.20 7.50 1000.00 1000.00 10.00
AUD/USD 784.40 784.20 10.00 1569.20 1568.40 20.00 1000.00 1000.00 10.00
USD/JPY 1000.00 1000.00 8.29 1000.00 1000.00 8.29 1000.00 1000.00 8.29
USD/CHF 1000.00 1000.00 8.02 1000.00 1000.00 8.02 1000.00 1000.00 8.02
EUR/CHF 1296.40 1296.20 8.02 1296.35 1296. 35 8.02 1000.00 1000.00 8.02

Prices are given as of 16.12.2007.

Let's briefly consider some common methods of calculating the cost of 1 lot and of 1 point.

Dealing Center 1 (most common)

For the symbols that have USD reciprocally, the cost of 1 lot is equal to the current price of the corresponding two-way quote multiplied by 1000, whereas the cost of 1 point is equal to $10.

For the symbols that have USD as their numerator, the cost of 1 lot is equal to $1000.00, whereas the cost of 1 point is inversely proportional to the current quote and equal to 1/(Bid). For example, for USD/CHF, at Bid= 1.2466, the cost of 1 point is 1/1. 2466 = 8.02.

For cross rates, the cost of 1 lot is calculated in the same way as that of the numerator currency, whereas the cost of 1 point is calculated in the same way as that for the denominator currency. For example, for EUR/CHF, the cost of 1 lot is 129.40 (as for EUR/USD), whereas the cost of 1 lot is 8.02 (as for USD/CHF).

Dealing Center 2

In some dealing centers, considering the same rule of calculating costs, the values of costs can be different for some symbols. For example, the cost of 1 lot and the cost of 1 point may be proportionally increased or decreased. For example, this factor can be 0.75 for GBP/USD, whereas it is 2.0 for AUD/USD. Such representation of cost values does not result in any economical changes; in such cases, you just have to consider this special feature when calculating costs of your orders. You should also pay attention to the fact that the 1-lot costs for buying and selling of assets at cross rates are the same.

Dealing Center 3

there are also dealing centers that set the cost of 1 lot as $1000.00 for any symbol. At the same time, the cost of 1 point remains proportional to the current prices. This implies setting a special leverage for each symbol. 1-point cost of all symbols that are not quoted as related to USD always changes proportionally to the cost of the symbol specified reciprocally.

Generally, there can exist other principles of building cost values. It is needless to say that, prior to start real trading, you should find out about the calculation method for any specific dealing center and consider this method in your coding.

Best regards

 
engcomp:

I am not sure how to take this. It is on the borderline of being annoying.

LEHayes, if you have a look you will see that "stop loss size" is one of the inputs, NOT what the script attempts to determine.

Also, the script does not "attempt to" but does determine the lot size based on the stop loss and risk percentage you determine.

Finally, the tick value it returns is in the currency of the account. To translate that into your currency is up to you.



Sorry about that, I see now that the Stop loss was not used in the calculation.

I am getting the impression that TICKVALUE is not a reliable source for determining the actual value of a pip. This is kind of one reason why I am shy about using TICKVALUE. I have been told that it jumps or can change. The only thing your code did with TICKVALUE was to determine if you needed to calc it against 10 for the extra digit situation right? Referring to this:

   double tickvalue = (MarketInfo(Symbol(),MODE_TICKVALUE));
   if(Digits == 5 || Digits == 3){
      tickvalue = tickvalue*10;
   }

So, in short, TICKVALUE could be said to be the same as Pip Value or Price Per Pip. If I am concerned about the value jumping, then maybe I should check the value for validity before assuming it in a calculation right, or use another method of coming up with the Price Per Pip.

I think one of the reasons why I am frustrating folks is because there are different terms to describe the same thing in this maket. Pip value, price per pip, tickvalue, etc. Maybe a book on synonyms in this market would be handy. ;-)

 
LEHayes:

CB, this is the reason why I am back to getting to the root of this. When I do the search as you suggest, there are over 2800 forum threads alone, somehow realated to this. I have read threads on a contraversy of whether a tick is actually a pip or that is should be treated differently because a tick is when the broker chooses to update your MT4, it does not dictate that a tick will be an update every pip. Therefore the arguement goes on to state that it was an un reliable source for getting a pip value.

I don't know if this helps, but...

  • Pretty much everyone agrees that a "pip" is a unit of price movement. They may not agree on the size - e.g. whether a pip on EURUSD is 0.0001 or 0.00001 - but the term is fairly unambiguous.
  • "Tick" is widely used to mean two different things: either the same as "pip", or the very different meaning of "market event" such as "30 ticks per minute". Some people try to insist on "tick" being reserved for the latter meaning, but they're fighting a losing battle. To put it another way, MT4's MODE_TICKSIZE and MODE_TICKVALUE would be slightly less contentious if called MODE_PIPSIZE and MODE_PIPVALUE.

 
gordon:
Price-per-pip or price-per-point? If the former, than this is relevant -> https://www.mql5.com/en/forum/124692, discusses how to determine the size of pip (in points) for a symbol...


If I put an EA on EURUSD, and the price moves from 1.1234 to 1.1235, I wan to know the cash value of that single move. I know there is going to be a need for leverage in this calculation, and lot size, but we can set lot size to a standard of 1 for the purpose of determining the pip value, then later calculate that against mini or micros, etc.

Honestly fellas I am not trying to be complicated and I am trying to type as straight forward as I can. I hope I am not torking someone off.

 
LEHayes:


Sorry about that, I see now that the Stop loss was not used in the calculation.

I am getting the impression that TICKVALUE is not a reliable source for determining the actual value of a pip. This is kind of one reason why I am shy about using TICKVALUE. I have been told that it jumps or can change. The only thing your code did with TICKVALUE was to determine if you needed to calc it against 10 for the extra digit situation right? Referring to this:

So, in short, TICKVALUE could be said to be the same as Pip Value or Price Per Pip. If I am concerned about the value jumping, then maybe I should check the value for validity before assuming it in a calculation right, or use another method of coming up with the Price Per Pip.

I think one of the reasons why I am frustrating folks is because there are different terms to describe the same thing in this maket. Pip value, price per pip, tickvalue, etc. Maybe a book on synonyms in this market would be handy. ;-)

 And from the Article


Let’s define NominalPipValue as the value of a single pip in deposit currency when Volume=1.00.
NominalPipValue can be calculated knowing the current exchange rate of the chosen pair.

Let’s say you are trading EURUSD on a standard account with leverage 1:100. If your deposit currency is USD then NominalPipValue will always be 10$, no matter which is the exchange rate.
If your deposit currency is EUR then you must consider the exchange rate, more precisely the inverse of the exchange rate.

NominalPipValue = (10 / exchange rate) 

If the current exchange rate EURUSD is for example 1.3333 then you’ll have:

NominalPipValue = (10$ / 1.3333) = 7.519 EUR

As you can see it’s pretty easy. Things get more complicated when you trade a pair like USDCHF and your deposit currency is in EUR or GBPJPY and your deposit currency is either EUR or USD. In fact in these cases you have to take into account a double exchange rate.

Fortunately we don’t need to do that as MetaTrader has a specific function that easily tells us NominalPipValue:

NominalPipValue = MarketInfo(Symbol(),MODE_TICKVALUE) (6)

This will work whichever pair your are trading and whichever your deposit currency is… even too easy now :)

ATTENTION: NominalPipValue changes with exchange rates so its value at order’s opening is different from the one at order’s closure. Actual profit/losses are calculated using exchange rate at order’s closure.

Unfortunately we do not know this value at the moment in which we open the order… anyway for variations of exchange rate in the order of typical SL the difference in NominalPipValue at opening and closure of the position is small enough to be ignored for the purpose of our calculation (less than 1% on for SL <= 100pips).

At this point we know that when buying/selling 1.00 Lots PipValue equals NominalPipValue. More in general we can say:

1.00 / NominalPipValue = X / PipValue (7)

where “X” is the nr. of Lots to trade.
We extract X from the equation (7) turning it into:

X = PipValue / NominalPipValue (8)

Good, we reached our target. Now we know how to convert Risk Capital in Lots!!! 

   This may be otherwise of use for newbs / someone...  

 
cameofx:

LEHayes, it's ok if you totally ignore my post. I have nothing but respect for your experience, but sometimes even the smartest can miss something. Your problem sounds a lot like TickValue, which is why I ask. This is the best explanation I can find that resembles your problem. From the Book, maybe this can help :

Best regards


Yes, this is the calculation I am looking for. Determine 1 point of movement. You are right on the money, now what confuses me is how to write this in the function of determining this value. We have a condition where the USD is either a numerator, a demononator or dealing with crosspair situations. This is where I bungle it up.
 
jjc:

I don't know if this helps, but...

  • Pretty much everyone agrees that a "pip" is a unit of price movement. They may not agree on the size - e.g. whether a pip on EURUSD is 0.0001 or 0.00001 - but the term is fairly unambiguous.
  • "Tick" is widely used to mean two different things: either the same as "pip", or the very different meaning of "market event" such as "30 ticks per minute". Some people try to insist on "tick" being reserved for the latter meaning, but they're fighting a losing battle. To put it another way, MT4's MODE_TICKSIZE and MODE_TICKVALUE would be slightly less contentious if called MODE_PIPSIZE and MODE_PIPVALUE.


Which is just what brings me to my concerns. Your statement on Tick.
 
cameofx:

And from the Article

This may be otherwise of use for newbs / someone...


Yes, this is what I am looking for also. I think the two articles are saying the same thing. So basically, from this article I can safely assume that TICKVALUE is PipValue or Price Per Pips. The jumping or changing of this value may be due to on the fly calculations involving the exchange rate. I should expect the fluctuations.

Sorry fellas if it is this simple, I am truly sorry for causing such a ruckus.

 

Thank you all for getting it through my thick skull. for some reason, I had it that TICKVALUE was unreliable.

 
LEHayes:

Thank you all for getting it through my thick skull. for some reason, I had it that TICKVALUE was unreliable.

TICKVALUE, when used on its own, can be unreliable.

If you examine TV and TS every tick you will normally see something like this:

1 0.0001

1 0.0001

1 0.0001

1 0.0001

However, just occasionally you may see something like this:

1 0.0001

1 0.0001

2 0.0002

1 0.0001

That's why I'll mention (yet again) that TICKVALUE and TICKSIZE ought to be used as a ratio. TV/TS is the formula that will deliver what you are looking for.

CB

Reason: