'Point' only and always returning '0.0001' for some unknown reason.

 

The subject says it. I just started getting this instead of the current trade level recently for some unknown reason?

Very strange!

Thanks for any and all assistance (< 8)

 
Switch brokers? Some of them use 4 digits...
 
FourX:

The subject says it. I just started getting this instead of the current trade level recently for some unknown reason?

Very strange!

Thanks for any and all assistance (< 8)

gordon, FourX must've confused point with ask/bid...
 
gordon:

Switch brokers? Some of them use 4 digits...

Hi,

I did switch brokers a while ago, but it was working fine with them up until a little while ago.

It is supposed to return the current price of the selected order is it not?

I've been using it as such in other (prior) coding with no problems of it doing this that I am aware of.

The following is what the MQL4 editor says about 'Point':

double Point

The current symbol point value in the quote currency.

So it should be returning a value of somethings like: 1.2497, but most definitely not 0.0001

I'm glad I checked it, as obviously it is going to be throwing what I am doing way out of whack and leaving me scratching my head. Which is what I am now doing now! LoL (< 8)

I suspect that it may be something to do with the specific code of the EA that it is in.

FourX must've confused point with ask/bid...

No I'm clear on Ask and Bid. I'm wondering if you are thinking that I am confusing Point with Digits.

I know that Digits returns the quantity of trailing numbers after the decimal point.

Ask is the price of a Long Buy order.

Bid is the price of Short Sell orders.


But I am confused as to when an array is sized, it gets the number of orders and then divides them in half, which would through it off by a factor of 2 wouldn't it ?

. . . . . Orders = ArraySize(TradeOrders) / 2;



 
Point is used as a multiplier to convert an integer into a point value... for example... a stop loss of 50 points when multiplied by point returns 0.00050 (for a 5 digit broker). you can then add/subtract that from Bid/Ask. Point, on its own, will return 0.00001 for 5 digit brokers and 0.0001 for 4 digit.
V
 

So it should be returning a value of somethings like: 1.2497, but most definitely not 0.0001

But I am confused as to when an array is sized, it gets the number of orders and then divides them in half, which would through it off by a factor of 2 wouldn't it ?

. . . . . Orders = ArraySize(TradeOrders) / 2;

Doug why do you feel that a point value of 0.0001 is an invalid point value?

And what are you talking about in that last statement there?

 
Orders = ArraySize(TradeOrders) / 2

Actually you will find that the array is probably declared something like this :-

int TradeOrders[][2];
This is probably being used to store a trade type and a ticket number. ArraySize returns the total number of elements in an array, not the size of the first dimension as one would hope. If you were to have 3 orders for example, the ArraySize here would return 6 (3 x 2) and that is why the programmer divides by 2 to get the first dimension size, which will correlate with your number of orders.
 
FourX:

The subject says it. I just started getting this instead of the current trade level recently for some unknown reason?

I put 'Point' into another EA and it is still only returning a value of 0.0001 which renders it useless.

On a chart with the Japanese Yen it shows 2 trailing digits = 0.01

I'll try it out on a different broker.

 
FourX:
I put 'Point' into another EA and it is still only returning a value of 0.0001 which renders it useless.

FYP

I put 'Point' into another EA and it is still only returning a value of 0.0001 which renders it INVALUABLE.

What are you expecting it to return?

 

FourX,

I think you have misread the definition of point.......

double Point

The current symbol point value in the quote currency.

The point value is the smallest movement that a currency can change by in quote currency, but has nothing to do with the price of the currency. So a 5 digit broker EURUSD quote will have a Point value of 0.00001 and the USDJPY Point value will be 0.001. It will never ever change for a given currency at a given broker.

 
FourX wrote >>

I put 'Point' into another EA and it is still only returning a value of 0.0001 which renders it useless.

I'll try it out on a different broker.



Doug I'm pretty sure you've got your wires crossed as to what Point is generally used for in designing your EA's.

If you could give us a code snippet we could probably identify the source of your confusion as well as offer viable alternative code constructs.

Point is useful to convert things like stoploss in pips (50 pip stoploss, etc) into values that your broker will accept. Your broker won't accept a trade order with the stoploss set to 50 pips...it doesn't work that way. Stoploss is a price, just like Ask and Bid are prices.

For example if the USDJPY Bid is 92.83 (Digits == 2, Point == 0.01) and you want your stoploss to be set to 50 pips for a long position then you would instruct your broker to set the stoploss at Bid - StoplossInPips*Point = 92.83 - 50*Point = 92.83-50*0.01 = 92.33. In practice you would normalizedouble that value to Digits before submitting it to the broker.

Reason: