NexusFi: Find Your Edge


Home Menu

 





Second highest high


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one kjhosken with 1 posts (0 thanks)
    2. looks_two mborne77 with 1 posts (0 thanks)
    3. looks_3 badiboy with 1 posts (0 thanks)
    4. looks_4 mark91345 with 1 posts (0 thanks)
    1. trending_up 1,254 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
mark91345
Los Angeles, CA
 
Posts: 1 since Mar 2023
Thanks Given: 0
Thanks Received: 0

I am trying to find the second-highest high, every 42 days (every couple months).

If I use plot x = highest(high,42), that gives me the "first-highest" high, but that's not what I want.
Can anyone help?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CME Launches Bitcoin Volatility Futures June 1 -- First …
Cryptocurrency
Thanks Mike. Godspeed.
The Elite Circle
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
Probability Collapse: Bitcoin $150k Craters from 15% to …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
badiboy
BIRMINGHAM
 
Posts: 7 since Oct 2020
Thanks Given: 4
Thanks Received: 2

Is the 42 days always taken back from the current day? What happens in the previous 42 days set? Is there a second high for each set of 42 days looking back from current day?


Reply With Quote
  #3 (permalink)
mborne77
Charleston, SC USA
 
Posts: 3 since Mar 2023
Thanks Given: 3
Thanks Received: 0


I assume you dont want to do it manually by looking at the charts and drawing a line at the 2nd high?, ur lookin for a way to set the 2nd high automatically, correct?


Reply With Quote
  #4 (permalink)
 kjhosken 
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
Posts: 96 since Sep 2016
Thanks Given: 7
Thanks Received: 35

I'm pretty rusty on thinkscript, but this may at least give you seomthing to work on:

 
Code
def h42 = highest(high,42);
plot 2h42 = fold i = 0 to 42 with price = Double.NaN while IsNaN(price) do if getValue(high, i, 42) < h42 then getValue(high, i, 42) else Double.NaN;


Follow me on X Reply With Quote




Last Updated on April 9, 2023


© 2026 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 - Downloads - Top
no new posts