Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
draw horizontal lines based on particular bar high low open close
Collapse
X
-
draw horizontal lines based on particular bar high low open close
Hi everyone. I'd like to know how I should go about creating an indicator that takes a range chart for instance, and for each session excluding the current session, draw horizontal lines on the ohlc of the bar with highest volume (of that session), I haven't been able to find similar indicators, and I'm having trouble visualizing the simplest wayTags: None
-
Hello sampras010,
Thank you for the post.
I am reviewing your inquiry and will be back with a reply shortly.
I look forward to assisting further.Last edited by NinjaTrader_ChrisL; 07-14-2017, 01:31 PM.
-
Hi Chris,
I'm still trying to get this to work. I tried first to change the color of the bar with highest volume for each session
with this code each higher bar till the highest bar are changed instead of just the highest volume bar
private double rede ;
protected override void OnBarUpdate()
{
rede = MAX(Volume, Bars.BarsSinceSession - 1)[0];
if ( Bars.FirstBarOfSession)
{
rede = 0;
}
if( Volume[0] == rede )
{
BarColor= Color.Yellow;
}
}
Comment
-
Hello sampras010,
Thank you for your patience.
The attached script will draw a ray from the OHL of the highest volume bar of all previous sessions loaded on your chart.
The script checks if the current working bar is the first updated bar of the session with Bars.IsFirstBarOfSession then draws a ray at the OHL of the highest volume of the previous session. CurrentBar keeps a count of the number of bars that have been processed. For example, if a chart has 100 bars of data, the very first bar of the chart (left most bar) will be number 0 (zero) and each subsequent bar from left to right is incremented by 1.
More on IsFirstBarOfSession here:
More on CurrentBar here:
If we may be of any further assistance, please let us know.Attached Files
Comment
-
-
Hello sampras010,
Thank you for the follow up.
This thread is in the NinjaTrader 8 Development forum, I thought you were using NinjaTrader 8. I will move the thread to the NinjaTrader 7 forum.
I have made a version for NinjaTrader 7 that you can try out.
If we may be of any further assistance, please let us know.Attached Files
Comment
-
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment