I am trying to write a EA and am stuck and need some help. Here is the actual formula I am trying to write a code for, but am unsuccessful in doing it. Pls help.
(sqrt(close[1]) + (10/180))^2
(sqrt(close[1]) + (10/180))^2
- 10/180 means 10 degrees
- sqrt(close[1]) means square root of the close value of the previous bar.
- ^2 the whole squared.
The Problems I am facing.
For example if the previous close is 1.34567
1. I have a five digit broker. So when I print close[1], I get a 4 digit value.
2. Many a times most the values are getting rounded off.
3. In excel if I punch in a whole number(which are the digits after the point like 34567) I get the correct answer. But when I type in the actual close which is 1.34567 I get some other answer.
So I need a formula that will compute it properly on MT4.
Thanks