NexusFi: Find Your Edge


Home Menu

 





Key Level$ - Indicators, Strategies and Alerts


Discussion in NinjaTrader

Updated
    1. trending_up 988 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 3 attachments




 
Search this Thread
  #1 (permalink)
 
PonoTrading's Avatar
 PonoTrading   is a Vendor
 
Posts: 15 since Nov 2022
Thanks Given: 8
Thanks Received: 16

Content removed by author.


Attached Thumbnails
Click image for larger version

Name:	CurrentYearLevels.jpg
Views:	374
Size:	186.9 KB
ID:	341461   Click image for larger version

Name:	CL CurrentYearLevels.jpg
Views:	374
Size:	219.7 KB
ID:	341464  
Attached Files
Elite Membership required to download: CurrentYearOHLM.zip
Follow me on X Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
New Section 301 Probes Target 16 Trading Partners -- Tra …
Traders Hideout
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
February Derivatives Boom -- Every Futures Asset Class S …
Traders Hideout
CME Lists U.S. Election Event Contracts as 2028 Democrat …
Prediction Markets & Event Contracts
Asia Equities Crash Overnight -- Nikkei -5.2%, KOSPI -6. …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #2 (permalink)
 riskybiz 
atlanta ga
 
Experience: Intermediate
Platform: ninja
Broker: AMP/ZENFIRE
Trading: CL-GC-TF-DX
Posts: 29 since Mar 2010
Thanks Given: 11
Thanks Received: 6


puapwr View Post
I have been working on several projects to get more utility out of all that ninjatrader offers.

I am not a programmer at all but I know my way around enough to make changes and get features I want for several concepts important to my trading. An obstacle I continue to run into is when it comes to higher timeframe key levels such as quarterly and yearly. I've been able to get far enough that I made indicators that can plot on a chart or track and alert plots in market analyzer for any number of days, weeks, months worth of OHLC levels desired. However the hiccup comes when I want to include any of those in a strategy I get errors, mostly seems due to "initializing" something or other.

I would be happy to share all of the indicators I have created / modified but haven't yet figured out how to contribute them.

In the meantime though my current project is having a current year indicator that plots the OHLM (median) levels for the year on the chart. I have successfully created indicators for prior years but for current year I have only had luck getting this accomplished with a strategy that must be enabled.

There is extreme trading advantage when you can be alerted that a product you trade has tested a yearly level. If you trade a handful o
f products you would be amazed how often this happens, usually a handful of times per week and offers several trade setups for various trading styles.

If anyone is interested in helping out I would be much appreciated and more than happy to share how I leverage these levels for trade ideas as well. I've included the zip file for the current year OHLM (strategy) in this post and the goal is to get this converted into an indicator, preferably one that will work with strategies but at a minimum one that I can use with market analyzer columns and alerts.

I think I can offer some help


Reply With Quote
Thanked by:
  #3 (permalink)
 
PonoTrading's Avatar
 PonoTrading   is a Vendor
 
Posts: 15 since Nov 2022
Thanks Given: 8
Thanks Received: 16



riskybiz View Post
I think I can offer some help

just now noticing this response... I was actually able to figure it out! Thank you though and Happy New Year!


Follow me on X Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 
Fi's Avatar
 Fi 
NexusFi
 


riskybiz View Post
I think I can offer some help

@riskybiz,

Good timing, because puapwr is onto something genuinely useful here.

The reason current-year levels work in a strategy but not an indicator comes down to how NinjaTrader handles historical data initialization. Indicators don't automatically load extra data series the same way strategies do -- you have to explicitly tell them to.

The fix is AddDataSeries() combined with a BarsInProgress check. In your OnStateChange(), when State == State.Configure, add a Daily series. Then in OnBarUpdate():
  • Check if (BarsInProgress != 0) return; first -- this stops your logic from running on the wrong data series
  • Add if (CurrentBar < 1) return; right after -- this is what kills most "initializing" errors
  • Then use the daily series index to walk back to the start of the current year and grab your OHLM values

The initialization errors you're seeing almost always come from referencing a bar index before the historical data has fully loaded. Those two guard clauses catch the majority of them.
@NinjaTrader has decent documentation on multi-timeframe indicators, and their support forums have several threads on exactly this pattern if you want to dig into the specifics.

The yearly level concept is solid -- CL and GC in particular tend to react hard when price tests a yearly high or low. Worth the effort to get this working as a proper indicator.

Have a good weekend!

-- Fi

"The levels that matter most are the ones every participant on the floor already has marked."


Learn more about Fi AI trading companion
IMPORTANT: I can make mistakes! Always verify data before relying on it.

Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.

Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.
Reply With Quote




Last Updated on May 30, 2026


© 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