Pivots with Fibs

AgentDoubleOhh

New member
Hi all!
I can't figure out the math on how to add Fibonacci's to this code. The red lines are R's, the light blue line is the PP, the green lines are the S's, the grey lines are the 50% fib or midpoint and the orange lines I drew with the fib tool in-between the PP and R1 and S1 and so on. How would I go about coding the Fibonacci's in-between the pivots. Please help, thank you!

P.S. @BenTen do you have something like this?


Code:
# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

defineGlobalColor("Mid Color", color.gray);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R3;
plot R2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R2;
plot R1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R1;
plot PP = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).PP;
plot S1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S1;
plot S2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S2;
plot S3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S3;
plot S4 = S3 - R2 + PP;
plot R4 = R3 + R2 - PP;

R4.setDefaultColor(color.red);
R3.setDefaultColor(color.red);
R2.setDefaultColor(color.red);
R1.setDefaultColor(color.red);
PP.setDefaultColor(color.cyan);
S1.setDefaultColor(color.green);
S2.setDefaultColor(color.green);
S3.setDefaultColor(color.green);
S4.setDefaultColor(color.green);

R4.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R2.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R1.setPaintingStrategy(paintingStrategy.HORIZONTAL);
PP.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S1.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S2.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S4.setPaintingStrategy(paintingStrategy.HORIZONTAL);

R4.setLineWeight(2);
R3.setLineWeight(2);
R2.setLineWeight(2);
R1.setLineWeight(2);
PP.setLineWeight(2);
S1.setLineWeight(2);
S2.setLineWeight(2);
S3.setLineWeight(2);
S4.setLineWeight(2);

plot PR1M = PP + (R1-PP)/2;
plot R1R2M = R1 + (R2-R1)/2;
plot R2R3M = R2 + (R3-R2)/2;
plot PS1M = PP - (PP-S1)/2;
plot S1S2M = S1 - (S1-S2)/2;
plot S2S3M = S2 - (S2-S3)/2;
plot R3R4M = R3 + (R4 - R3)/2;
plot S3S4M = S3 - (S3 - S4)/2;

PR1M.assignValueColor(GlobalColor("Mid Color"));
R1R2M.assignValueColor(GlobalColor("Mid Color"));
R2R3M.assignValueColor(GlobalColor("Mid Color"));
R3R4M.assignValueColor(GlobalColor("Mid Color"));
PS1M.assignValueColor(GlobalColor("Mid Color"));
S1S2M.assignValueColor(GlobalColor("Mid Color"));
S2S3M.assignValueColor(GlobalColor("Mid Color"));
S3S4M.assignValueColor(GlobalColor("Mid Color"));

PR1M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R1R2M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R2R3M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R3R4M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
PS1M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S1S2M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S2S3M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S3S4M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
 
Solution
Hi all!
I can't figure out the math on how to add Fibonacci's to this code. The red lines are R's, the light blue line is the PP, the green lines are the S's, the grey lines are the 50% fib or midpoint and the orange lines I drew with the fib tool in-between the PP and R1 and S1 and so on. How would I go about coding the Fibonacci's in-between the pivots. Please help, thank you!

P.S. @BenTen do you have something like this?


Code:
# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

defineGlobalColor("Mid Color", color.gray);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame =...
Hi all!
I can't figure out the math on how to add Fibonacci's to this code. The red lines are R's, the light blue line is the PP, the green lines are the S's, the grey lines are the 50% fib or midpoint and the orange lines I drew with the fib tool in-between the PP and R1 and S1 and so on. How would I go about coding the Fibonacci's in-between the pivots. Please help, thank you!

P.S. @BenTen do you have something like this?


Code:
# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

defineGlobalColor("Mid Color", color.gray);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R3;
plot R2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R2;
plot R1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R1;
plot PP = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).PP;
plot S1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S1;
plot S2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S2;
plot S3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S3;
plot S4 = S3 - R2 + PP;
plot R4 = R3 + R2 - PP;

R4.setDefaultColor(color.red);
R3.setDefaultColor(color.red);
R2.setDefaultColor(color.red);
R1.setDefaultColor(color.red);
PP.setDefaultColor(color.cyan);
S1.setDefaultColor(color.green);
S2.setDefaultColor(color.green);
S3.setDefaultColor(color.green);
S4.setDefaultColor(color.green);

R4.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R2.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R1.setPaintingStrategy(paintingStrategy.HORIZONTAL);
PP.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S1.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S2.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S4.setPaintingStrategy(paintingStrategy.HORIZONTAL);

R4.setLineWeight(2);
R3.setLineWeight(2);
R2.setLineWeight(2);
R1.setLineWeight(2);
PP.setLineWeight(2);
S1.setLineWeight(2);
S2.setLineWeight(2);
S3.setLineWeight(2);
S4.setLineWeight(2);

plot PR1M = PP + (R1-PP)/2;
plot R1R2M = R1 + (R2-R1)/2;
plot R2R3M = R2 + (R3-R2)/2;
plot PS1M = PP - (PP-S1)/2;
plot S1S2M = S1 - (S1-S2)/2;
plot S2S3M = S2 - (S2-S3)/2;
plot R3R4M = R3 + (R4 - R3)/2;
plot S3S4M = S3 - (S3 - S4)/2;

PR1M.assignValueColor(GlobalColor("Mid Color"));
R1R2M.assignValueColor(GlobalColor("Mid Color"));
R2R3M.assignValueColor(GlobalColor("Mid Color"));
R3R4M.assignValueColor(GlobalColor("Mid Color"));
PS1M.assignValueColor(GlobalColor("Mid Color"));
S1S2M.assignValueColor(GlobalColor("Mid Color"));
S2S3M.assignValueColor(GlobalColor("Mid Color"));
S3S4M.assignValueColor(GlobalColor("Mid Color"));

PR1M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R1R2M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R2R3M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
R3R4M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
PS1M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S1S2M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S2S3M.setPaintingStrategy(paintingStrategy.HORIZONTAL);
S3S4M.setPaintingStrategy(paintingStrategy.HORIZONTAL);


i added code lines at the end, for the 2 regions, on either side of pp line.
you can copy the code and change some variables for the other 6 regions


Code:
# pivot_fibs_00

#https://usethinkscript.com/threads/pivots-with-fibs.14069/
#Pivots with Fibs
# add Fibonacci's to pivot code

# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

DefineGlobalColor("Mid Color", Color.GRAY);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R3;
plot R2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R2;
plot R1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R1;
plot PP = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).PP;
plot S1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S1;
plot S2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S2;
plot S3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S3;
plot S4 = S3 - R2 + PP;
plot R4 = R3 + R2 - PP;

R4.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(Color.RED);
R1.SetDefaultColor(Color.RED);
PP.SetDefaultColor(Color.CYAN);
S1.SetDefaultColor(Color.GREEN);
S2.SetDefaultColor(Color.GREEN);
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.GREEN);

R4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

R4.SetLineWeight(2);
R3.SetLineWeight(2);
R2.SetLineWeight(2);
R1.SetLineWeight(2);
PP.SetLineWeight(2);
S1.SetLineWeight(2);
S2.SetLineWeight(2);
S3.SetLineWeight(2);
S4.SetLineWeight(2);

plot PR1M = PP + (R1 - PP) / 2;
plot R1R2M = R1 + (R2 - R1) / 2;
plot R2R3M = R2 + (R3 - R2) / 2;
plot PS1M = PP - (PP - S1) / 2;
plot S1S2M = S1 - (S1 - S2) / 2;
plot S2S3M = S2 - (S2 - S3) / 2;
plot R3R4M = R3 + (R4 - R3) / 2;
plot S3S4M = S3 - (S3 - S4) / 2;

PR1M.AssignValueColor(GlobalColor("Mid Color"));
R1R2M.AssignValueColor(GlobalColor("Mid Color"));
R2R3M.AssignValueColor(GlobalColor("Mid Color"));
R3R4M.AssignValueColor(GlobalColor("Mid Color"));
PS1M.AssignValueColor(GlobalColor("Mid Color"));
S1S2M.AssignValueColor(GlobalColor("Mid Color"));
S2S3M.AssignValueColor(GlobalColor("Mid Color"));
S3S4M.AssignValueColor(GlobalColor("Mid Color"));

PR1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1R2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2R3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3R4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PS1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1S2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2S3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3S4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

#---------------------------------


def fib1 = .236;
def fib2 = .382;
#def fib3 = .500;
def fib4 = .618;
def fib5 = .786;

#defineglobalcolor("c1", color.light_gray);
defineglobalcolor("c1", color.magenta);

# GlobalColor("c1")

#--------------------------------------
# r3 to r4

# copy pp to r1 and change some variables

#--------------------------------------
# r2 to r3

# copy pp to r1 and change some variables

#--------------------------------------
# r1 to r2

# copy pp to r1 and change some variables

#--------------------------------------
# pp to r1
plot r1_d = PP + ((R1 - PP) * fib5);
plot r1_c = PP + ((R1 - PP) * fib4);
plot r1_b = PP + ((R1 - PP) * fib2);
plot r1_a = PP + ((R1 - PP) * fib1);
r1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_d.SetDefaultColor(GlobalColor("c1"));
r1_c.SetDefaultColor(GlobalColor("c1"));
r1_b.SetDefaultColor(GlobalColor("c1"));
r1_a.SetDefaultColor(GlobalColor("c1"));
r1_d.SetStyle(Curve.MEDIUM_DASH);
r1_c.SetStyle(Curve.MEDIUM_DASH);
r1_b.SetStyle(Curve.MEDIUM_DASH);
r1_a.SetStyle(Curve.MEDIUM_DASH);


#--------------------------------------
#--------------------------------------

# PP to s1
plot s1_a = PP - ((PP - s1) * fib1);
plot s1_b = PP - ((pp - s1) * fib2);
plot s1_c = PP - ((pp - s1) * fib4);
plot s1_d = PP - ((pp - s1) * fib5);
s1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_a.SetDefaultColor(GlobalColor("c1"));
s1_b.SetDefaultColor(GlobalColor("c1"));
s1_c.SetDefaultColor(GlobalColor("c1"));
s1_d.SetDefaultColor(GlobalColor("c1"));
s1_a.SetStyle(Curve.MEDIUM_DASH);
s1_b.SetStyle(Curve.MEDIUM_DASH);
s1_c.SetStyle(Curve.MEDIUM_DASH);
s1_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s1 to s2

# copy pp to s1 and change some variables

#--------------------------------------
# s2 to s3

# copy pp to s1 and change some variables

#--------------------------------------
# s3 to s4

# copy pp to s1 and change some variables

#--------------------------------------


#

add 4 purple fib lines , within 2 regions,
from pp to r1 and from pp to s1
QeDA0ye.jpg
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

i added code lines at the end, for the 2 regions, on either side of pp line.
you can copy the code and change some variables for the other 6 regions


Code:
# pivot_fibs_00

#https://usethinkscript.com/threads/pivots-with-fibs.14069/
#Pivots with Fibs
# add Fibonacci's to pivot code

# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

DefineGlobalColor("Mid Color", Color.GRAY);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R3;
plot R2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R2;
plot R1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R1;
plot PP = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).PP;
plot S1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S1;
plot S2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S2;
plot S3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S3;
plot S4 = S3 - R2 + PP;
plot R4 = R3 + R2 - PP;

R4.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(Color.RED);
R1.SetDefaultColor(Color.RED);
PP.SetDefaultColor(Color.CYAN);
S1.SetDefaultColor(Color.GREEN);
S2.SetDefaultColor(Color.GREEN);
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.GREEN);

R4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

R4.SetLineWeight(2);
R3.SetLineWeight(2);
R2.SetLineWeight(2);
R1.SetLineWeight(2);
PP.SetLineWeight(2);
S1.SetLineWeight(2);
S2.SetLineWeight(2);
S3.SetLineWeight(2);
S4.SetLineWeight(2);

plot PR1M = PP + (R1 - PP) / 2;
plot R1R2M = R1 + (R2 - R1) / 2;
plot R2R3M = R2 + (R3 - R2) / 2;
plot PS1M = PP - (PP - S1) / 2;
plot S1S2M = S1 - (S1 - S2) / 2;
plot S2S3M = S2 - (S2 - S3) / 2;
plot R3R4M = R3 + (R4 - R3) / 2;
plot S3S4M = S3 - (S3 - S4) / 2;

