Price Per pip - page 9

 
gordon:

My definition loses it's original meaning when quoted out of context. To clarify - the word 'price' in the definition for MODE_TICKSIZE refers to the actual possible price quotes whereas in the definition for Point it refers to any price.

- Gordon, my definition is not too hot either ( Point = multiplying factor for the least decimal price ) and the hexadecimal analogy is so lame... But I may have a winner here...

Logic :
Broker need to establish Price relations among pairs to revolve around MODE_LOTSIZE being 100,000 unit of quoted currency & MODE_TICKVALUE being 10 unit of quoted currency. Only by this equal condition of inter-relationship, price can be quoted among each other. This I assume is the basis of forex price building.

Point = MODE_LOTSIZE / Tickvalue in quoted currency. e.g.:
GBPUSD 0.0001 = 100,000 / 10 USD
USDJPY 0.01 = 100,000 / 1,000 JPY <-- MathRound( MODE_TICKVALUE * latest Bid of quoted currency )
CHFJPY .... etc. if you or anyone can confirm it would be great.

All bets are off if we're going to start talking about futures contracts. For example, FXPro have futures contracts in the near-normal format #AAmy where "my" is a standard expiry code such as M0. EUR_JPY_fut sounds like some weird synthetic contract.

- Ok Jjc... I assume future have different Price & TICK_VALUE building also. So this would definitely rule out all non-forex instruments. Prefixes & in-between-fixes are considered less likely. 

- CB I'd be very interested to hear your opinion on the above calculation. Thank you for your opinion so far. 

best regards
cameo 

 
cameofx:

- Gordon, my definition is not too hot either ( Point = multiplying factor for the least decimal price ) and the hexadecimal analogy is so lame... But I may have a winner here...

Logic :
Broker need to establish Price relations among pairs to revolve around MODE_LOTSIZE being 100,000 unit of quoted currency & MODE_TICKVALUE being 10 unit of quoted currency. Only by this equal condition of inter-relationship, price can be quoted among each other. This I assume is the basis of forex price building.

Point = MODE_LOTSIZE / Tickvalue in quoted currency. e.g.:
GBPUSD 0.0001 = 100,000 / 10 USD
USDJPY 0.01 = 100,000 / 1,000 JPY <-- MathRound( MODE_TICKVALUE * latest Bid of quoted currency )
CHFJPY .... etc. if you or anyone can confirm it would be great.

- Ok Jjc... I assume future have different Price & TICK_VALUE building also. So this would definitely rule out all non-forex instruments. Prefixes & in-between-fixes are considered less likely.

- CB I'd be very interested to hear your opinion on the above calculation. Thank you for your opinion so far.

best regards
cameo

Would the logic change if Digits = 5 or Digits = 3?
 

FInally have connection to post... 

Would the logic change if Digits = 5 or Digits = 3?

No engcomp, the logic is not suppose to change. At least that's what I'm trying to figure out. 

I'm trying to get to the bottom of several things, The casts are so far : Point, MODE_TICKVALUE, MODE_TICKSIZE, Price. I might end up only presenting them in a new light but if I can exploit from there then it would be worth it.  

IMO, MODE_TICKVALUE converted in quoted currency is very important . So for discussion's sake I'll call it QUOTE_TICKVALUE. The previous equation is backward by the way. 

To calculate if Point is indeed : QUOTE_TICKVALUE (TickValue in quoted currency) / MODE_LOTSIZE, I have this. (Calc_Point is suppose to match Point)   

string Sym = Symbol();
double Calc_Point = QUOTE_TICKVALUE(Sym) / MarketInfo(Sym, MODE_LOTSIZE);
int QUOTE_TICKVALUE(string Sym)
{
   string quoted_currency_name = StringSubstr(Sym,3,3); double TV, QTV = 0.0;
   if (MarketInfo(StringConcatenate("USD", quoted_currency_name), MODE_LOTSIZE)) > 0)
   {
     TV = MarketInfo(Sym, MODE_TICKVALUE);
     QTV = MathRound(TV * MarketInfo(Sym, MODE_BID));
     return(QTV);
   }
   else if ((MarketInfo(StringConcatenate(quoted_currency_name, "USD"), MODE_LOTSIZE)) > 0)
   {
     TV = MarketInfo(Sym, MODE_TICKVALUE);
     QTV = MathRound(TV * MarketInfo(Sym, MODE_BID));
     return(QTV);
   }
}
Note: for cross-pairs that has quoted currency as a base in their USD form (e.g. EURGBP) the above will need to be modified a bit. 

So at any given time, any given price

USDJPY, GBPJPY, AUDJPY, XXXJPY.............  has QUOTE_TICKVALUE of --> 1000 [JPY]
EURUSD, AUDUSD, GBPUSD, XXXUSD ........ has QUOTE_TICKVALUE of --> 10 [USD]
EURCHF, USDCHF, XXXCHF....................... has QUOTE_TICKVALUE of --> MathPow(10, x) [CHF]

