We haven't built the charting library in house. The formula used for certain indicators is different across vendors of charting platforms.
On kite the code is:
size=0;
total=0;
pivotPoint=0;
high=0;
low=0;
prevHigh=0;
prevLow=0;
hlSpread=0;
RESET PIVOT:
pivotPoint = total/size;
prevHigh = high;
prevLow = low;
hlSpread = high - low;
size = total = high = low = 0;
for quote in quotes
total += (previousQuote.High + previousQuote.Low + previousQuote.Close)/3;
high = Math.max(high,previousQuote.High);
low = Math.min(low > 0 ? low
reviousQuote.Low, previousQuote.Low);
size++;
if new year or month or week or day:
RESET PIVOT
For fibonacci
Resistance 1 = pivotPoint + 0.382 * hlSpread;
Resistance 2 = pivotPoint + 0.618 * hlSpread;
Resistance 3 = pivotPoint + hlSpread;
Support 1 = pivotPoint - 0.382 * hlSpread;
Support 2 = pivotPoint - 0.618 * hlSpread;
Support 3 = pivotPoint - hlSpread;
For Standard
Resistance 1 = 2 * pivotPoint - prevLow;
Resistance 2 = pivotPoint + hlSpread;
Resistance 3 = pivotPoint +2 * hlSpread;
Support 1 = 2 * pivotPoint - prevHigh;
Support 2 = pivotPoint - hlSpread;
Support 3 = pivotPoint - 2 * hlSpread;