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 ZenCortexCLICK, Today, 04:58 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 04:58 AM | ||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
172 responses
2,279 views
0 likes
|
Last Post
by sidlercom80
Today, 04:40 AM
|
||
Started by Irukandji, Yesterday, 02:53 AM
|
2 responses
17 views
0 likes
|
Last Post
by Irukandji
Today, 03:55 AM
|
||
Started by adeelshahzad, Today, 03:54 AM
|
0 responses
4 views
0 likes
|
Last Post
by adeelshahzad
Today, 03:54 AM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
3 responses
13 views
0 likes
|
Last Post Yesterday, 11:58 PM |
Comment