You are getting what is produced by your code, which is much the same as the upper line of a Donchian channel.
We don't know what logic you have used to place lines on your "expected" chart, so cannot advise anything.
KeepMarcos: What is wrong?? :(((
UpLine[i]=High[iHighest(NULL,NULL,MODE_HIGH,20,i)];
You are placing a dot on every bar at the last highest 20.
Your expected chart is to place a dot at the last highest 20 from there 12 back and 30 forward. You have no code to do that - that is what is wrong!

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
Hello my brothers.
I'm trying to make a indicator.
iHighest = 20 bars to get the highest price.
Now:
Expected:
What is wrong?? :(((
thank you so much!