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
The True Mean Value of a Bar
Collapse
X
-
The True Mean Value of a Bar
Hi, I'm new to these posts hence excuse my ignorance if there is a quick and silly fix to the following; I use simple high low bars in some of my trading, I’m trying to plot the true mean of each bar plotted preferably as a small horizontal line at the mean price of each bar. I would then like to plot the horizontal line in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range. However I can not seem to get past step one which is getting a SMA to plot the mean of a single bar. For example if a bars range is 10-20 hence total range of 10 ticks the true mean should be at 15. I have set the simple MA indicator to plot the MA of 1 period hence I would expect a plot mid point at 15, however I do not get that result. It appears Ninja is defaulting to the close or last of the bar rather than the true mean. Is there a way of modifying this? -
Originally posted by FXBob View PostHi, I'm new to these posts hence excuse my ignorance if there is a quick and silly fix to the following; I use simple high low bars in some of my trading, I’m trying to plot the true mean of each bar plotted preferably as a small horizontal line at the mean price of each bar. I would then like to plot the horizontal line in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range. However I can not seem to get past step one which is getting a SMA to plot the mean of a single bar. For example if a bars range is 10-20 hence total range of 10 ticks the true mean should be at 15. I have set the simple MA indicator to plot the MA of 1 period hence I would expect a plot mid point at 15, however I do not get that result. It appears Ninja is defaulting to the close or last of the bar rather than the true mean. Is there a way of modifying this?
-
Koganam thanks for the tip, shall try that, however where do I find the price input type? I've checked Data Series and also Properties? Under Data series I only see the option of Price based on Last, Bid or Ask? no mean or median, the other thing is I like to see the full range off the bar when looking at the data.
Comment
-
Bertrand, thanks that worked a treat, looks good now. Anyone got any idea's on how to plot the secondary requirement on the price chart; a horizontal line (at the mean price) in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range.
Comment
-
Originally posted by FXBob View PostBertrand, thanks that worked a treat, looks good now. Anyone got any idea's on how to plot the secondary requirement on the price chart; a horizontal line (at the mean price) in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
191 views
0 likes
|
Last Post
by Hasadafa
Today, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,230 views
0 likes
|
Last Post Today, 08:07 PM | ||
Started by andrewtrades, Today, 04:57 PM
|
1 response
14 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
7 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
441 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
Comment