Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Current Range Bar possible High & Low Plot
Collapse
X
-
OK. I cleaned up the now defunct elements that you //'d out and also added in the ability to pick the colors.
I think I know the answer to this is 'no', but is it possible to make the -- bold? Apart from that, it looks fine, although again I'll have to wait for more active markets to ensure that it doesn't have the same problem as the original hash-plot approach.
( I also added in the top line that EDanny helped - although of course so did NT Josh and NT Bernard! )
It is now called RangeBarHighLow and if it works I suspect will be used by many Range Bar traders (if there are many Range Bar traders?).
Attached the code + a picture of how it looks - albeit in superslow night-time mkt condition.Last edited by cclsys; 08-13-2009, 11:15 PM.
-
eDanny. Thanks. That looks very promising - turning into text so it can be centred. I will run it tomorrow and see if it works consistently in live markets.
Why did you add in the if current bar < 1 ... return? What does that prevent? (Just trying to learn how to code better...)
Leave a comment:
-
This is a simple thing
Ok here is a working version, as far as I can see. Just add serialized variables for color selections and you are good to go. Just a different approach was all it took.Attached Files
Leave a comment:
-
Fine. Then I'll just leave it be as it is and when it works it is helpful and when it doesn't I will take it off the chart. I have no idea how to improve or fix it or further 'examine' it - which is why I brought this up here in the forum in the first place. We have been around several iterations and, after giving the code the ability to reference the Range Bar number which was very helpful, the original problem has remained throughout. If you say what I am attempting is impossible, I guess that is it, although I am still suspicious because most of the time it works exactly as intended, and only sometimes it doesn't.Originally posted by NinjaTrader_Josh View PostOnce a plot is set it is set. This is the proper behavior. Any behavior that is contrary to this is inaccurate behavior and you will need to examine your code to see what is causing it to go wrong. Your index out of range error just happens to be one capable of causing plots to disappear.
I still think this would be a good thing for Ninja users to have - assuming it works properly - but if it is not possible to code to work in a consistent fashion, so be it. On the other hand, it is possible that I started this from the wrong end - using Plots or whatever - and someone else could come up with the right way to effect this Indicator working consistently, in which case - again - it would be helpful for anyone using Ninja to trade Range Bar charts.
Sorry for the trouble, just assumed this was a simple thing that could be easily addressed by those with more knowledge of Ninja scripting.Last edited by cclsys; 08-13-2009, 03:27 PM.
Leave a comment:
-
Once a plot is set it is set. This is the proper behavior. Any behavior that is contrary to this is inaccurate behavior and you will need to examine your code to see what is causing it to go wrong. Your index out of range error just happens to be one capable of causing plots to disappear.
Leave a comment:
-
Josh, I am not into arguing for the sake of it, but if you run this Indicator during a period when there is an active market (i.e. not now), you will see the plots disappearing, so what you say above is simply not accurate.Originally posted by NinjaTrader_Josh View PostLook. Change the colors and you will see exactly what I am talking about. I see thin blue hash marks on the chart you claim doesn't have any. Conditions do not matter. Once a plot is set. It is set. When condition becomes false it doesn't matter. The plot has already been set and will remain set.
If you set the plot it will have the hashes. Its very simple. If you are using conditions to determine when to set, then it will simply draw the hashes whenever the condition is true. Once drawn, it is never removed. There is no "on now, off now" behavior. Once on it is always on.
'Once a plot is set. It is set. When condition becomes false it doesn't matter. The plot has already been set and will remain set.'
Also, I don't have so much a 'condition' as a command: 'if the range bar is complete... return'. Now obviously it is not always working, but it is not true what you say that a plot cannot disappear after it has been plotted because it happens again and again if you use the indicator.
What is not clear is why it works perfectly well on some charts and not on others. Your reply intimates that it is simply not possible for it to work, period.
But most of the time it does, so this reply does not get to the actual question/issue.Last edited by cclsys; 08-13-2009, 03:20 PM.
Leave a comment:
-
Look. Change the colors and you will see exactly what I am talking about. I see thin blue hash marks on the chart you claim doesn't have any. Conditions do not matter. Once a plot is set. It is set. When condition becomes false it doesn't matter. The plot has already been set and will remain set.
If you set the plot it will have the hashes. Its very simple. If you are using conditions to determine when to set, then it will simply draw the hashes whenever the condition is true. Once drawn, it is never removed. There is no "on now, off now" behavior. Once on it is always on.
Leave a comment:
-
There are NO historical hashes on the 'RP good' chart (nor for 90% of the charts when this indicator is applied). Can you see one? I can't.Originally posted by NinjaTrader_Josh View PostIncorrect. You have historical hashes on both pictures. If you change the color you will see them very easily.
Historical plot points do NOT disappear. Once you set them they will continue to plot. It works just like all other indicators. Please go try the SMA indicator for example. Switch the plot style to Hash and see all the historical hashes.
I understand about historical plots. But I have a condition:
If the high-low = the range bar amount: return. So any time the range bar is completed, there is no plot. Most of the time it works. Sometimes it doesn't but when it doesn't it seems to happen again and again throughout the chart loaded, although sometimes it is on occasional bars.
All you have to do is load it, try it on a few charts by changing the range bar amount. Doesn't take long to do. You will see that most of the time it works as it is supposed to - even though you say above that this is not possible - but on some charts it just doesn't work and again, sometimes it is every bar it doesn't work on, sometimes only occasional bars.
Mystery!
PS: on looking at the pics again I realised there might be confusion: there is a Donchian hash line plot on the not good charts, but this is a thinner line. The RProject lines are thick yellow and thick blue right on the bar lows or highs, not the other hashes that show trailing support/resistance. Sorry about that confusion.Last edited by cclsys; 08-13-2009, 02:56 PM.
Leave a comment:
-
Thanks. From reply I take it that you cannot use the Drawline language to effect a plot that is equivalent to a Hash line that is nicely centred above or below the current bar.Originally posted by NinjaTrader_Josh View PostNo. DrawLine() draws between two data points. From center mark to center mark. You can draw it exactly where you want based on the y-axis. Anywhere up or down. Left to right is determined by where the bars are.
It also seems that you cannot displace such line beyond the current bar, i.e. one (non-existent) bar to the right.
So using the Plot functions seems to be the best way. The issue remains: why does it work perfectly well on some charts but not on others or even more specifically, why does it work perfectly well on the TF 7 bar range but not 8, not 9, not 10, but on 11 or 2 or 3?Last edited by cclsys; 08-13-2009, 02:43 PM.
Leave a comment:
-
Incorrect. You have historical hashes on both pictures. If you change the color you will see them very easily.
Historical plot points do NOT disappear. Once you set them they will continue to plot. It works just like all other indicators. Please go try the SMA indicator for example. Switch the plot style to Hash and see all the historical hashes.
Leave a comment:
-
Finally, to clarify this I attach 2 pics, one with it working one with it not, both from right now.
Picture 1 ('RP not good') shows a TF 8 range with lots of previous bar plots.
Picture 2 ( 'RP good') shows a TF 5 range with no previous (and none current as the bar is complete; there were plots before , but as soon as the bar completed they disappeared as should be the case).
RP Good 7 range is the same chart as RP not good 8 range but changed to a 7-range chart. It is fine.Last edited by cclsys; 08-13-2009, 02:38 PM.
Leave a comment:
-
No. DrawLine() draws between two data points. From center mark to center mark. You can draw it exactly where you want based on the y-axis. Anywhere up or down. Left to right is determined by where the bars are.
Leave a comment:
-
Josh: thanks. I will access that link to see if I can learn.Originally posted by NinjaTrader_Josh View Postcclsys,
As stated, old plots DO NOT erase and SHOULD NOT erase. Once drawn they will stay drawn. It works the same how all other indicator plots work. If the plots are "erasing" that is erroneous and not the correct behavior.
The error you are receiving means you are accessing some value that does not exist and you need to address your code to fix it. The way to find where you are going wrong is to use try-catch blocks around places where you use [] index values. http://www.ninjatrader-support2.com/...ead.php?t=9825
No, DrawLine connects two points at the center, not a line across the center.
Could you please provide an example of a Drawline that ends up in the same position as a Hash Line Plot? Elsewhere you or Austin said you could get a Line to draw exactly where you say you want it. I want it the same as a Hash plot, i.e. centred above the current bar. Is that possible using the Draw language or not and if so, please provide an example. I suspect it is not possible but if it is am willing to try it.
Leave a comment:
-
cclsys,
As stated, old plots DO NOT erase and SHOULD NOT erase. Once drawn they will stay drawn. It works the same how all other indicator plots work. If the plots are "erasing" that is erroneous and not the correct behavior.
The error you are receiving means you are accessing some value that does not exist and you need to address your code to fix it. The way to find where you are going wrong is to use try-catch blocks around places where you use [] index values. http://www.ninjatrader-support2.com/...ead.php?t=9825
No, DrawLine connects two points at the center, not a line across the center.
Leave a comment:
-
Thanks: the only error I can see is this one:Originally posted by NinjaTrader_Josh View PostYou need to be more specific with what you mean by "goes wrong". Just draw the line and you will see how it behaves. Lines connect two data points together.
You should check your script for errors in the logs.
Error on calling the 'OnBarUpdate' method for indicator 'RangeBarProjectAuto' on bar 1644: Index was outside the bounds of the array.
That is from some time ago but that's the only one that came up today. I Have no idea what it means.
'goes wrong' means that old plots remain on old bars as shown in several pics on the thread.
To clarify : I attach a picture of it working well in that the current bar shows hash lines where the maximum possible high and low could end up, and no previous bars show anything. When you run it for a while and it is working, no previous bars show anything, only the current bar, and as soon as the Range Bar is 'complete', the hash lines go away. But sometimes they stay on the previous bars. That is the issue.
Secondary problem is : if switching to Drawline versus Plots, is there a way to get a line drawn in the same position as a Hash, i.e. centred, or even have it displaced one bar to the right/future? When I try displacing, there is no plot at all.Last edited by cclsys; 08-13-2009, 02:20 PM.
Leave a comment:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
51 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
31 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
||
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
165 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
100 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
160 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|

Leave a comment: