Range Bar Time - NinjaTrader Programming | futures io social day trading
futures io futures trading


Range Bar Time
Updated: Views / Replies:7,234 / 19
Created: by zeller4 Attachments:7

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 7  
 
Thread Tools Search this Thread
 

Range Bar Time

  #11 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 received


sefstrat View Post
Here is how I do it:

 
Code
TimeSpan span = Bars.GetTime(CurrentBar) - Bars.GetTime(CurrentBar -1);              
 
series.Set(span.TotalMinutes);


hey sefstrat,
i've started to look at this again, the "span" works

what would you do if you want the previous bar'sspan? I tried this but it gives
 
Code

TimeSpan span1 = Bars.GetTime(CurrentBar-1) - Bars.GetTime(CurrentBar -2);
error message is:
 
Code
                            
Error on calling the 'OnBarUpdate' method for indicator 'A_1_Range_Time_v01' on bar 1Bar index needs to be greater/equal 0 

thanks for your help

Attached Files
Register to download File Type: cs A_1_Range_Time_v01.cs (8.4 KB, 72 views)
Reply With Quote
The following user says Thank You to zeller4 for this post:
 
  #12 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

add this on barupdate() methode at the begin:

if(CurrentBar < 5) return;

so your barindex would be greater than 0 ... 4

Reply With Quote
The following 2 users say Thank You to wh for this post:
 
  #13 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 received


thanks wh
can't believe i let that elementary problem get me like that


thanks again
kz

Reply With Quote
 
  #14 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

That's what happens when you go on vacation...

Reply With Quote
 
  #15 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Currencies
 
hondo69's Avatar
 
Posts: 165 since Jun 2009
Thanks: 57 given, 240 received

I like your idea and have had similar thoughts for an indicator such as this. But my idea would plot the reverse of what you have so that range bars that plot very fast would cause the indicator to rise, like a speedometer.

My idea is to capture quick market moves and turn it into an auto trader. These are the times when the market moves so quickly there is not time to enter orders manually. In the image below I've superimposed the proposed indicator onto the price panel, even though it would be in Panel 2.

Start with a 2 range chart
Have the indicator calculate average time per bar

You might set the Period to 50, for example, and it would average the time per bar over the past 50 bars. Let's say that value is 20 seconds.

You'd then have 20 seconds be the zero line of the indicator. As each new bar forms it divides that average by the time of each new bar.

When a fast move appears, it would cause the indicator to spike. As shown in the image below, that spike would be caused by bars that plot every 1 or 2 seconds. The spike data would be something like this:

20/1, 20/2, 20/1, 20/1, 20/1, 20/2, 20/1, 20/1, etc.

For an auto trader strategy, you'd look for the indicator to rise above some value (10, for example) then go long. Set the target for 5 pips or so. You'd be able to benefit from quick moves that manual traders would miss.

The trick would be having the indicator detect if the market is rising or falling. Without this detection, it would spike in both rising and falling markets.

Attached Thumbnails
Range Bar Time-2_range_speed.jpg  
Reply With Quote
 
  #16 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
 
sefstrat's Avatar
 
Posts: 285 since Jun 2009
Thanks: 20 given, 749 received

If you try to implement this I think you will find that it is much more difficult than it seems it would be.

First off there are many, many small quick spikes in any given day.. on a 2 range chart in an active market you may have a 4-5 bar spike where they are all within 1 second of each other several times within an hour, that alone would set off your 20 second filter. Also you will find that many times there will be a very fast turnaround, ie 4 downbars then 2 upbars all within the same second or two, then it stalls.. how do you determine direction in that case? Generally it is just as likely to immediately continue down as it is to be a tradeable pullback. It is possible to create a good filter for these kind of trades but in my experience it is not easy.

Then you have to worry about slippage, I don't think such a strategy would be feasible without using limit orders.. if you enter market orders there will be many occasions where you get filled at the bottom of a stop hunt and immediately stopped out (likely with slippage on the exit also, in a very fast market you can easily rack up 5-10 ticks slippage beyond your stop limit, even more in some news release scenarios)

I spent quite a while working on a strategy like this, and I did get it working to some degree.. but in the end I abandoned it because it was not worth the effort, there are much easier ways to create an automated strategy.

That said, monitoring the time between bars is quite useful and I do still use it, but only as a secondary criteria. IMO it is most useful for detecting stop hunts and then jumping in once it reverses.


hondo69 View Post
I like your idea and have had similar thoughts for an indicator such as this. But my idea would plot the reverse of what you have so that range bars that plot very fast would cause the indicator to rise, like a speedometer.

My idea is to capture quick market moves and turn it into an auto trader. These are the times when the market moves so quickly there is not time to enter orders manually. In the image below I've superimposed the proposed indicator onto the price panel, even though it would be in Panel 2.

Start with a 2 range chart
Have the indicator calculate average time per bar

You might set the Period to 50, for example, and it would average the time per bar over the past 50 bars. Let's say that value is 20 seconds.

You'd then have 20 seconds be the zero line of the indicator. As each new bar forms it divides that average by the time of each new bar.

When a fast move appears, it would cause the indicator to spike. As shown in the image below, that spike would be caused by bars that plot every 1 or 2 seconds. The spike data would be something like this:

20/1, 20/2, 20/1, 20/1, 20/1, 20/2, 20/1, 20/1, etc.

