because Top & Bottom = 0.00000
so
(Top+Bottom+Ask)/3
is the same like Ask / 3
hi
i'm having trouble with a basic indicator. it should only draw the pivot line the same way like a moving average line is drawn, but it will not work. it draws a horizontal line very far off from where it should be. please help me point out the mistake i've made, thanks!
i am pretty sure this line is mostly at fault: "Pivotbuffer[i] = Pivot;" but i can't seem to figure it out.... thanks!
The only thing that changes from bar to bar is what is inside your while loop, i.e.
Pivotbuffer[i] = Pivot;
So all the values for your Buffer will be the same . . .
The only thing that changes from bar to bar is what is inside your while loop, i.e.
So all the values for your Buffer will be the same . . .
yes, ive changed it to this:
Pivotbuffer[i] = (iHigh("EURUSD",0,iHighest(NULL,0,MODE_HIGH,PivotPeriod,i))+iLow ("EURUSD",0,iLowest (NULL,0,MODE_LOW,PivotPeriod,i))+Ask)/3;
and this is the result: http://i.imgur.com/uhuMC.png
the pivot indicator is the green dotted line. currently it has a period of 12 and is clearly very off and there are parts where it goes only horizontally for some strange reason?!
there are parts where it goes only horizontally for some strange reason?!
Why strange ? you are using iLowest and iHighest . . if the lowest and highest are the lowest and highest for a few bars why shouldn't you get the same values for a few bars and thus get a horizontal line ?
yeah, you are right. :) also, at the pivot calculation i removed the "+Ask" and added "+Close[i]", because i figured Ask is always the current price and so the earlier results would be always off. i think i just needed some sleep :D thanks for your help! it seems to work alright now

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi
i'm having trouble with a basic indicator. it should only draw the pivot line the same way like a moving average line is drawn, but it will not work. it draws a horizontal line very far off from where it should be. please help me point out the mistake i've made, thanks!
i am pretty sure this line is mostly at fault: "Pivotbuffer[i] = Pivot;" but i can't seem to figure it out.... thanks!