I needed for a strategy to get the geometric distance between 2 points. The platform does not provide the api of the ruler tool. So I implemented the function as an indicator and here is the code I share with you. This is not really an indicator but rather a utility function for developers. See below:
When you take the tool ruler, the result of the tool displays a grey box with a distance value expressed in decimal number followed by a percentage which represents the difference between 2 points.
The “GeomDistance” function calculates the decimal value that depends on the configuration of your user interface.
Hmm, so it depends only of price? Why not a simple division between 2 prices? as the X coordinates isn’t needed in this case. Anyway, this is useful function, thank you 🙂
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue