Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
-
int highest = iHighest(NULL,0,MODE_HIGH,BarsBack,1); int lowest = iLowest(NULL,0,MODE_LOW,BarsBack,1);
Why are you looking at bar one, and storing the result in all bars (i). - Your lookback is BarsBack. Do your lookbacks correctly.
William Roeder:
- Why are you looking at bar one, and storing the result in all bars (i).
- Your lookback is BarsBack. Do your lookbacks correctly.
Hi William,
Thanks very much for your time. I suspected it was something small that I was overlooking.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi everyone,
I am a long time reader, new poster, so please be gentle.
This is the first indi that I have tried to write from scratch as I always pay for the service and then tinker with the code after, but I figured that it can't be that difficult for such a simple indi.
I am try to create a momentum/range indicator by plotting the price difference between the iHighest and iLowest of X bars back and if the price is over a specific value then to mark it as trending and if not then the market is ranging. (This works rather well on renko charts.)
What I am getting is that the same value (the latest value) is plotted for the entire indi. I have looked at different indicators to try and figure this out, but I must either be missing something very small which I do not see, or something fundamental is amiss.
Any help would be highly appreciated.