Check out my post below to see how it seems to work perfectly on the ES chart but not on the TF.
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
Current Range Bar possible High & Low Plot
Collapse
X
-
Originally posted by NinjaTrader_Austin View Post
Check out my post below to see how it seems to work perfectly on the ES chart but not on the TF.
-
Originally posted by Jason11 View PostYes...that is what is showing up. We just need the hash marks on the current bar only, not all the previous bars like you can see on your chart.AustinNinjaTrader Customer Service
Comment
-
I did change everything as per your suggestion to Drawing Lines instead of a Plot, but the same problem persisted in that sometimes it was fine and sometimes not.
I take your suggestion about the Dot instead of a line if indeed it is not possible to position a line as one positions the Hash, although presumably somewhere there is coding that tells the Hash where to be plotted and if so, in theory, one should be able to replicate that with a line, no? If it is absolutely not possible, then okay, have to go with a dot. Problem with a dot: it is hard to see unless you make it big. A small but 2-thickness thick line works great, but much better as a hash mark centred above the current bar than a line drawn from the end of the last bar to the beginning of the current bar.
I did not remove the return condition when I put in the Drawlines coding, although in theory that should not matter. But I will try without that condition to see if it makes a difference.
The issue still remains: on many, many charts it works exactly as foreseen and desired, so even though you say it won't work, it actually does. But on some other charts it doesn't work. It would be nice to know the precise reason why sometimes it works and sometimes it doesn't rather than a general statement saying 'what you are doing is impossible' (even though most of the time it works fine).
Comment
-
well, I am just going to stick with the original version and use it for myself; it works 95% of the time fine. For charts where it doesn't work, won't use it.
I don't see any difference in plotting a line versus a plot. Removing the conditional code doesn't make a difference when plotting a line except that it doesn't plot at all for some reason.
So am sticking with the original and the problem will remain an unsolved mystery.
Plotting a Dot doesn't centre it above. It just plots little dots in exactly the same place as it plots a dash or a line. Adding in a displacement of 1 makes no difference either.
Pity: I think for those that trade with Range Bars this would be a handy addition. But unless the problem can be nailed down, it is not 100% consistent so cannot be recommended.Last edited by cclsys; 08-13-2009, 01:29 PM.
Comment
-
Originally posted by cclsys View Postwell, I am just going to stick with the original version and use it for myself; it works 95% of the time fine. For charts where it doesn't work, won't use it.
I don't see any difference in plotting a line versus a plot. Removing the conditional code doesn't make a difference when plotting a line except that it doesn't plot at all for some reason.
So am sticking with the original and the problem will remain an unsolved mystery.
Plotting a Dot doesn't centre it above. It just plots little dots in exactly the same place as it plots a dash or a line. Adding in a displacement of 1 makes no difference either.
Cclsys,
Hopefully we could get a solution to this...this is a great indicator for those of us who trade range bars. Thanks for your initial post!
I have a proprietary indicator (subscription) that does this same type of thing but it plots the hash mark on an indicator rather than price (Desert Soft -Woodie CCI Pattern recog indicator)
I know its possible for this to be done.... just cant figure it out.
Comment
-
Originally posted by NinjaTrader_Austin View PostJust to check in, I'm running the code posted near the beginning and everything looks fine to me. Is this what you guys are getting?
The second edition 'Auto' has the code seeing what the range bar setting is so you don't have to alter it manually.
Comment
-
Jason, thanks for encouragement. I too think this is worth getting right. It's not a big deal, but it is VERY handy.
For me there are two issues here:
1. Getting it right
2. Learning why it is not right and therefore simply: learning.
Thus far, unfortunately, we have not learned why on some charts it works exactly as it should and on others it doesn't. Clearly this is not a situation where what it being attempted is impossible because most of the time it works. Just sometimes it doesn't and we don't know why.
Josh: In terms of drawing it exactly where you want it: could you please supply a Drawline code example that plots a solid line in the same place as a Hash would be plotted? I have been unable to figure it out. If you place the first spot at 1 it starts at the previous bar. If you do 0....1 it doesn't plot at all. If you do 1....1, it doesn't plot. The only plot I get that works is 1...0 in which case it starts at 1 bar ago and ends up at the beginning of the current bar (as in plotting an indicator line). How to get it centred above the current plot eludes me. I have also tried 0.5's but it won't accept it.
I suspect that plotting a Hash is the way to go. The only issue is: how to get it to only plot on the current bar once the bar is complete. In working on this today I have put up several 2-range charts and seen the plots disappear AS SOON as the bar is complete, i.e. that very tick as it happens, so it doesn't need a second occurrence for the plot to be wiped out since in the code every time there is a new Close[0] the initial 'return' condition will erase the plot. Like I have said a few times, it works most of the time, but when it doesn't there is no apparent reason for it.
PS I now attach the latest Auto version with many lines disactivated but with both the Linedrawing and default Plot configurations just in case anyone on the forum wants to drill down into why there is this mysterious problem either way.Attached FilesLast edited by cclsys; 08-13-2009, 02:01 PM.
Comment
-
Originally posted by NinjaTrader_Josh View PostDrawLine(string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color)
DrawLine("line", 1, High[0], 0, High[0], Color.Blue)
The would draw a line segment at the current high price.
That is what I had in the Drawing Plots.
But as mentioned elsewhere in this (irritating little!) thread, the same problem exists with the Drawing option as with the Hash option in that sometimes it seems to get it wrong. Now perhaps that is due to certain elements in my original coding which was set up around Plots (made transparent when trying the Draw Line options) but the question remains:
How do you tell a Line to plot in the same place as a Hash plot, i.e. centred over the current bar? Your example does not do that.
Comment
-
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.
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.Josh P.NinjaTrader Customer Service
Comment
-
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.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by strategist007, Today, 07:51 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,967 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
55 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
6 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
Comment