maybe the indicator buffer is the problem because it shows different result on the chart and to the alert
try changing the buffer you should start with zero first.
on the data window:
0 SuperTrend the buffer is = 0
Value 2 the buffer is = 1
Value 3 the buffer is = 2
Value 4 the buffer is = 3
Value 5 the buffer is = 4
Value 6 the buffer is = 5
Value 7 the buffer is = 6
i hope it works because that's the buffer that i follow when i use custom indicator
double TrendTest = iCustom(NULL, PERIOD_CURRENT, "super_trend", 10, 3,7,0); double TrendTest2 = iCustom(NULL, PERIOD_CURRENT, "super_trend", 10, 3,7,10);
Karl thanks for the reply but I thought of that aswell but that doesn't explain the difference!
Who can help please!!
Used script for retrieve the values from the different buffers (i = buffers ; j = bar number):
for(int i=6;i>=0;i--) { for(int j=2;j>=0;j--){ double TrendTest = iCustom(NULL, PERIOD_CURRENT, "super_trend", 10, 3,i,j); Print("TrentTest %i: ",TrendTest, " buffer: ",i, " bar:", j); Alert("TrentTest %i: ",TrendTest, " buffer: ",i, " bar:", j); } };
OnChart the supertrend value = 1.28029
with iCustom the supertrend value = 1.28015
Is there someone who can explain this. Is het possible that there's a difference in moment of calculation - so that there can be a slight difference in price in the current bar?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I know this is not a new question but I still don't get it how this can be. I need help.
I use iCustom to retrieve a result from a indicator. For example see the code below.
However, the result differs from the results the indicator shows on the Chart itself. How do I know what is right. Can any one please explain to me why they differ from each other? What do I miss?
Thanks a lot for the time and effort in answering this question.
Erik
<*.ex* file has been deleted>