Multi Pivot Points For ThinkOrSwim

petertn

New member
Hi guys!

Can anyone convert this MACD+RSI TradingView Indicator into a TOS indicator? Here is the link to the author's indicator: https://www.tradingview.com/script/cVkA3yNg-Multi-Pivot-Points-All-in-One-Indicator/. It is an open-source code and I take no credit for this author's indicator and any usage of author's code is strictly for personal use.

This multi pivot indicator allows you to plot and overlay different types of pivot points from multiple different time frames:

-Fibonacci
-Floor Traders
-Camarilla

These pivot levels seems to be well respected by SPY from daily trading.

Thank you all for taking the time to view this post!
 

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

Hi guys!

Can anyone convert this MACD+RSI TradingView Indicator into a TOS indicator? Here is the link to the author's indicator: https://www.tradingview.com/script/cVkA3yNg-Multi-Pivot-Points-All-in-One-Indicator/. It is an open-source code and I take no credit for this author's indicator and any usage of author's code is strictly for personal use.

This multi pivot indicator allows you to plot and overlay different types of pivot points from multiple different time frames:

-Fibonacci
-Floor Traders
-Camarilla

These pivot levels seems to be well respected by SPY from daily trading.

Thank you all for taking the time to view this post!
find below

CSS:
# https://www.tradingview.com/v/cVkA3yNg/
# @FractalTrade15
#study("Multi Pivot Points", overlay = true)
# Converted by Sam4Cok@Samer800    - 10/2023
#//Functions
script fibrange {
    input pv = close;
    input rng = 0;
    input ratio = 0;
    def fibrange = pv + rng * ratio;
    plot out = fibrange;
}
script caml {
    input cl = close;
    input rg = 0;
    input mult = 1;
    def caml = cl + rg * 1.1 / mult;
    plot out = caml;
}

#//LTF Pivots
input TimeFrame = AggregationPeriod.DAY;     # "Time Frame"
input ShowOnlyLastPeriod = yes;              # "Show Only Last Period"
input showFibonacciPivotPoints = yes;        # "Fibonacci Pivot Points"
input showCamarillaPivotPoints = no;         # "Camarilla Pivot Points"
input showFloorTraderPivotPoints = no;       # "Floor Trader's Pivot Points"
#//Fib Levels
input fiboLevel1 = 0.236;
input fiboLevel2 = 0.382;
input fiboLevel3 = 0.500;
input fiboLevel4 = 0.618;
input fiboLevel5 = 0.786;


def na = Double.NaN;
def last = IsNaN(close);
def fibONLTF = showFibonacciPivotPoints;
def camONLTF = showCamarillaPivotPoints;
def ftrONLTF = showFloorTraderPivotPoints;
#--Color
DefineGlobalColor("Cam_R", CreateColor(41,98,255));
DefineGlobalColor("Cam_S", CreateColor(255,144,55));

def highLTF      = Fundamental(fundamentalType = FundamentalType.HIGH, Period = TimeFrame);
def lowLTF       = Fundamental(fundamentalType = FundamentalType.LOW,  Period = TimeFrame);
def closeLTF     = Fundamental(fundamentalType = FundamentalType.CLOSE,Period = TimeFrame);
def CloseLastLTF = !IsNaN(closeLTF) and !last;
def rangeLTF = (highLTF[1] - lowLTF[1]);
def pivotLTF = (highLTF[1] + lowLTF[1] + closeLTF[1]) / 3;

#/Floor Traders LTF
def bar = AbsValue(BarNumber());
def lastBar = if (closeLTF!=closeLTF[1]) then bar + 1 else lastBar[1];
def hiLastBar = bar >= highestAll(lastBar);
def islastLTF = if ShowOnlyLastPeriod then (hiLastBar and CloseLastLTF) else !last;

plot LastClose = if islastLTF then (if (pivotLTF-pivotLTF[1])!=0 then na else pivotLTF) else na;
LastClose.SetDefaultColor(Color.WHITE);
#--
def bcLTF = (highLTF[1] + lowLTF[1]) / 2;
def tcLTF = 2 * pivotLTF - bcLTF;
def r1LTF = 2 * pivotLTF - lowLTF[1];
def r2LTF = pivotLTF + rangeLTF;
def r3LTF = r1LTF + rangeLTF;
def r4LTF = r3LTF + (r2LTF - r1LTF);
def s1LTF = 2 * pivotLTF - highLTF[1];
def s2LTF = pivotLTF - rangeLTF;
def s3LTF = s1LTF - rangeLTF;
def s4LTF = s3LTF - (s1LTF - s2LTF);

plot R1 = if islastLTF and ftrONLTF and r1LTF > 0 then
         (if (r1LTF-r1LTF[1]) !=0 then na else r1LTF) else na;
plot R2 = if islastLTF and ftrONLTF and r2LTF > 0 then
         (if (r2LTF-r2LTF[1])!=0 then na else r2LTF) else na;
plot R3 = if islastLTF and ftrONLTF and r3LTF > 0 then
         (if (r3LTF-r3LTF[1])!=0 then na else r3LTF) else na;
plot R4 = if islastLTF and ftrONLTF and r4LTF > 0 then
         (if (r4LTF-r4LTF[1])!=0 then na else r4LTF) else na;
plot S1 = if islastLTF and ftrONLTF and s1LTF > 0 then
         (if (s1LTF-s1LTF[1])!=0 then na else s1LTF) else na;
plot S2 = if islastLTF and ftrONLTF and s2LTF > 0 then
         (if (s2LTF-s2LTF[1])!=0 then na else s2LTF) else na;
plot S3 = if islastLTF and ftrONLTF and s3LTF > 0 then
         (if (s3LTF - s3LTF[1])!=0 then na else s3LTF) else na;
plot S4 = if islastLTF and ftrONLTF and s4LTF > 0 then
         (if (s4LTF - s4LTF[1])!=0 then na else s4LTF) else na;
plot TC = if islastLTF and ftrONLTF and tcLTF > 0 then
         (if (tcLTF - tcLTF[1])!=0 then na else tcLTF) else na;
plot BC = if islastLTF and ftrONLTF and bcLTF > 0 then
         (if (bcLTF - bcLTF[1])!=0 then na else bcLTF) else na;
R1.SetDefaultColor(Color.Cyan);
R2.SetDefaultColor(Color.Cyan);
R3.SetDefaultColor(Color.Cyan);
R4.SetDefaultColor(Color.Cyan);
S1.SetDefaultColor(Color.MAGENTA);
S2.SetDefaultColor(Color.MAGENTA);
S3.SetDefaultColor(Color.MAGENTA);
S4.SetDefaultColor(Color.MAGENTA);
TC.SetDefaultColor(Color.YELLOW);
BC.SetDefaultColor(Color.YELLOW);
#//Fibonacci LTF

def fS1LTF = fibrange(pivotLTF, rangeLTF, -fiboLevel1);
def fS2LTF = fibrange(pivotLTF, rangeLTF, -fiboLevel2);
def fS3LTF = fibrange(pivotLTF, rangeLTF, -fiboLevel3);
def fS4LTF = fibrange(pivotLTF, rangeLTF, -fiboLevel4);
def fS5LTF = fibrange(pivotLTF, rangeLTF, -fiboLevel5);
def fR1LTF = fibrange(pivotLTF, rangeLTF, fiboLevel1);
def fR2LTF = fibrange(pivotLTF, rangeLTF, fiboLevel2);
def fR3LTF = fibrange(pivotLTF, rangeLTF, fiboLevel3);
def fR4LTF = fibrange(pivotLTF, rangeLTF, fiboLevel4);
def fR5LTF = fibrange(pivotLTF, rangeLTF, fiboLevel5);

plot fR1 = if islastLTF and fibONLTF and fR1LTF > 0 then
          (if (fR1LTF-fR1LTF[1])!=0 then na else fR1LTF) else na;
