Pivot indicator works well, need explanation based on code - ThinkOrSwim Programming | futures.io
futures io futures trading

Pivot indicator works well, need explanation based on code
Started: by jake0alexander Views / Replies:418 / 1
Last Reply: Attachments:0

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Pivot indicator works well, need explanation based on code

  #1 (permalink)
Elite Member
New York, New York, USA
Futures Experience: Intermediate
Platform: ThinkOrSwim
Favorite Futures: Stocks, Options, Futures
Posts: 5 since Jan 2015
Thanks: 2 given, 2 received

Pivot indicator works well, need explanation based on code

I just found a site that hasn't been updated in a while but had an interesting pivot indicator I wanted to check out. I threw it up on a few charts and it seems to work really well for futures but not so much for stocks. It looks like it calculates the previous days high and low as well as the over night high and low and creates pivots based on those (although it doesn't seem exact). That's just from looking though. I attempted to decipher some of the code, but I have zero knowledge there. I'd really appreciate if someone could explain to me exactly what this indicator does based on the code which you can find here...


TLDR; explain what this indicator does based on the code please

Reply With Quote
  #2 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
rmejia's Avatar
Posts: 384 since Oct 2010
Thanks: 3,596 given, 420 received

The meat of the code is this (the rest is mostly formatting: colors, linetype, hiding):

input _high  = 1043.75;
input _low   = 1033.50;
input settle = 1041.50;

    PP = (_high + _low + settle) / 3;
    R1 = (2 * PP) - _low;
    S1 = (2 * PP) - _high;
    R2 = PP + (r1 - s1);
    S2 = PP - (r1 - s1);
    R3 = _high + 2 * (PP - _low);
    S3 = _low - 2 * (_high - PP);

Inputs are what you manually enter, in this case it is 3 parameters, _high, _low & settle. Previous day, high, low and close.

For the plots there are 7:
PP = Pivot Point
R1 = Resistance 1
S1 = Support 1

The formula is just substituting the abbreviations for the numbers:
PP = (_high + _low + settle) / 3;

_high, _low & settle are the inputs you manually entered. It is adding them and then dividing by 3. That value is PP which is then plotted.

PP = (1043.75 + 1033.50 + 1041.50) / 3
PP = 1,039.58

It calculates PP first to use it on the next plot:

R1 = (2 * PP) - _low;

In this one it is multiplying 2 times the value of PP it just calculated, then subtracting that to the manual input _low.

R1 = (2 * 1,039.58) - 1033.50
R1 = 1,045.66

The rest is the same; just substituting the names (PP,R1,etc) for the values.

Reply With Quote
The following 2 users say Thank You to rmejia for this post:


futures io > > > > > Pivot indicator works well, need explanation based on code

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Tips and Tricks (part 2)

Mar 2

An Afternoon With FIO member @michaelleemoore

Elite only

Jigsaw Trading: Keys to successfully trading the open

Mar 9

Macro view: Trump Market Risk w/Piers Curran @ Amplify Trading

Elite only

Reading the Psychology of the Market w/Brett Steenbarger & Trading Technologies

Elite only

Hybrid Machine Learning (R and TradeStation) w/Murray Ruggiero

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only

Similar Threads
Thread Thread Starter Forum Replies Last Post
pivot point code... rmiller863 ThinkOrSwim 15 December 27th, 2015 11:00 PM
EL Trend Line based on Pivot Phillo82 EasyLanguage Programming 1 October 14th, 2013 11:45 AM
Help adding a Pivot Range to following code: olobay MultiCharts 3 September 18th, 2012 10:07 AM
MACD_Zero Lag Indicator Explanation GilR NinjaTrader 4 February 25th, 2011 07:36 AM
BMT CCI Pivot Zone easylanguage code for Market Delta? kienow Investor/RT 1 February 16th, 2011 03:37 PM

All times are GMT -4. The time now is 11:12 PM.

no new posts
Page generated 2017-02-27 in 0.13 seconds with 19 queries on phoenix via your IP