PR1M.AssignValueColor(GlobalColor("Mid Color"));
R1R2M.AssignValueColor(GlobalColor("Mid Color"));
R2R3M.AssignValueColor(GlobalColor("Mid Color"));
R3R4M.AssignValueColor(GlobalColor("Mid Color"));
PS1M.AssignValueColor(GlobalColor("Mid Color"));
S1S2M.AssignValueColor(GlobalColor("Mid Color"));
S2S3M.AssignValueColor(GlobalColor("Mid Color"));
S3S4M.AssignValueColor(GlobalColor("Mid Color"));

PR1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1R2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2R3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3R4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PS1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1S2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2S3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3S4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

#---------------------------------


def fib1 = .236;
def fib2 = .382;
#def fib3 = .500;
def fib4 = .618;
def fib5 = .786;

#defineglobalcolor("c1", color.light_gray);
defineglobalcolor("c1", color.magenta);

# GlobalColor("c1")

#--------------------------------------
# r3 to r4

# copy pp to r1 and change some variables

#--------------------------------------
# r2 to r3

# copy pp to r1 and change some variables

#--------------------------------------
# r1 to r2

# copy pp to r1 and change some variables

#--------------------------------------
# pp to r1
plot r1_d = PP + ((R1 - PP) * fib5);
plot r1_c = PP + ((R1 - PP) * fib4);
plot r1_b = PP + ((R1 - PP) * fib2);
plot r1_a = PP + ((R1 - PP) * fib1);
r1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_d.SetDefaultColor(GlobalColor("c1"));
r1_c.SetDefaultColor(GlobalColor("c1"));
r1_b.SetDefaultColor(GlobalColor("c1"));
r1_a.SetDefaultColor(GlobalColor("c1"));
r1_d.SetStyle(Curve.MEDIUM_DASH);
r1_c.SetStyle(Curve.MEDIUM_DASH);
r1_b.SetStyle(Curve.MEDIUM_DASH);
r1_a.SetStyle(Curve.MEDIUM_DASH);


#--------------------------------------
#--------------------------------------

# PP to s1
plot s1_a = PP - ((PP - s1) * fib1);
plot s1_b = PP - ((pp - s1) * fib2);
plot s1_c = PP - ((pp - s1) * fib4);
plot s1_d = PP - ((pp - s1) * fib5);
s1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_a.SetDefaultColor(GlobalColor("c1"));
s1_b.SetDefaultColor(GlobalColor("c1"));
s1_c.SetDefaultColor(GlobalColor("c1"));
s1_d.SetDefaultColor(GlobalColor("c1"));
s1_a.SetStyle(Curve.MEDIUM_DASH);
s1_b.SetStyle(Curve.MEDIUM_DASH);
s1_c.SetStyle(Curve.MEDIUM_DASH);
s1_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s1 to s2

# copy pp to s1 and change some variables

#--------------------------------------
# s2 to s3

# copy pp to s1 and change some variables

#--------------------------------------
# s3 to s4

# copy pp to s1 and change some variables

#--------------------------------------


#

add 4 purple fib lines , within 2 regions,
from pp to r1 and from pp to s1
QeDA0ye.jpg
You are amazing, thank you so much!!! I’ll finish the script out tomorrow night and post it here. Thank you once again! 😁
 
And here it is! Thanks again @halcyonguy


Code:
# pivot_fibs_00

#https://usethinkscript.com/threads/pivots-with-fibs.14069/
#Pivots with Fibs
# add Fibonacci's to pivot code

# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

DefineGlobalColor("Mid Color", Color.GRAY);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R3;
plot R2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R2;
plot R1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R1;
plot PP = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).PP;
plot S1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S1;
plot S2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S2;
plot S3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S3;
plot S4 = S3 - R2 + PP;
plot R4 = R3 + R2 - PP;

R4.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(Color.RED);
R1.SetDefaultColor(Color.RED);
PP.SetDefaultColor(Color.CYAN);
S1.SetDefaultColor(Color.GREEN);
S2.SetDefaultColor(Color.GREEN);
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.GREEN);

R4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

R4.SetLineWeight(2);
R3.SetLineWeight(2);
R2.SetLineWeight(2);
R1.SetLineWeight(2);
PP.SetLineWeight(2);
S1.SetLineWeight(2);
S2.SetLineWeight(2);
S3.SetLineWeight(2);
S4.SetLineWeight(2);

