I am not a professional developer, but somehow I was able to juggle together the following NinjaSctipt indicator, which compiles without any errors.
It's just a modification of native NT8 "NetChangeDisplay" indicator, with the addition of the following features:
- Current day’s range (points / ticks).
- Calculate and display the range for the current session, displayed right next to the net change display, as “points / ticks”. For example, if I am looking at the ES (S&P E-Mini Futures), and the range for the current day (session) is 20 points, it will show as “20pt / 80t” (since 1 point = 4 ticks) for this instrument.
- Average range for the past number of days.
- Calculate and display the average range for the user defined past number of days (available as an indicator property), displayed right next to the “Current day’s range”, as “Nd = average / n%”, where:
- N = User defined number of days for the average calculation
- d = Simply an abbreviation for “day”
- average = average range in points
- n% = Percentage of the average, fulfilled by the current session.
- E.g., if the 20 day average in the ES is 50 points, and the current session range is 25 points, n% = 50 (since 25 is 50% of 50)
Putting it together:
Example of how a complete text string should look on my chart:
0.10% / (25pt / 100t) / (20d = 25pt / 100%)
- 0.10% = Net Change Display - already exists in the current indicator
- 25pt = Current day’s range in points
- 100t = Current day’s range in ticks
- 20d = Average range for the past 20 days
- 100% = Current session fulfillment of the average
All indicator properties remain unchanged, except for adding the following parameter:
Average Daily Range Number: (text field for numerical value input)
- E.g., If I type “20” into this text field, it will calculate the average for the past 20 days, and also display this value in “Nd” as a “20d”.
However, when applied to the chart in the current state, nothing happens ...
You can find the .cs file with the full code attached to this post.
Any ideas or suggestions are most welcome.
God bless.
Matt

Comment