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 AttiM, 02-14-2024, 05:20 PM
|
11 responses
184 views
0 likes
|
Last Post Today, 09:28 AM | ||
Started by fernandobr, Today, 09:11 AM
|
1 response
3 views
0 likes
|
Last Post Today, 09:26 AM | ||
Started by timmbbo, Today, 08:59 AM
|
1 response
3 views
0 likes
|
Last Post Today, 09:16 AM | ||
Started by KennyK, 05-29-2017, 02:02 AM
|
2 responses
1,281 views
0 likes
|
Last Post
by marcus2300
Today, 09:13 AM
|
||
Started by itrader46, Today, 09:04 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:10 AM |
Comment