plot PR1M = PP + (R1 - PP) / 2;
plot R1R2M = R1 + (R2 - R1) / 2;
plot R2R3M = R2 + (R3 - R2) / 2;
plot PS1M = PP - (PP - S1) / 2;
plot S1S2M = S1 - (S1 - S2) / 2;
plot S2S3M = S2 - (S2 - S3) / 2;
plot R3R4M = R3 + (R4 - R3) / 2;
plot S3S4M = S3 - (S3 - S4) / 2;

PR1M.AssignValueColor(GlobalColor("Mid Color"));
R1R2M.AssignValueColor(GlobalColor("Mid Color"));
R2R3M.AssignValueColor(GlobalColor("Mid Color"));
R3R4M.AssignValueColor(GlobalColor("Mid Color"));
PS1M.AssignValueColor(GlobalColor("Mid Color"));
S1S2M.AssignValueColor(GlobalColor("Mid Color"));
S2S3M.AssignValueColor(GlobalColor("Mid Color"));
S3S4M.AssignValueColor(GlobalColor("Mid Color"));

PR1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1R2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2R3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3R4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PS1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1S2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2S3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3S4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

#---------------------------------

def fib1 = .236;
def fib2 = .382;
#def fib3 = .500;
def fib4 = .618;
def fib5 = .786;

#defineglobalcolor("c1", color.light_gray);
DefineGlobalColor("c1", Color.MAGENTA);

# GlobalColor("c1")

#--------------------------------------
# r3 to r4

plot r4_d = R3 + ((R4 - R3) * fib5);
plot r4_c = R3 + ((R4 - R3) * fib4);
plot r4_b = R3 + ((R4 - R3) * fib2);
plot r4_a = R3 + ((R4 - R3) * fib1);
r4_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_d.SetDefaultColor(GlobalColor("c1"));
r4_c.SetDefaultColor(GlobalColor("c1"));
r4_b.SetDefaultColor(GlobalColor("c1"));
r4_a.SetDefaultColor(GlobalColor("c1"));
r4_d.SetStyle(Curve.MEDIUM_DASH);
r4_c.SetStyle(Curve.MEDIUM_DASH);
r4_b.SetStyle(Curve.MEDIUM_DASH);
r4_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# r2 to r3

plot r3_d = R2 + ((R3 - R2) * fib5);
plot r3_c = R2 + ((R3 - R2) * fib4);
plot r3_b = R2 + ((R3 - R2) * fib2);
plot r3_a = R2 + ((R3 - R2) * fib1);
r3_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_d.SetDefaultColor(GlobalColor("c1"));
r3_c.SetDefaultColor(GlobalColor("c1"));
r3_b.SetDefaultColor(GlobalColor("c1"));
r3_a.SetDefaultColor(GlobalColor("c1"));
r3_d.SetStyle(Curve.MEDIUM_DASH);
r3_c.SetStyle(Curve.MEDIUM_DASH);
r3_b.SetStyle(Curve.MEDIUM_DASH);
r3_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# r1 to r2

plot r2_d = R1 + ((R2 - R1) * fib5);
plot r2_c = R1 + ((R2 - R1) * fib4);
plot r2_b = R1 + ((R2 - R1) * fib2);
plot r2_a = R1 + ((R2 - R1) * fib1);
r2_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_d.SetDefaultColor(GlobalColor("c1"));
r2_c.SetDefaultColor(GlobalColor("c1"));
r2_b.SetDefaultColor(GlobalColor("c1"));
r2_a.SetDefaultColor(GlobalColor("c1"));
r2_d.SetStyle(Curve.MEDIUM_DASH);
r2_c.SetStyle(Curve.MEDIUM_DASH);
r2_b.SetStyle(Curve.MEDIUM_DASH);
r2_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# pp to r1

plot r1_d = PP + ((R1 - PP) * fib5);
plot r1_c = PP + ((R1 - PP) * fib4);
plot r1_b = PP + ((R1 - PP) * fib2);
plot r1_a = PP + ((R1 - PP) * fib1);
r1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_d.SetDefaultColor(GlobalColor("c1"));
r1_c.SetDefaultColor(GlobalColor("c1"));
r1_b.SetDefaultColor(GlobalColor("c1"));
r1_a.SetDefaultColor(GlobalColor("c1"));
r1_d.SetStyle(Curve.MEDIUM_DASH);
r1_c.SetStyle(Curve.MEDIUM_DASH);
r1_b.SetStyle(Curve.MEDIUM_DASH);
r1_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
#--------------------------------------

