Download MetaTrader 5
To add comments, please log in or register
Improve your rating. Execute orders in Freelance service!
Patrick Burns
594
Patrick Burns 2014.08.13 11:42 

Hello,

On many of the EA's I have there is a function that will prevent buying or selling at a certain distance from the top or bottom of the market. It is user set in the variables i.e Points_Bars, Points_Restrict, Points_Period etc. Is it possible to code it so the user has the option of entering a specific price e.g do not buy if price above 1.33000. Would this be difficult, as commodities do not have 5 digits after the decimal point. Sorry not to be concise and I would be grateful for any honest replies.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.13 12:21  
whroeder1
13613
whroeder1 2014.08.13 12:49  
NotUnctuous: Would this be difficult, as commodities do not have 5 digits after the decimal point.
Why is it difficult? Extra zeros after the decimal point don't change the value.
if( Bid > 1.30    )
if( Bid > 1.30000 )
Patrick Burns
594
Patrick Burns 2014.08.13 12:51  


Thank you, I have used this service numerous times......and a good service it is from my experience.
Patrick Burns
594
Patrick Burns 2014.08.13 12:52  
WHRoeder:
NotUnctuous: Would this be difficult, as commodities do not have 5 digits after the decimal point.
Why is it difficult? Extra zeros after the decimal point don't change the value.


The figure was an example. If the price was 1.33615 then it would matter, surely?
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.13 13:13  

You have to accept what is being offered by your broker.

Let say if the offered pair is in 4 decimal place, then code it appropriately. Same applies to commodities or other trades. If it is offered without any decimal, then by all means, it is not meant to be in decimals.

You yourself are making this difficult.

Patrick Burns
594
Patrick Burns 2014.08.13 13:32  
deysmacro:

You have to accept what is being offered by your broker.

Let say if the offered pair is in 4 decimal place, then code it appropriately. Same applies to commodities or other trades. If it is offered without any decimal, then by all means, it is not meant to be in decimals.

You yourself are making this difficult.



Thank you. I probably lack clarity in my explanation. What I need to ensure is that the EA will work whether there are 2, 3, 4 or 5 digits after the decimal point. ie EUR/USD has 5 whereas oil or gold only 2. Anyhow, it is in the jobs section, so I will see what transpires. Appreciate your replies.
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.13 13:38  
A properly coded EA can handle any digits after the decimal point. Like most of ours here. Which includes mine.
whroeder1
13613
whroeder1 2014.08.13 22:19  
NotUnctuous: If the price was 1.33615 then it would matter, surely?
Again why do you think it matters?
if your external is set at 1.33 or 1.33000000000 then 1.33615 > 1.33
if your external is set at 1.34 or 1.33999999999 then 1.33615 < 1.34
A double has INFINITE number of digits (15 significant) both your external and Bid.
Patrick Burns
594
Patrick Burns 2014.08.15 09:38  
WHRoeder:
NotUnctuous: If the price was 1.33615 then it would matter, surely?
Again why do you think it matters?
if your external is set at 1.33 or 1.33000000000 then 1.33615 > 1.33
if your external is set at 1.34 or 1.33999999999 then 1.33615 < 1.34
A double has INFINITE number of digits (15 significant) both your external and Bid.


If I knew a double has infinite number of digits I wouldn't have asked. If that was explained somewhat earlier in the thread then I would have understood. Please bear in mind, mugs like me do not possess your depth of knowledge, hence why you have to kindly bother yourself to answer what appears to be inane questions. Thanks for your explanations.
/
To add comments, please log in or register