Range bars are new to me since being introduced to this forum. Thanks Mike, Sharky and others who continually share..
I'm not sure if a range timer display would show the bar's duration and if anyone feels that would be good information to show how long a bar is stuck without moving. some of the bars in the screenshot are 10 minutes long (might as well go to lunch)
I'm testing this script but don't know how to set it to display minutes:seconds... Any help would be greatly appreciated.
Kirk
The following 4 users say Thank You to zeller4 for this post:
I'm merely trying to see how long in minutes it took to print the last bar. I believe that will then allow me to place a moving average to that number and see the "speed" of the current price movement. If the current 4 range bars are plotting in 10-30 seconds compared to 5 minute plot per bar, there might be strength or momentum in the current move...
not just a standard momentum indicator...
just a way to show time of one bar's time minus the last
not even sure if this is the best way to do this..
Hey zeller4, I like the way you are thinking. I can see how your indicator may confirm the 'lunch lull' and other persistent slower price action time frames that might be less conducive to a momentum strategy. I'm curious if there is a direct correlation that will be useful. Thanks for giving this a go.
Site Administrator Swing Trader Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
Posts: 49,785 since Jun 2009
Thanks: 32,314 given,
97,581
received
zeller4,
You are on the right track. It is important to know the length of a bar when compared to an "average" length. If the bar moves incredibly quick, it can signal a change in momentum, whereas if a bar takes a long time, it can signal chop.
I think you should consider adding an additional double to your script to record the average time of a bar, and then maybe paint the Countdown clock in a certain fashion depending if the current bar is above or below the average by a certain threshold, like 50% or something.
per Mike's suggestion I'm using different colored background if it's less than the EMA(5) - not sure about the 50% level, please update as you see fit.
not sure if 5 is the "right" number for now.
still need help with formatting the EMA value... yes, I'm still in the "learning library"!
Kirk
The following 5 users say Thank You to zeller4 for this 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.
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
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.
The following user says Thank You to sefstrat for this post:
Trading: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
Posts: 1,251 since May 2011
Thanks: 1,591 given,
917
received
hondo69
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?
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
Posts: 3,424 since Aug 2010
Thanks: 1,057 given,
5,841
received
jmont1
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?
Exported using NT Version 7.0.1000.9
Bar Time Indicator:
This indicator measures completion of a bar in seconds and colors a historhram based on how long it takes for the bar to complete. Red <= 10s, Cyan<=20, Blue<=30s, Orange=45s, Magenta<=60, and …
The following 2 users say Thank You to aligator for this post:
Exported using NT Version 7.0.1000.9
Bar Time Indicator:
This indicator measures completion of a bar in seconds and colors a historhram based on how long it takes for the bar to complete. Red <= 10s, Cyan<=20, Blue<=30s, Orange=45s, Magenta<=60, and …
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.