# PP to s1
plot s1_a = PP - ((PP - S1) * fib1);
plot s1_b = PP - ((PP - S1) * fib2);
plot s1_c = PP - ((PP - S1) * fib4);
plot s1_d = PP - ((PP - S1) * fib5);
s1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_a.SetDefaultColor(GlobalColor("c1"));
s1_b.SetDefaultColor(GlobalColor("c1"));
s1_c.SetDefaultColor(GlobalColor("c1"));
s1_d.SetDefaultColor(GlobalColor("c1"));
s1_a.SetStyle(Curve.MEDIUM_DASH);
s1_b.SetStyle(Curve.MEDIUM_DASH);
s1_c.SetStyle(Curve.MEDIUM_DASH);
s1_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s1 to s2

plot s2_a = S1 - ((S1 - S2) * fib1);
plot s2_b = S1 - ((S1 - S2) * fib2);
plot s2_c = S1 - ((S1 - S2) * fib4);
plot s2_d = S1 - ((S1 - S2) * fib5);
s2_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_a.SetDefaultColor(GlobalColor("c1"));
s2_b.SetDefaultColor(GlobalColor("c1"));
s2_c.SetDefaultColor(GlobalColor("c1"));
s2_d.SetDefaultColor(GlobalColor("c1"));
s2_a.SetStyle(Curve.MEDIUM_DASH);
s2_b.SetStyle(Curve.MEDIUM_DASH);
s2_c.SetStyle(Curve.MEDIUM_DASH);
s2_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s2 to s3

plot s3_a = S2 - ((S2 - S3) * fib1);
plot s3_b = S2 - ((S2 - S3) * fib2);
plot s3_c = S2 - ((S2 - S3) * fib4);
plot s3_d = S2 - ((S2 - S3) * fib5);
s3_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_a.SetDefaultColor(GlobalColor("c1"));
s3_b.SetDefaultColor(GlobalColor("c1"));
s3_c.SetDefaultColor(GlobalColor("c1"));
s3_d.SetDefaultColor(GlobalColor("c1"));
s3_a.SetStyle(Curve.MEDIUM_DASH);
s3_b.SetStyle(Curve.MEDIUM_DASH);
s3_c.SetStyle(Curve.MEDIUM_DASH);
s3_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s3 to s4

plot s4_a = S3 - ((S3 - S4) * fib1);
plot s4_b = S3 - ((S3 - S4) * fib2);
plot s4_c = S3 - ((S3 - S4) * fib4);
plot s4_d = S3 - ((S3 - S4) * fib5);
s4_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_a.SetDefaultColor(GlobalColor("c1"));
s4_b.SetDefaultColor(GlobalColor("c1"));
s4_c.SetDefaultColor(GlobalColor("c1"));
s4_d.SetDefaultColor(GlobalColor("c1"));
s4_a.SetStyle(Curve.MEDIUM_DASH);
s4_b.SetStyle(Curve.MEDIUM_DASH);
s4_c.SetStyle(Curve.MEDIUM_DASH);
s4_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------


#
 
Last edited:
And here it is! Thanks again @halcyonguy


Code:
# pivot_fibs_00

#https://usethinkscript.com/threads/pivots-with-fibs.14069/
#Pivots with Fibs
# add Fibonacci's to pivot code

# PivotPoints
# Revision 02/24/17
# Eric Purdy
# http://tos.mx/G18lxp

declare once_per_bar;

input showOnlyToday = No;
input timeFrame = {default "DAY", "WEEK", "MONTH"};

DefineGlobalColor("Mid Color", Color.GRAY);

plot R3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R3;
plot R2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R2;
plot R1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).R1;
plot PP = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).PP;
plot S1 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S1;
plot S2 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S2;
plot S3 = PivotPoints(showOnlyToday = showOnlyToday, timeFrame = timeFrame).S3;
plot S4 = S3 - R2 + PP;
plot R4 = R3 + R2 - PP;

R4.SetDefaultColor(Color.RED);
R3.SetDefaultColor(Color.RED);
R2.SetDefaultColor(Color.RED);
R1.SetDefaultColor(Color.RED);
PP.SetDefaultColor(Color.CYAN);
S1.SetDefaultColor(Color.GREEN);
S2.SetDefaultColor(Color.GREEN);
S3.SetDefaultColor(Color.GREEN);
S4.SetDefaultColor(Color.GREEN);