plot fR2 = if islastLTF and fibONLTF and fR2LTF > 0 then
          (if (fR2LTF-fR2LTF[1])!=0 then na else fR2LTF) else na;
plot fR3 = if islastLTF and fibONLTF and fR3LTF > 0 then
          (if (fR3LTF-fR3LTF[1])!=0 then na else fR3LTF) else na;
plot fR4 = if islastLTF and fibONLTF and fR4LTF > 0 then
          (if (fR4LTF-fR4LTF[1])!=0 then na else fR4LTF) else na;
plot fR5 = if islastLTF and fibONLTF and fR5LTF > 0 then
          (if (fR5LTF-fR5LTF[1])!=0 then na else fR5LTF) else na;
plot fS1 = if islastLTF and fibONLTF and fS1LTF > 0 then
          (if (fS1LTF-fS1LTF[1])!=0 then na else fS1LTF) else na;
plot fS2 = if islastLTF and fibONLTF and fS2LTF > 0 then
          (if (fS2LTF-fS2LTF[1])!=0 then na else fS2LTF) else na;
plot fS3 = if islastLTF and fibONLTF and fS3LTF > 0 then
          (if (fS3LTF-fS3LTF[1])!=0 then na else fS3LTF) else na;
plot fS4 = if islastLTF and fibONLTF and fS4LTF > 0 then
          (if (fS4LTF-fS4LTF[1])!=0 then na else fS4LTF) else na;
plot fS5 = if islastLTF and fibONLTF and fS5LTF > 0 then
          (if (fS5LTF-fS5LTF[1])!=0 then na else fS5LTF) else na;
fR1.SetDefaultColor(Color.GREEN);
fR2.SetDefaultColor(Color.GREEN);
fR3.SetDefaultColor(Color.GREEN);
fR4.SetDefaultColor(Color.GREEN);
fR5.SetDefaultColor(Color.GREEN);
fS1.SetDefaultColor(Color.RED);
fS2.SetDefaultColor(Color.RED);
fS3.SetDefaultColor(Color.RED);
fS4.SetDefaultColor(Color.RED);
fS5.SetDefaultColor(Color.RED);

#//Camarilla LTF
def H5LTF = (highLTF[1] / lowLTF[1]) * closeLTF[1];
def H4LTF = caml(closeLTF[1], rangeLTF, 2);
def H3LTF = caml(closeLTF[1], rangeLTF, 4);
def L3LTF = caml(closeLTF[1], -rangeLTF, 4);
def L4LTF = caml(closeLTF[1], -rangeLTF, 2);
def L5LTF = 2 * closeLTF[1] - H5LTF;

plot H5 = if islastLTF and camONLTF and H5LTF > 0 then
         (if (H5LTF-H5LTF[1])!=0 then na else H5LTF) else na;
plot H4 = if islastLTF and camONLTF and H4LTF > 0 then
         (if (H4LTF-H4LTF[1])!=0 then na else H4LTF) else na;
plot H3 = if islastLTF and camONLTF and H3LTF > 0 then
         (if (H3LTF-H3LTF[1])!=0 then na else H3LTF) else na;
plot L3 = if islastLTF and camONLTF and L3LTF > 0 then
         (if (L3LTF-L3LTF[1])!=0 then na else L3LTF) else na;
plot L4 = if islastLTF and camONLTF and L4LTF > 0 then
         (if (L4LTF-L4LTF[1])!=0 then na else L4LTF) else na;
plot L5 = if islastLTF and camONLTF and L5LTF > 0 then
         (if (L5LTF-L5LTF[1])!=0 then na else L5LTF) else na;
H5.SetDefaultColor(GlobalColor("Cam_R"));
H4.SetDefaultColor(GlobalColor("Cam_R"));
H3.SetDefaultColor(GlobalColor("Cam_R"));
L5.SetDefaultColor(GlobalColor("Cam_S"));
L4.SetDefaultColor(GlobalColor("Cam_S"));
L3.SetDefaultColor(GlobalColor("Cam_S"));


#-- END of CODE
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
305 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