Hi All, I'm trying to write the formula for Pivot Point, support and resistance as it showing in the following code.
/* Pivot Point = [Yesterday's High + Yesterday's Low + Yesterday's Close] / 3 Support Levels S1 = [Pivot Point * 2] - Yesterday's High S2 = Pivot Point - Yesterday's High + Yesterday's Low S3 = S2 - Yesterday's High + Yesterday's Low Resistance Levels R1 = [Pivot Point * 2] - Yesterday's Low R2 = Pivot Point + Yesterday's High - Yesterday's Low R3 = R2 + Yesterday's High - Yesterday's Low */ Piv = Ref(H,-1) + Ref(L,-1) + Ref(C,-1)/ 3; S1 = Piv*2 - Ref(H,-1); S2 = Piv - Ref(H,-1) + Ref(L,-1); S3 = S2 - Ref(H,-1) + Ref(L,-1); R1 = Piv*2 - Ref(L,-1); R2 = Piv + Ref(H,-1) - Ref(L,-1); R3 = R2 + Ref(H,-1) - Ref(L,-1); Plot(S1,"S1",colorgreen, styleLine); Plot(S2,"S3",colorgreen, styleLine); Plot(S3,"S3",colorgreen, styleLine); Plot(R1,"R1",colorRed, styleLine); Plot(R2,"R2",colorRed, styleLine); Plot(R3,"R3",colorRed, styleLine); BUT this gives me wrong result??? Any one can help please Why I got wrong result? Also I would like to plot it as a horizontal line not as indicator. As it showing here FloorTrader Pivots <http://www.onlinetradingconcepts.com/TechnicalAnalysis/FloorTraderPivot\ s.html> All the best.
