OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
Etherist

Member
25
Posts: 25

Joined: 6/9/2024
Location: South Australia

User Profile
 
Subject : RE: New 60-day high
Posted : 7/10/2024 10:02 PM
Post #32469 - In reply to #32468

Hey there Craig

From an OmniScan perspective, you could use: h > hhv(60)[1]



or use an Indicator as below:

Try out the attached code for something that might work for you.

=================================================================

1. Parameters:
- Length: Specifies the number of days to look back. Default is 60 days, adjustable from 1 to 365 days.

2. Script Explanation:
- Initialization:
- `HHigh`: Variable to store the highest high observed within the specified period.
- `Period`: Variable to hold the value of the parameter "Length" (number of days to look back).

- Finding Highest High:
- The script initializes `HHigh` to the lowest possible value (`L`).
- It loops through each day within the past `Period` days (`1` to `Period`).
- During each iteration, it compares the high price (`H`) of that day with `HHigh` and updates `HHigh` if `H` is higher.

- Comparison and Plotting:
- After determining the highest high (`HHigh`) over the past `Period` days, the script compares the current closing price (`C`) with `HHigh`.
- If the current price (`C`) is greater than `HHigh`, it plots the current price as "New 60-Day High" in green.
- Otherwise, it plots the current price as "Not a 60-Day High" in red.

3. Return Statement:
- The script returns the value of `HHigh`, which represents the highest high observed over the past `Period` days.

====================================================================

Cheers Etherist :-)




[Edited by Etherist on 7/10/2024 11:20 PM]

Attached file : 60DayHigh.txt (0KB - 62 downloads)
Attached file : 60 Day High.jpg (135KB - 151 downloads)
Attached file : 60 Day High OmniScan.jpg (50KB - 152 downloads)

Deleting message 32469 : RE: New 60-day high


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.