R4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

R4.SetLineWeight(2);
R3.SetLineWeight(2);
R2.SetLineWeight(2);
R1.SetLineWeight(2);
PP.SetLineWeight(2);
S1.SetLineWeight(2);
S2.SetLineWeight(2);
S3.SetLineWeight(2);
S4.SetLineWeight(2);

plot PR1M = PP + (R1 - PP) / 2;
plot R1R2M = R1 + (R2 - R1) / 2;
plot R2R3M = R2 + (R3 - R2) / 2;
plot PS1M = PP - (PP - S1) / 2;
plot S1S2M = S1 - (S1 - S2) / 2;
plot S2S3M = S2 - (S2 - S3) / 2;
plot R3R4M = R3 + (R4 - R3) / 2;
plot S3S4M = S3 - (S3 - S4) / 2;

PR1M.AssignValueColor(GlobalColor("Mid Color"));
R1R2M.AssignValueColor(GlobalColor("Mid Color"));
R2R3M.AssignValueColor(GlobalColor("Mid Color"));
R3R4M.AssignValueColor(GlobalColor("Mid Color"));
PS1M.AssignValueColor(GlobalColor("Mid Color"));
S1S2M.AssignValueColor(GlobalColor("Mid Color"));
S2S3M.AssignValueColor(GlobalColor("Mid Color"));
S3S4M.AssignValueColor(GlobalColor("Mid Color"));

PR1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1R2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2R3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3R4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PS1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1S2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2S3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3S4M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

#---------------------------------

def fib1 = .236;
def fib2 = .382;
#def fib3 = .500;
def fib4 = .618;
def fib5 = .786;

#defineglobalcolor("c1", color.light_gray);
DefineGlobalColor("c1", Color.MAGENTA);

# GlobalColor("c1")

#--------------------------------------
# r3 to r4

plot r4_d = R3 + ((R4 - R3) * fib5);
plot r4_c = R3 + ((R4 - R3) * fib4);
plot r4_b = R3 + ((R4 - R3) * fib2);
plot r4_a = R3 + ((R4 - R3) * fib1);
r4_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r4_d.SetDefaultColor(GlobalColor("c1"));
r4_c.SetDefaultColor(GlobalColor("c1"));
r4_b.SetDefaultColor(GlobalColor("c1"));
r4_a.SetDefaultColor(GlobalColor("c1"));
r4_d.SetStyle(Curve.MEDIUM_DASH);
r4_c.SetStyle(Curve.MEDIUM_DASH);
r4_b.SetStyle(Curve.MEDIUM_DASH);
r4_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# r2 to r3

plot r3_d = R2 + ((R3 - R2) * fib5);
plot r3_c = R2 + ((R3 - R2) * fib4);
plot r3_b = R2 + ((R3 - R2) * fib2);
plot r3_a = R2 + ((R3 - R2) * fib1);
r3_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r3_d.SetDefaultColor(GlobalColor("c1"));
r3_c.SetDefaultColor(GlobalColor("c1"));
r3_b.SetDefaultColor(GlobalColor("c1"));
r3_a.SetDefaultColor(GlobalColor("c1"));
r3_d.SetStyle(Curve.MEDIUM_DASH);
r3_c.SetStyle(Curve.MEDIUM_DASH);
r3_b.SetStyle(Curve.MEDIUM_DASH);
r3_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# r1 to r2

plot r2_d = R1 + ((R2 - R1) * fib5);
plot r2_c = R1 + ((R2 - R1) * fib4);
plot r2_b = R1 + ((R2 - R1) * fib2);
plot r2_a = R1 + ((R2 - R1) * fib1);
r2_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r2_d.SetDefaultColor(GlobalColor("c1"));
r2_c.SetDefaultColor(GlobalColor("c1"));
r2_b.SetDefaultColor(GlobalColor("c1"));
r2_a.SetDefaultColor(GlobalColor("c1"));
r2_d.SetStyle(Curve.MEDIUM_DASH);
r2_c.SetStyle(Curve.MEDIUM_DASH);
r2_b.SetStyle(Curve.MEDIUM_DASH);
r2_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# pp to r1

