| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| How to code nearest round number level? https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3676 |
Page 2 of 2 |
| Author: | SteveHopwood [ Thu Jun 19, 2014 6:37 pm ] |
| Post subject: | How to code nearest round number level? |
Yes please - never know when I might need this in a multi-pair trader. I just tried, but simply replacing x / Point with x ^ factor doesn't always work, as in double pricetoInt = price / Point; double pricetoInt = price * factor; does not work in dsu's ea. It doesn't work in the risk-based calculation function either - never been able to work out why not. |
|
| Author: | Elixe [ Thu Jun 19, 2014 7:23 pm ] |
| Post subject: | How to code nearest round number level? |
Here you go, tell me if you have any issues, tested it with JPY, EUR & XAU, seems to be working fine There are no input, the script will write its resulting floor/ceil for 10, 100 & 1000 pips in the expert logs. |
|
| Author: | SteveHopwood [ Thu Jun 19, 2014 9:37 pm ] |
| Post subject: | How to code nearest round number level? |
Fantastic. Works a treat. Thanks. I have used your original code in dsu's ea at http://www.stevehopwoodforex.com/phpBB3 ... f=5&t=3695. I have updated the ea on my coding machine with your latest and future updates will include your this. |
|
| All times are UTC | Page 2 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|