For an auto trader strategy, you'd look for the indicator to rise above some value (10, for example) then go long. Set the target for 5 pips or so. You'd be able to benefit from quick moves that manual traders would miss.

The trick would be having the indicator detect if the market is rising or falling. Without this detection, it would spike in both rising and falling markets.


Reply With Quote
The following user says Thank You to sefstrat for this post:
 
  #17 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Currencies
 
hondo69's Avatar
 
Posts: 165 since Jun 2009
Thanks: 57 given, 240 received

Thanks for the great information as it definitely makes sense to me. I feel you've saved me a lot of time and trouble and that's greatly appreciated.

Isn't that what makes this forum so great!!! Sharing great information.

Reply With Quote
 
  #18 (permalink)
Elite Member
New York, NY
 
Futures Experience: Intermediate
Platform: NinjaTrader8
Broker/Data: Data = Rithmic -- Gives 70 Level II Data
Favorite Futures: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
 
Posts: 813 since May 2011
Thanks: 1,330 given, 531 received


hondo69 View Post
I like your idea and have had similar thoughts for an indicator such as this. But my idea would plot the reverse of what you have so that range bars that plot very fast would cause the indicator to rise, like a speedometer.

My idea is to capture quick market moves and turn it into an auto trader. These are the times when the market moves so quickly there is not time to enter orders manually. In the image below I've superimposed the proposed indicator onto the price panel, even though it would be in Panel 2.

Start with a 2 range chart
Have the indicator calculate average time per bar

You might set the Period to 50, for example, and it would average the time per bar over the past 50 bars. Let's say that value is 20 seconds.

You'd then have 20 seconds be the zero line of the indicator. As each new bar forms it divides that average by the time of each new bar.

When a fast move appears, it would cause the indicator to spike. As shown in the image below, that spike would be caused by bars that plot every 1 or 2 seconds. The spike data would be something like this:

20/1, 20/2, 20/1, 20/1, 20/1, 20/2, 20/1, 20/1, etc.

For an auto trader strategy, you'd look for the indicator to rise above some value (10, for example) then go long. Set the target for 5 pips or so. You'd be able to benefit from quick moves that manual traders would miss.

The trick would be having the indicator detect if the market is rising or falling. Without this detection, it would spike in both rising and falling markets.

Was this version of the indicator ever developed? I am using A_1 for the time as a panel but it would be great to also be able to have it asa floating indicator on the primary chart. Seems difficult to me due to the varying scales but the image here looks perfect. Was it ever a reality?

Reply With Quote
 
  #19 (permalink)
Market Wizard
Las Vegas, NV
 
Futures Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Favorite Futures: Futures
 
aligator's Avatar
 
Posts: 3,424 since Aug 2010
Thanks: 1,053 given, 5,822 received
Forum Reputation: Legendary


jmont1 View Post
Was this version of the indicator ever developed? I am using A_1 for the time as a panel but it would be great to also be able to have it asa floating indicator on the primary chart. Seems difficult to me due to the varying scales but the image here looks perfect. Was it ever a reality?

@jmont1,

Not sure, but here my new bar time indicator here:

https://futures.io/download/ninjatrader-7/indicators/1167-download.html?view

Reply With Quote
The following 2 users say Thank You to aligator for this post:
 
  #20 (permalink)
Elite Member
New York, NY
 
Futures Experience: Intermediate
Platform: NinjaTrader8
Broker/Data: Data = Rithmic -- Gives 70 Level II Data
Favorite Futures: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
 
Posts: 813 since May 2011
Thanks: 1,330 given, 531 received



aligator View Post

Thanks. I have your indicator and it works well.

The one in this thread is showing in the instrument's main panel and would be an interesting take on it.

Currently I am running your mahBar and in the same panel also running Range_Time_v01 (modified to show less text) that displays text of the current bar and the average of previous RENKO bars. I have been trying to figure out how to get the text to also show the time of the previous bar but this would take a real coder.

Is it possible to add features to your indicator:

Current bar in text - Now - 00:11:55; old - 00:11:55; Avg 00:11:55 (this would be selectable of # of bars to use for average) Allow the text to be in the indicator panel or in the primary panel with all the locations, i.e... lower right, etc...; especially if it is possible to put it smack in the center but no more than two rows of text:

00:11:55 - now; 00:11:55 avg

00:12:45 Bar -1; + 00:01:55 (this would be the previous bar comparison to the avge.)


Then add a sound indicator (user sound selectable with a rearm timer) for bars ending in a short period of time, as well as an option to put the alert in the alert panel.

Alligator, I know this could be requested in the free section but it seems appropriate here, especially since you are following this thread. Thanks for your generosity of sharing your coding efforts.

Reply With Quote

Reply



futures io > > > > > Range Bar Time

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Range bar counter Serger EasyLanguage Programming 21 January 20th, 2012 09:33 AM
Range Bar Problems togier NinjaTrader 7 November 16th, 2010 12:24 PM
Range Bar Charts don10 NinjaTrader 12 October 29th, 2010 01:36 AM
range bar size jb004 Traders Hideout 5 May 10th, 2010 11:25 AM
Range bar code help traderlars The Elite Circle 23 December 30th, 2009 01:27 AM


All times are GMT -4. The time now is 07:30 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.17 seconds with 20 queries on phoenix via your IP 54.226.132.197