5 digits detection - page 3

 
I said it was dependant upon the range of the currency and I admit the initial attempt to put my explanation in to code was not that good but are you saying the idea is wrong or are you picking on the implementation?
It occurred to me it might be better to use the real multiplier rather than the rounded one this way we would always be betting in 1/10000 ths of the currency.
 
Ruptor:
[...] but are you saying the idea is wrong or are you picking on the implementation?

Both. Firstly, it's not "impervious" to the number of digits used by the broker. Secondly, the order of magnitude of a price is only indirectly related to what people generally agree on calling its pip size. What you seem to have is a very round-about route of doing fundamentally the same sort of check as roger, but in a way which can be broken by movements across a price threshold.

 
Ruptor:
Hi cameofx
A picture paints a thousand words or code in this case. pipx is what you have to multiply Point by to get 1/10000 th for a point which is the usual value to trade.
It still isn't fool proof if the currency moves up or down 10 times its value against its pair but it is impervious to broker digits in forex I think.

Darn it.. I just saw this.. I had to leave for an entire week & forgot the whole thing... Thank you Ruptor.

Jjc, I need to ponder & tinker with yours & Ruptor's discussion. But I still think Ruptor's on to something... or on the right direction at least. I also recall Ais post about

his planning to use price operations as integers. Maybe this can lead to a more 'foolproof' solution.

 
cameofx:

Jcc, I need to ponder & tinker with yours & Ruptor's discussion. But I still think Ruptor's on to something... or on the right direction at least.

IMHO, Ruptor's direction eventually leads, by a very roundabout route, to the same destination as roger's much simpler suggestion of using MODE_DIGITS. The fundamental point is that the pip size of an instrument is an arbitrary convention which most people agree on, not an empirical feature of the financial instrument. There is no "right answer", and therefore no foolproof mathematical way of establishing the pip size.

 
Ruptor:
Isn't it just a simple (maybe not so simple in maths terms) matter of working out what one point is relative to a given price and then deciding which digit it is in compared to the digits of the price?
A simple way of achieving this could be take a price add a point and compare it to your multiplier+same price if your result is not the same increase your mutiplier in a loop until they match.

please can somebody help to give MQL4 code if i want to send my ea to somebody and request for his account number.

i don't know how to do that. any help would be appreciated. pls is urgent thank you

 
jjc:

IMHO, Ruptor's direction eventually leads, by a very roundabout route, to the same destination as roger's much simpler suggestion of using MODE_DIGITS. The fundamental point is that the pip size of an instrument is an arbitrary convention which most people agree on, not an empirical feature of the financial instrument. There is no "right answer", and therefore no foolproof mathematical way of establishing the pip size.

Hi, picking up on where I've left off.. (hope you're still interested)...
what I meant by Ruptor's direction was we need a way to check the relation of ticksize and the valid point size with a loop... ideally independent of symbols and or platforms.
 
we usually speak of symbols as simply forex and gold. but it's a loss if we can't fully maximize all symbols the broker had to offers.
As I had mentioned a broker can offer a wide variety of instruments with MT4 platform. I had GCI platform downloaded from about a year ago. They had some 140 plus symbols.
Digits from 0 to 4 exist... (3 was natural gas, 0 for example was dow jones) and they were a '2/4 digit broker' at that time. Now if they were to change to sub pip or 3/5 digit broker, a simple
if digit is 3 or if digit is 5 cannot do across symbols and or platforms.
 
cameofx:
Digits from 0 to 4 exist... (3 was natural gas, 0 for example was dow jones) and they were a '2/4 digit broker' at that time. Now if they were to change to sub pip or 3/5 digit broker, a simple
if digit is 3 or if digit is 5 cannot do across symbols and or platforms.

Phy has published an MT4 listing for the 10-year T-Note future which is quoted to 5DP: https://www.mql5.com/en/forum/109552/page3#195885. Anything up to 7DP potentially exists, i.e. is an attribute of a widely traded financial instrument.

I'm not sure what relation this now bears to the original question. It was never explicit, but I understood it to mean something like "if there is an extern parameter where the user enters a value in pips, and they enter a value of something like 20, is there a reliable way of determining whether they mean 20 * MODE_TICKSIZE or 200 * MODE_TICKSIZE?" Roger's answer is reliable for forex, but I don't believe there's anything approaching a good answer across the board. How large is a "pip" if something moves in increments of 0.5?

 
The fundamental problem is that the pip is arbitrarily fixed usually at 1/10000 th but the currency is not. So I am thinking along the lines of whether we really need or should be worrying about how many pips ends up in the final calculation. It is the value of the currency that counts otherwise we are not trading a fixed percentage. 1/10000 th of jpyusd at 122.00 is not the same as 1/10000 th of jpyusd at 95.00. The example I gave previously was trying to round and compensate for the enormous movement that can occur in the currency so would still be a compromise if implemented correctly. Just calculating 1/10000 th of the current price as a pip is a concept change that brokers probably would not like because it would mess up the profits they gain by fiddling the fractions of a point but it would be better for the trader. Does it really matter to us if 10 pips works out to 9.3714 pips on jpyusd for instance especially since the brokers are now giving us the greater accuracy and our programs would be independant of future changes.
 
jjc:

I'm not sure what relation this now bears to the original question. It was never explicit, but I understood it to mean something like "if there is an extern parameter where the user enters a value in pips, and they enter a value of something like 20, is there a reliable way of determining whether they mean 20 * MODE_TICKSIZE or 200 * MODE_TICKSIZE?" Roger's answer is reliable for forex, but I don't believe there's anything approaching a good answer across the board. How large is a "pip" if something moves in increments of 0.5?

Thank you Ruptor & Jjc,

What I had in mind probably is more vague than yours... I have this requirements (correct me if it's wrong or incomplete) :

- the purpose is to make a function / routine to detect 5 digits / sub pip broker and adjust the parameters for orders operations in pips accordingly.

- Ideally, the function should also work for adjusting order operations on any symbols on any digit varieties brokers.

- we usually - naturally - would like to think of trades simply as how many pips a tp/sl would be set; how many pips have been won/lost, etc. we input pips as integer and multiply it with point ( this is where the problem lies, I think ). the subpip broker, or perhaps sub-subpip if they would ever exist, makes this simple operations of trade invalid or potentially 'disastrous'. So, to better rephrase the problem, we need to determine the valid point of digits. i.e. on forex '4 digit broker' the valid point for non-jpy symbols is the forth digit (after point). On '5 digit /subpip broker' the valid point is still the 4th digit after point.

- I have this idea : given the fact that Usd based pairs has a tickvalue of $US 10.00 fixed (taking leverage and lot size into consideration)
perhaps 'anchor-ing' the function check - comparing symbols tickvalue to $US 10 - can work.

- Off course tp/sl and pending orders need to be adjusted to MODE_STOPLEVEL ; increments other than 1 * points should be checked and adjusted with TICK_SIZE multiplier accordingly. Taking all this into considerations maybe would make a function that holds across symbols & brokers. And things would be much easier... :)

Reason: