(1) Do you want to display a 24 hour chart including night session or do you only want to display the day session?
(2) Do you want to use last or settlement for yesterday's close?
(3) Do you want to display ETH or RTH open?
Assumption: I assume that you want to
(1) display a 24 hour chart
(2) use the settlement price
(3) use the RTH open
Settlement can only be collected from daily data, RTH open can be only collected from intraday data by using an appropriate session template. So you need
(a) to set up an appropriate session template
(b) to connect to a daily data provider who was the settlement (for example Kinetick EOD)
(c) to code an indicator who does the trick.
(a) Session template for ES is attached.
(b) Data provider ?
(c) Indicator needs to be coded, but just to check you can use the SessionPivots indicator in DailyBars mode (default setting) as it will display yesterday's settlement, and the OpeningRange indicator in RTH mode / second (default setting), which will display today's open. If I merge the indicators and scrap the unwanted rest, they can jointly do what you are looking for. Chart is attached.
The following user says Thank You to Fat Tails for this post:
You are right 100%. That is exactly what I want. Let me go through this and give me some time to digest. My C# skills are not great compared to perl or other script based languages, so it would be a long haul for me to create this.
The Instruments I would like to calculate are ES, TF, CL, 6E, GC etc...
With TradeStation it shows it in the Time & Sales window (yesterdays settlement, so I can just calculate it).
Let me go over what you posted and give it some more thought. At the end of the day if I just had yesterdays settlement price in NinjaTrader, then it would be best. I guess I would pull that off a daily chart via EOD data feed from what you are saying.
I use Kinetick EOD (has the settlement price) and Interactive Brokers. I first-connect to Kinetick, so daily data is loaded from Kinetick, and then second-connect to Interactive Brokers, and my intraday-data comes from Interactive Brokers.
Nota: If you do this in SIM-Trading, you cannot execute orders, but it works in real trading or with the simulation account of Interactive Brokers.
Now the pivot indicator collects daily data -> you can look at the NinjaTrader default Pivots indicator how to do that and simply copy the code into your new indicator
For the RTH open you need to divide you trading day into 2 sessions. The open of the first bar of the second session is the value that you look for! So the logic goes as
if <new trading day> then do nothing (this is the Globex open)....
if (Bars.FirstBarOfSession), but not <new trading day>, then collect the open of the current bar....
The new trading day can be checked with Bars.GetTradingDayFromLocal(Time), you need to check the date of the current bar against the date of the previous bar
Have a look at the opening range indicator, it does follow this logic.