NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 08-17-2012, 04:09 PM   #16
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

cmaxb is referring to the RangeCounter with CoutnDown = false. Most replies I read assume CountDown = true which is not the case !

Quote:
Originally Posted by cmaxb View Post
which is the 'Countdown' setting when it is set to True. However, if it is set to not count down, I believe the range counter should tell you the difference between the high-and-the-low, for that bar, the "range".
cmaxb, if the RangeCounter indicator is set with CountDown = false it will display the distance between last tick and Low[0], or the distance between last tick and High[0]
whichever is largest.

What you want to do is create an indicator which does the following : ( High[0]-Low[0] ) / TickSize

Marco
Last edited by marcow; 08-17-2012 at 07:52 PM.
marcow is offline  
Reply With Quote
Old 08-17-2012, 05:21 PM   #17
stocktraderbmp
Senior Member
 
Join Date: Jun 2011
Location: Ireland
Posts: 184
Thanks: 32
Thanked 20 times in 19 posts
Default

Quote:
Originally Posted by marcow View Post
cmaxb is referring to the RangeCounter with CoutnDown = false. Most replies I read assume CountDown = true which is not the case !



cmaxb, if the RangeCounter indicator is set with CountDown = false it will:
- if current bar is a downbar it will diplay the range between High and last tick.
- if current bar is an upbar/nullbar it will diplay the range between Low and last tick.

What you want to do is create an indicator which does the following : ( High[0]-Low[0] ) / TickSize

Marco
I'm guessing that would be the 'Range' indicator then.

You know - the one that comes after PriorDayOHLC but before RangeCOUNTER in the indicator list !!
stocktraderbmp is offline  
Reply With Quote
Old 08-17-2012, 06:39 PM   #18
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

Quote:
I'm guessing that would be the 'Range' indicator then.

You know - the one that comes after PriorDayOHLC but before RangeCOUNTER in the indicator list !!
NO, not the range indicator. The range indicator displays Price and not Ticks.
you know the difference between those two ?
marcow is offline  
Reply With Quote
Old 08-17-2012, 07:07 PM   #19
stocktraderbmp
Senior Member
 
Join Date: Jun 2011
Location: Ireland
Posts: 184
Thanks: 32
Thanked 20 times in 19 posts
Default

Quote:
Originally Posted by marcow View Post
NO, not the range indicator. The range indicator displays Price and not Ticks.
you know the difference between those two ?
Marcow - I have no quarrel with you - I think your reply is pedantic - the code for the range indicator is :

Value.Set(High[0] - Low[0]);

So fine - it gives you a value that directly relates to the instruments price - if you are unable to determine how many ticks that is of the instrument you trade - imo you shouldn't be trading !!

My point was that Mr CmaxB has all he needs to get the answer he wants with out necessarily coding his own indicator. As he seems to be unable to grasp the concept of a range bar and the range counter - he is unlikely to be coding his own indicators, irrespective of how simple that may be in this example.

If you feel that I was rude to you I apologise.
stocktraderbmp is offline  
Reply With Quote
Old 08-17-2012, 08:00 PM   #20
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

not pedantic at all. That's what this discussion is all about. I cannot come up with an answer more transparant than this.

I'm answering cmaxb's initial question why the counter is going down when it is set to count up. Cmaxb is assuming the counter indicates the range of the current bar - which is high[0] - low[0], but instead the RangeCounter is displaying the distance in ticks between Close[0] and Low[0] , or Close[0] and High[0] , whichever is the largest.

Quote:
My point was that Mr CmaxB has all he needs to get the answer he wants with out necessarily coding his own indicator. As he seems to be unable to grasp the concept of a range bar and the range counter - he is unlikely to be coding his own indicators, irrespective of how simple that may be in this example.
You also came to this conclusion on post#11. At least give cmaxb time to read the new posts and take it in. I can imagine he is feeling somewhat attacked by your answers and doesn't want to post again to ask another "stupid" question.

Quote:
If you feel that I was rude to you I apologise.
No need to apologise, but in my opinion your answers to CmaxB where just a bit "rough around the edges"

ps. updated post#16 to match the explanation above in this post.

Marco
marcow is offline  
Reply With Quote
Old 08-17-2012, 08:41 PM   #21
sledge
Senior Member
 
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,179
Thanks: 178
Thanked 297 times in 255 posts
Question

I'm lost, so does this thread, "Range bar counter" have nothing to do with Range Bars?




Quote:
Originally Posted by marcow View Post
not pedantic at all. That's what this discussion is all about. I cannot come up with an answer more transparant than this.

I'm answering cmaxb's initial question why the counter is going down when it is set to count up. Cmaxb is assuming the counter indicates the range of the current bar - which is high[0] - low[0], but instead the RangeCounter is displaying the distance in ticks between Close[0] and Low[0] , or Close[0] and High[0] , whichever is the largest.



You also came to this conclusion on post#11. At least give cmaxb time to read the new posts and take it in. I can imagine he is feeling somewhat attacked by your answers and doesn't want to post again to ask another "stupid" question.


No need to apologise, but in my opinion your answers to CmaxB where just a bit "rough around the edges"

ps. updated post#16 to match the explanation above in this post.

Marco
sledge is offline  
Reply With Quote
Old 08-17-2012, 08:50 PM   #22
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

no, this thread is about the RangeCounter indicator, with Count down set to false.

Cmaxb's initial question was about -for him- unexpected behaviour of the RangeCounter indicator. The whole range bar thing was introduced by repliers implying it was sort of a dumb question and that he had to study the principles of Range Bars.
marcow is offline  
Reply With Quote
The following user says thank you to marcow for this post:
Old 08-27-2012, 09:38 PM   #23
cmaxb
Member
 
Join Date: Mar 2008
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default

Can somebody tell me, how the range counter could show 4, in this chart ?

http://i.imgur.com/w9zrT.png
cmaxb is offline  
Reply With Quote
Old 08-27-2012, 10:00 PM   #24
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
Default

So we can better analyze your chart, can you please put the "range" indicator on your chart and put this on CalculateOnBarClose = false.

This should show us exactly what the range of the current bar is vs what the range counter is reporting.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-27-2012, 10:08 PM   #25
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

Why is that second last bar so small, that is nowhere 10 ticks long, was this the last bar of a session ? And is the last bar the first bar of a new session ? I can imagine that there was a price spike at session open, which caused the last bar to complete, but the indicator needs a new incoming tick to update ?
marcow is offline  
Reply With Quote
The following user says thank you to marcow for this post:
Old 08-27-2012, 10:17 PM   #26
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
Default

The one bar is this size due to it being the end of session
Attached Images
File Type: png range.PNG (78.7 KB, 13 views)
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-27-2012, 10:24 PM   #27
cmaxb
Member
 
Join Date: Mar 2008
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by marcow View Post
Why is that second last bar so small, that is nowhere 10 ticks long, was this the last bar of a session ? And is the last bar the first bar of a new session ? I can imagine that there was a price spike at session open, which caused the last bar to complete, but the indicator needs a new incoming tick to update ?

1) yes
2) yes
3) this bar started at the new session, and was one tick away (down) from starting the next bar, the range was actually ten at that point.
cmaxb is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
range bar tick counter upsndowns Indicator Development 3 08-01-2010 08:20 AM
bar counter agd108 Indicator Development 1 05-19-2009 05:23 AM
Bar counter pgabriel General Programming 1 09-27-2008 09:55 AM
Range Counter Bug? blinker Historical NinjaTrader 6.5 Beta Threads 3 02-12-2008 10:59 AM
Range counter - request ggloor Historical NinjaTrader 6.5 Beta Threads 1 01-20-2008 08:32 AM


All times are GMT -6. The time now is 10:37 PM.