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
Highlight settlement in Price column on DOM
Collapse
X
-
Hello funk101,
Thanks for your post.
It is possible but would require custom coding through an indicator that could be added to the Superdom, however as an indicator it could only place a line at the settlement price level. In the custom indicator, you would add daily bars and then plot the close value of the bar (which would be the settlement price as the daily bars are adjusted to show the close as the settlement price).
If I understand correctly you are wanting to shade the superdom cell similar to how the daily High/Low markers do. I will write a feature request to add this capability to the superdom. I will update this thread when I have further information on the feature request.Paul H.NinjaTrader Customer Service
-
Getting a memory error on this "settlement" code...
Error:
Failed to call OnRender() for chart object 'Horizontal Line': 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
Code:protected override void OnMarketData(MarketDataEventArgs m) { if (m.MarketDataType == MarketDataType.Settlement) settlement = m.Price; Value[0] = settlement; Draw.HorizontalLine(this, "settlement", settlement, Brushes.Goldenrod); }
Comment
-
Hello funk101,
Thanks for your post.
Move your plot and draw statements into OnbarUpdate().
Alternatively, to getting the settlement price in that manner, you can just add a day bar series and access the close price as the close price should = settlement price of the daily bars. You can verify if this is the case by comparing the close price of the bar with the exchanges settlement price for the instrument of interest.Paul H.NinjaTrader Customer Service
Comment
-
Ok, so, this?
Code:...else if (State == State.Configure) { AddDataSeries(BarsPeriodType.Day, 1); }
Code:protected override void OnBarUpdate() { double settlement = BarsArray[1].GetClose(0); Value[0] = settlement; Print ("settlement: "+settlement); Draw.HorizontalLine(this, "settlement", settlement, Brushes.Goldenrod); }
Comment
-
Hello funk101,
Thanks for your reply.
If you are using Calculate.OnBarClose, use: double settlement = Closes[1][0]; // get prior day close/settlement.
If you are using Calculate.OnEachTick or Calculate.OnPriceChange, use: double settlement = Closes[1][1]; // get prior day close/settlement.
GetClose() is intended for chart bars in OnRender.
References:
Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Stanfillirenfro, Today, 07:23 AM
|
1 response
3 views
0 likes
|
Last Post Today, 07:37 AM | ||
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
2 responses
20 views
0 likes
|
Last Post Today, 07:24 AM | ||
Started by olisav57, Yesterday, 07:39 PM
|
1 response
9 views
0 likes
|
Last Post Today, 07:23 AM | ||
Started by cocoescala, 10-12-2018, 11:02 PM
|
7 responses
944 views
0 likes
|
Last Post
by Jquiroz1975
Today, 07:21 AM
|
||
Started by oviejo, Today, 12:28 AM
|
1 response
12 views
0 likes
|
Last Post Today, 07:20 AM |
Comment