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 581 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Second highest high

  #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?
REcommedations for programming help
Sierra Chart
Quantum physics & Trading dynamics
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
About a successful futures trader who didnt know anythin …
Psychology and Money Management
MC PL editor upgrade
MultiCharts
 
  #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 Twitter Reply With Quote




Last Updated on April 9, 2023


© 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