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
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.Chris L.NinjaTrader Customer Service
-
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 FilesChris L.NinjaTrader Customer Service
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 FilesChris L.NinjaTrader Customer Service
Comment
-
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by r68cervera, Today, 05:29 AM
|
0 responses
2 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
3 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,239 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
6 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment