Thanks,
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Plotting Prior Day settlement for NQ
Collapse
X
-
Plotting Prior Day settlement for NQ
Hi, I tried to make this indicator that would plot the prior day close (Settlement) at Hour 16 Minute 15. I use UniRenko bars and with session template 24 X 7. Just trying to find a way to plot the true settlement price from CME Futures RTH. The indicator dose not want to plot. Any help would be appreciated.
Thanks,Tags: None
-
Originally posted by woodyfox View PostHi, I tried to make this indicator that would plot the prior day close (Settlement) at Hour 16 Minute 15. I use UniRenko bars and with session template 24 X 7. Just trying to find a way to plot the true settlement price from CME Futures RTH. The indicator dose not want to plot. Any help would be appreciated.
Thanks,
The session template 24x7 is about the worst to use. It transforms five regular trading days into a Sunday afternoon session, 4 trading day shifted by a few hours and a truncated trading day on Friday. This will just turn out rubbish. Please use the preset trading hours template <instrument settings>.
NinjaTrader fails when loading a secondary bar series of daily data as you would do with other bar types that are set up intraday. Because of this failure, the NinjaTrader pivots indicator - which actually retrieves yesterday's settlement price - uses BarsArray[1].GetClose to access the settlement price. Please have a look at the code of the pivots indicator.
That said, the NinjaTrader pivots indicator also has a bug, as it only returns the correct settlement price in 97.5% of all days when applied to historical data.
Please find below links to indicators that all will display the correct settlement price for CME futures.
Daily pivots are calculated using the high, low and close from the previous day’s session, locating intraday support and resistance points.
The Daily Range Projections indicator displays support and resistance levels based on the volatility of the prior N days. The noise bands show how far noise trader typically drive prices. A breakout from these levels will indicate participation from higher timeframe traders, bringing Range Projections, i.e. profit target bands, into play.
Fibonacci levels refer to areas of support or resistance calculated by using the Fibonacci sequence, based on the prior day's high and low.
The indicators use BarsArray[1].GetClose for the case when not being connected, The code is somewhat difficult to grasp, but does the trick
Code:if(IsConnected()) { if(tradingDate0[0] > tradingDate1[0]) priorClose = currentDailyClose; else priorClose = priorDailyClose; } else // workaround { priorClose = currentHistoricalClose[1]; count = 0; priorDailyBarDate = BarsArray[1].GetTime(BarsArray[1].GetBar(Times[0][1])); dailyBarDate = BarsArray[1].GetTime(BarsArray[1].GetBar(Times[0][0])); if(priorDailyBarDate == dailyBarDate && BarsArray[1].Count - 2 > CurrentBars[1]) { while (priorDailyBarDate >= dailyBarDate) { count = count - 1; priorDailyBarDate = BarsArray[1].GetTime(BarsArray[1].GetBar(Times[0][1].AddDays(count))); if (count == -5) break; } priorClose = BarsArray[1].GetClose(BarsArray[1].GetBar(Times[0][1].AddDays(count))); } }
I am sorry, but this subject is one of the more complex ones.
-
Hello woodyfox,
Thank you for your note.
I have attached a sample indicator which will plot today's High of both its electronic and pit session. You could use this as a template for using session templates and plotting previous days values based on pit or electronic sessions.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_AlanP View PostHello woodyfox,
Thank you for your note.
I have attached a sample indicator which will plot today's High of both its electronic and pit session. You could use this as a template for using session templates and plotting previous days values based on pit or electronic sessions.
Please let us know if you need further assistance.
Thanks.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AdamDJ8, Today, 09:18 PM
|
0 responses
2 views
0 likes
|
Last Post
by AdamDJ8
Today, 09:18 PM
|
||
Started by knowmad, Today, 03:52 AM
|
2 responses
26 views
0 likes
|
Last Post
by knowmad
Today, 09:03 PM
|
||
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
8 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
||
Started by suroot, 02-25-2017, 04:43 AM
|
11 responses
2,553 views
0 likes
|
Last Post
by Zilvercat
Today, 05:36 PM
|
Comment