This file is taken from a past Pivot of SPX.
I need your help to convert it to ES pivot but using SPX.
Because I trade in ES, the converted pivot came from SPX and by adding the average difference of the two
a new ES Pivot Point will emerge.
So the SPX Pivot value is taken first , R3 ,R2, R1, PP, S1, S2, S3 .
Then there will be a box where I could input the difference of SPX and ES,
and the final Pivot Points will be converted to ES equivalent to this addition and will be drawn in the chart.
https://usethinkscript.com/threads/tos-pivot-points-indicator-for-thinkorswim.4860/
I need your help to convert it to ES pivot but using SPX.
Because I trade in ES, the converted pivot came from SPX and by adding the average difference of the two
a new ES Pivot Point will emerge.
So the SPX Pivot value is taken first , R3 ,R2, R1, PP, S1, S2, S3 .
Then there will be a box where I could input the difference of SPX and ES,
and the final Pivot Points will be converted to ES equivalent to this addition and will be drawn in the chart.
https://usethinkscript.com/threads/tos-pivot-points-indicator-for-thinkorswim.4860/
Code:
# Traditional Pivot Points
# Assembled by BenTen at UseThinkScript.com
# Based on the formula from https://www.tradingview.com/support/solutions/43000521824-pivot-points-standard/
input aggregationPeriod = AggregationPeriod.DAY;
def HIGHprev = high(period = aggregationPeriod)[1];
def LOWprev = low(period = aggregationPeriod)[1];
def CLOSEprev = close(period = aggregationPeriod)[1];
plot PP = (HIGHprev + LOWprev + CLOSEprev) / 3;
plot R1 = PP * 2 - LOWprev;
plot S1 = PP * 2 - HIGHprev;
plot R2 = PP + (HIGHprev - LOWprev);
plot S2 = PP - (HIGHprev - LOWprev);
plot R3 = PP * 2 + (HIGHprev - 2 * LOWprev);
plot S3 = PP * 2 - (2 * HIGHprev - LOWprev);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);