NexusFi: Find Your Edge


Home Menu

 





Trying to Create a Local Maximum Pivot Indicator using ThinkScript


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,802 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 2 attachments




 
Search this Thread

Trying to Create a Local Maximum Pivot Indicator using ThinkScript

  #1 (permalink)
SquillyD
El Paso Texas/USA
 
Posts: 2 since Apr 2014
Thanks Given: 0
Thanks Received: 0

Hello all,
I’ve been working on trying to create an indicator that would show a dot above a local maximum pivot point. I’m defining these pivot highs as a bar that has a higher high than the bar that came before it and the bar that comes after it.
If we define:

N – as the current (right from middle) bar,
N-1 – as the previously closed (middle) bar, and finally,
N-2 – as the bar to the left of the middle bar

Logically speaking, I’m thinking the code should be something similar to this:

N-1 > N and N-2

As the indicator is going through and looking over each set of 3 bars, it’s determining if the N-1 bar is greater than the N and N-2 bars. I’ve tried a number of ways to program this concept but no luck so far

There is probably many easy ways to accomplish this but I'm having trouble doing so.

Attached Thumbnails
Click image for larger version

Name:	NG_1.png
Views:	191
Size:	65.8 KB
ID:	186105  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Tao te Trade: way of the WLD
24 thanks
Spoo-nalysis ES e-mini futures S&P 500
21 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
SquillyD
El Paso Texas/USA
 
Posts: 2 since Apr 2014
Thanks Given: 0
Thanks Received: 0

The code for this actually turned out to be pretty simple to right! It took me a few hours though to figure out how to express this in the syntax:

plot pivotH_1st = high[-1] < high && high > high[1];
plot pivotL_1st = low[-1] > low && low < low[1];
pivotH_1st.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
pivotL_1st.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);


(Included image shows the results)

Now I want to take this script to the next level and use the 1st order pivot highs and lows as inputs for the 2nd order pivots. The logic in the first post explains (at least I think it does). How would I store the values of the 1st order pivots so that they can be used to calculate the second round of pivots? Any ideas would be greatly appreciated!

Attached Thumbnails
Click image for larger version

Name:	NG2.png
Views:	257
Size:	60.9 KB
ID:	186230  
Reply With Quote




Last Updated on July 2, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts