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: 27

Joined: 6/9/2024
Location: South Australia

User Profile
 
Subject : RE: Omnilanguage Hi/Lo Question
Posted : 6/2/2025 5:30 AM
Post #32531 - In reply to #32230

Hello again there Lou

I had a closer look at your question, specifically the "calculate the 100 day high and 100 day low of the calculated result" aspect and suggest the following change to the Indicator, so that you are using the calculated Gann result and not the Price:

##############################################

#Indicator
#PARAM "NormPeriod",100,1,1000
#PARAM "HLPeriod",100,1,1000

Dim GannValue As Double
Dim GannMax As Double
Dim GannMin As Double
Dim GannNorm As Double
Dim High100 As Double
Dim Low100 As Double

' Example Gann calculation (replace with your actual formula)
GannValue = (H + L + C) / 3

' Normalize Gann result over NormPeriod bars
GannMax = HHV(GannValue, NormPeriod)
GannMin = LLV(GannValue, NormPeriod)

If (GannMax > GannMin) Then
GannNorm = 2 * ((GannValue - GannMin) / (GannMax - GannMin)) - 1
Else
GannNorm = 0
End If

' Now calculate the 100-bar high and low of the Gann result (not price)
High100 = HHV(GannValue, HLPeriod)
Low100 = LLV(GannValue, HLPeriod)

Plot("NormGann", GannNorm)
Plot("High100", High100)
Plot("Low100", Low100)

Return GannNorm

##########################################

Hope this more closely matches your needs ... Cheers again :-)


Deleting message 32531 : RE: Omnilanguage Hi/Lo Question


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