I need to underline that I'm 'extracting' QUOTE_TICKVALUE from the floating TICK_VALUE. So I think what this means is QUOTE_TICKVALUE is predetermined by broker & what's more important is: they paralel-ly will be consistent among each currencies that serve as the quoted currency. So as long as MODE_LOTSIZE = 100,000 and USD's QUOTE_TICKVALUE = 10 we can be sure the other symbol components that serve as quote currency will be consistent also (i.e. you cannot change 10 USD to 1 USD without dividing other QUOTE_TICKVALUE-s with 10 too -- this I believe is where we can determine my Valid_Point at large). I hope that's clear... 

I can't (for the life of me) have net & MT4 at the same time these days (it's complicated..). So If someone can help or verify it would be great.  

cameo 

 

I have found what I need, Valid_Point & even more. A more in-depth understanding to Point, TickValue, Ticksize, Symbol(), & price in general. Thanks to all who have shared their insights & comments ever since LEHayes started this thread. 

Best regards
cameo 

 

Man, look at all the brain storming I have caused. I hope it was useful. I have not had the time to keep up with the thread, but I hope to get a chance to review.

After all this discussion and excellent work, have we come to a point where we have some kind of standard function to generate what we were looking for? This question is meant to bring us to a summary.

 

Has anyone experience with the above calculation tips on metals or other symbols than crosscurrencies?

I've found this topic as I was interested in the calculation of price change in account currency of one Point movement in symbol.

My base theory was this:

Price per pip = Contract size * Point

Price per pip in account currency = Price per pip * Account Counter Cross rate,

where

Contract size = MarketInfo(Symbol(), MODE_LOTSIZE)

Point = Point = MarketInfo(Symbol(), MODE_POINT)

Account Counter Cross rate is the price of symbol's counter currency expressed in account's currency (CCCAAA bid rate where AAA is account currency and CCC is counter currency of symbol).

I've checked the above with different broker's demo accounts (icm, insta, fxopen, fxopen ecn) against actual 1.0 lot trades in Account History. I've also checked cloudbreaker's tickvalue calculation method.

I have found the following:

- price of one Point movement of a symbol is not easy to calculate with different brokers and in the case of metals

- even cloudbreaker's tickvalue * point / ticksize formula might lead to false results (insta - silver, icm - eurusd, fxopen - silver and gold)

- in the case of icm - gold, even Contract size * Point leads to bad result (0.5 instead of actual 5.0, is it a broker data error?)

You can find detailed results here: Price per pip.

So my conclusion is that there's no 100% confident method of calculation of Price per pip.

 
Thanks for sharing this little program you wrote. I can't believe it was that easy!! you saved me heaps of time :-)
engcomp:

Attached is a little script I developed that might answer your question.

Because scripts have no "extern" parameters, you have to change them in the code and recompile.

Just load into your experts/scripts folder, compile, and attach to a chart.

Let me know how it goes, Helmut

 
Note comments about DE30
double  PointValuePerLot(string pair=""){
    /* Value in account currency of a Point of Symbol.
     * In tester I had a sale: open=1.35883 close=1.35736 (0.0147)
     * gain$=97.32/6.62 lots/147 points=$0.10/point or $1.00/pip.
     * IBFX demo/mini       EURUSD TICKVALUE=0.1 MAXLOT=50 LOTSIZE=10,000
     * IBFX demo/standard   EURUSD TICKVALUE=1.0 MAXLOT=50 LOTSIZE=100,000
     *                                  $1.00/point or $10.0/pip.
     *
     * https://forum.mql4.com/33975 CB: MODE_TICKSIZE will usually return the
     * same value as MODE_POINT (or Point for the current symbol), however, an
     * example of where to use MODE_TICKSIZE would be as part of a ratio with
     * MODE_TICKVALUE when performing money management calculations which need
     * to take account of the pair and the account currency. The reason I use
     * this ratio is that although TV and TS may constantly be returned as
     * something like 7.00 and 0.0001 respectively, I've seen this
     * (intermittently) change to 14.00 and 0.0002 respectively (just example
     * tick values to illustrate).
     * https://forum.mql4.com/43064#515262 zzuegg reports for non-currency DE30:
     * MarketInfo(Symbol(),MODE_TICKSIZE) returns 0.5
     * MarketInfo(Symbol(),MODE_DIGITS) return 1
     * Point = 0.1
     * Prices to open must be a multiple of ticksize */
    if (pair == "") pair = Symbol();
    return(  MarketInfo(pair, MODE_TICKVALUE)
           / MarketInfo(pair, MODE_TICKSIZE) ); // Not Point.
}
 
I have been trying to calculate the risk percentage on non-forex symbols, however I haven't been able to come up with anything that is even remotely reliable since most non-forex symbols behave very differently. Does anyone have any pointers on how to calculate the correct pipvalue on non-forex symbols in order to calculate a correct risk percentage?
 
How does the above NOT work correctly?
Reason: