Howdy, I have been working on several projects and I have hit a dead end multiple times on the account that I can't seem to get my custom indicator to display lines whose calculations contain division.
I created an example problem below. This following example attempts to find the percentage of a Candle's Close in relation to it's High and Lows; my problem arises from trying to divide and find percentages like such:
Preparing The Indicator:
Function:
If you can attempt this yourself, you will realize that there is no line to be seen but when I manually replace i in the buffer with an integer it plots a valid and true line so therefore the function is techincally spitting out a nice percentage double. I've tried type casting, trying to create my own bar counter as an alternative to i, and I even tested it in Comments and Text Object tests in EA's to prove I was getting a valid output. It seems the function has trouble when dealing with i. Anyone have an idea how I can fix this? It seems to be a bug and it's greatly hindering me from success. The division part of the function is the main culprit to look at because if you replace the division sign with any other arithmetic sign it produces a line easily. Please help.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Howdy, I have been working on several projects and I have hit a dead end multiple times on the account that I can't seem to get my custom indicator to display lines whose calculations contain division.
I created an example problem below. This following example attempts to find the percentage of a Candle's Close in relation to it's High and Lows; my problem arises from trying to divide and find percentages like such:
Preparing The Indicator:
Function:
If you can attempt this yourself, you will realize that there is no line to be seen but when I manually replace i in the buffer with an integer it plots a valid and true line so therefore the function is techincally spitting out a nice percentage double. I've tried type casting, trying to create my own bar counter as an alternative to i, and I even tested it in Comments and Text Object tests in EA's to prove I was getting a valid output. It seems the function has trouble when dealing with i. Anyone have an idea how I can fix this? It seems to be a bug and it's greatly hindering me from success. The division part of the function is the main culprit to look at because if you replace the division sign with any other arithmetic sign it produces a line easily. Please help.