plot r1_d = PP + ((R1 - PP) * fib5);
plot r1_c = PP + ((R1 - PP) * fib4);
plot r1_b = PP + ((R1 - PP) * fib2);
plot r1_a = PP + ((R1 - PP) * fib1);
r1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
r1_d.SetDefaultColor(GlobalColor("c1"));
r1_c.SetDefaultColor(GlobalColor("c1"));
r1_b.SetDefaultColor(GlobalColor("c1"));
r1_a.SetDefaultColor(GlobalColor("c1"));
r1_d.SetStyle(Curve.MEDIUM_DASH);
r1_c.SetStyle(Curve.MEDIUM_DASH);
r1_b.SetStyle(Curve.MEDIUM_DASH);
r1_a.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
#--------------------------------------

# PP to s1
plot s1_a = PP - ((PP - S1) * fib1);
plot s1_b = PP - ((PP - S1) * fib2);
plot s1_c = PP - ((PP - S1) * fib4);
plot s1_d = PP - ((PP - S1) * fib5);
s1_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s1_a.SetDefaultColor(GlobalColor("c1"));
s1_b.SetDefaultColor(GlobalColor("c1"));
s1_c.SetDefaultColor(GlobalColor("c1"));
s1_d.SetDefaultColor(GlobalColor("c1"));
s1_a.SetStyle(Curve.MEDIUM_DASH);
s1_b.SetStyle(Curve.MEDIUM_DASH);
s1_c.SetStyle(Curve.MEDIUM_DASH);
s1_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s1 to s2

plot s2_a = S1 - ((S1 - S2) * fib1);
plot s2_b = S1 - ((S1 - S2) * fib2);
plot s2_c = S1 - ((S1 - S2) * fib4);
plot s2_d = S1 - ((S1 - S2) * fib5);
s2_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s2_a.SetDefaultColor(GlobalColor("c1"));
s2_b.SetDefaultColor(GlobalColor("c1"));
s2_c.SetDefaultColor(GlobalColor("c1"));
s2_d.SetDefaultColor(GlobalColor("c1"));
s2_a.SetStyle(Curve.MEDIUM_DASH);
s2_b.SetStyle(Curve.MEDIUM_DASH);
s2_c.SetStyle(Curve.MEDIUM_DASH);
s2_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s2 to s3

plot s3_a = S2 - ((S2 - S3) * fib1);
plot s3_b = S2 - ((S2 - S3) * fib2);
plot s3_c = S2 - ((S2 - S3) * fib4);
plot s3_d = S2 - ((S2 - S3) * fib5);
s3_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s3_a.SetDefaultColor(GlobalColor("c1"));
s3_b.SetDefaultColor(GlobalColor("c1"));
s3_c.SetDefaultColor(GlobalColor("c1"));
s3_d.SetDefaultColor(GlobalColor("c1"));
s3_a.SetStyle(Curve.MEDIUM_DASH);
s3_b.SetStyle(Curve.MEDIUM_DASH);
s3_c.SetStyle(Curve.MEDIUM_DASH);
s3_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------
# s3 to s4

plot s4_a = S3 - ((S3 - S4) * fib1);
plot s4_b = S3 - ((S3 - S4) * fib2);
plot s4_c = S3 - ((S3 - S4) * fib4);
plot s4_d = S3 - ((S3 - S4) * fib5);
s4_a.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_b.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_d.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
s4_a.SetDefaultColor(GlobalColor("c1"));
s4_b.SetDefaultColor(GlobalColor("c1"));
s4_c.SetDefaultColor(GlobalColor("c1"));
s4_d.SetDefaultColor(GlobalColor("c1"));
s4_a.SetStyle(Curve.MEDIUM_DASH);
s4_b.SetStyle(Curve.MEDIUM_DASH);
s4_c.SetStyle(Curve.MEDIUM_DASH);
s4_d.SetStyle(Curve.MEDIUM_DASH);

#--------------------------------------


#
nice job
 
Thread starter Similar threads Forum Replies Date
MP432 Fractal Pivots Indicator - Need help adding signal Questions 1
A AMM w/Trend Pivots Questions 2
Bingy Episodic Pivots Questions 0
R ATR Pivots Questions 2
Z 2nd & 3rd Order pivots Questions 2

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
449 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top