TIA
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Anchoring an Indicator to the start of a session
Collapse
X
-
Anchoring an Indicator to the start of a session
I created a horizontal histogram indicator that currently plots on the LH side of a chart. I'd like to anchor that histogram to the open of a session if the open is currently displayed on the chart. Can anyone point me to an indicator or some sample code that does this?
TIA -
Hello,
Thanks for the note.
Unfortunately this would require overriding Plot() to be able to do this. Which is unsupported NinjaScript territory. The is a sample on how to override the Plot() under Control Center->Tools->Strategies->SampleOverridePlot.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
-
Thanks Brett, I am already overriding Plot to create my horiz. histogram but have not figured out how to determine if the session open is on the chart and how to anchor the base of the histogram to the open when it is being plotted, ie - is the session open on the chart and how do I determine the x coord to start painting my histogram, both can likely be resolved with the same info.
I will also want to do the same for every session as I scroll back through the chart but that should be easy once I can get the last session to anchor as described (Create a class to handle the histogram paint and instantiate a new class for each session) .
Cheers,
Paul
Comment
-
Hello,
I understand. Yes I don't really have any idea's on how you would anchor it Unfortunately. If you don't know how to get the bar of the first bar of session let me know and I can send you this information though.
Otherwise I would not be able to further assist sorry.BrettNinjaTrader Product Management
Comment
-
Use FirstBarOfSession to key off the start of your drawing.Originally posted by paulca View PostThanks Brett, I am already overriding Plot to create my horiz. histogram but have not figured out how to determine if the session open is on the chart and how to anchor the base of the histogram to the open when it is being plotted, ie - is the session open on the chart and how do I determine the x coord to start painting my histogram, both can likely be resolved with the same info.
I will also want to do the same for every session as I scroll back through the chart but that should be easy once I can get the last session to anchor as described (Create a class to handle the histogram paint and instantiate a new class for each session) .
Cheers,
Paul
Comment
-
Thanks, that's the easy part. The more difficult prob. is how to determine if the open is currently visible on the chart and, if so, how to determine the chart X value to know where to start the plot. I'm looking to see if internal classes ChartControl and/or ChartHelper will give me what I need. If you have any other ideas I'm open to suggestions.Originally posted by koganam View PostUse FirstBarOfSession to key off the start of your drawing.
Comment
-
You can start with:Originally posted by paulca View PostThanks, that's the easy part. The more difficult prob. is how to determine if the open is currently visible on the chart and, if so, how to determine the chart X value to know where to start the plot. I'm looking to see if internal classes ChartControl and/or ChartHelper will give me what I need. If you have any other ideas I'm open to suggestions.
ChartControl.GetXByBarIdx(ChartControl.LastBarPain ted);
ChartControl.GetXByBarIdx(ChartControl.FirstBarPai nted);
Needless to say, they are unsupported.
You may also want to look in the code for the VolumeZones indicator. It pretty much does what you are trying to do, so you should be able to get some ideas in there.
Last edited by koganam; 05-24-2011, 04:24 PM.
Comment
-
Thanks, that was my initial code basis and have that (horizontal volume distribution histogram) working ok anchored to the left side of the chart, it was the anchoring to the open that I was having a problem with. Really appreciate the help, thanks again.Originally posted by koganam View PostYou may also want to look in the code for the VolumeZones indicator. It pretty much does what you are trying to do, so you should be able to get some ideas in there.
Comment
-
The shipping NT version of the Volume Profile works only with realtime data, and is erased if one loads the chart after market hours.
I was thinking of writing a version that stays on the chart, a la Market Profile, or Volume Profile from many other vendors. Is that perchance what you are currently writing?
Maybe, I can exchange something for it, once you are done? I really would rather not reinvent the wheel, if you know what I mean.
Comment
-
That's exactly what I am aiming for - the volume histogram only displays the last session and I need it to display on historical data for backtesting. I'd be happy to share once I have that working since a second pair of eyes looking at the code/chart is always a good thing. For example I currently highlight the PVP/POC on the chart & it's value is different from the value displayed by a PVP indicator downloaded from this forum.Originally posted by koganam View PostThe shipping NT version of the Volume Profile works only with realtime data, and is erased if one loads the chart after market hours.
I was thinking of writing a version that stays on the chart, a la Market Profile, or Volume Profile from many other vendors. Is that perchance what you are currently writing?
Maybe, I can exchange something for it, once you are done? I really would rather not reinvent the wheel, if you know what I mean.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment