NexusFi: Find Your Edge


Home Menu

 





Is there a bar overlap indicator?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 3 posts (26 thanks)
    2. looks_two jstnbrg with 2 posts (2 thanks)
    3. looks_3 rpqtrader with 2 posts (0 thanks)
    4. looks_4 bobwest with 1 posts (2 thanks)
      Best Posters
    1. looks_one Fat Tails with 8.7 thanks per post
    2. looks_two bobwest with 2 thanks per post
    3. looks_3 jstnbrg with 1 thanks per post
    4. looks_4 MrTrader with 1 thanks per post
    1. trending_up 5,197 views
    2. thumb_up 32 thanks given
    3. group 10 followers
    1. forum 9 posts
    2. attach_file 4 attachments




 
Search this Thread

Is there a bar overlap indicator?

  #1 (permalink)
 jstnbrg 
Chicago, Illinois
 
Experience: Advanced
Platform: Ninjatrader, TT, InvestorRT
Broker: Advantage Futures, Ninja/TT and InvestorRT/IQFeed.
Trading: Treasury futures
Posts: 312 since Nov 2010
Thanks Given: 194
Thanks Received: 912

Is there an existing indicator that counts bar overlap? What I'm looking for is an indicator that counts the number of bars out of the previous n bars that the current bar overlaps.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didnt know anythin …
Psychology and Money Management
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


jstnbrg View Post
Is there an existing indicator that counts bar overlap? What I'm looking for is an indicator that counts the number of bars out of the previous n bars that the current bar overlaps.

I have seen something similar, but I cannot find it.

As it was faster to code than to search for it, I have recoded it. I think it best shows as a histogram. It looks quite usful, so I do not regret the few minutes that I have spent to code it.

I have added a filter to identify bars with an overlap that are large than the average overlap plus two standard deviations. The multiplier and lookback for the standard deviation can be adjusted.

The indicator and a chart are attached.


Attached Files
Elite Membership required to download: BarOverlap.zip
Reply With Quote
  #3 (permalink)
 jstnbrg 
Chicago, Illinois
 
Experience: Advanced
Platform: Ninjatrader, TT, InvestorRT
Broker: Advantage Futures, Ninja/TT and InvestorRT/IQFeed.
Trading: Treasury futures
Posts: 312 since Nov 2010
Thanks Given: 194
Thanks Received: 912


Wow, ask and you shall receive! Thanks, Harry. I thought it would be easy to code but for me that probably would have been a frustrating 8 hour torture session.

Everyone talks about avoiding chop, and chop is nothing but a lot of bar overlap. It's easy to see but I always thought it might be helpful to quantify the overlap. Thanks for the help and the quick response. Hope everything is going well for you, I just walked the dog and it is 9 degrees F (-13 C). I want to be somewhere WARM!

"You don't need a weatherman to know which way the wind blows..."
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

I am still not satisfied with the first approach. I think that there is a conceptual problem.

If you have a wide ranging bar - which in fact ends the chop period - it is likely to overlap with more of the preceding bars than the prior narrow range bars. The breakout bar would therefore obtain the highest chop reading, and only the bar after the breakout bar would show little overlap. This means that the original indicator is lagging unnecessarily by 1 bar.

I have therefore tried to modify the concept in several ways.

(1) I am looking at which fraction of the last bar is covered by previous bars. The results are weighted in a way that the prior bar has a higher weight than the prior2 bar, the prior2 bar a higher weight than the prior 3 bar.

(2) Then I have added a simple SMA as a signal line.

It is still an experimental indicator. The chart below shows that

-> when the bars are exceeding the signal line, it is getting choppy
-> when the bars stay below the signal line, price is trending

I think it is possible to transform this into a MACD type indicator, which indicates chop and trending conditions via an EMA or a SMA cross.


Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

You could also try this indicator, which I coded today.



It is still experimental, but @Jura has obtained the same results with a TradeStation version. Could be better than bar overlap.

Reply With Quote
  #6 (permalink)
 
MaxPaine's Avatar
 MaxPaine 
Chicago Illinois
 
Experience: Intermediate
Platform: Ninjatrader
Trading: Treasuries
Posts: 11 since Jul 2013
Thanks Given: 41
Thanks Received: 22

Thanks, Fat Tails! By chance do you have this in NT 8 format? I thought I would ask. Thank you for all your amazing work and generosity

I know where I'm going and I know the truth, and I don't have to be what you want me to be. I'm free to be what I want.

Muhammad Ali
Reply With Quote
Thanked by:
  #7 (permalink)
rpqtrader
Bogota
 
Posts: 2 since Feb 2018
Thanks Given: 3
Thanks Received: 0

Hi FatTails, I could not find the OverLap2.zip. Do you still have one, and perhaps for Ninjatrader 8?

Reply With Quote
  #8 (permalink)
 MrTrader 
ITAJAI SC/BRAZIL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Clear Corretora
Trading: DOLFUT, WINFUT
Posts: 334 since Jun 2014
Thanks Given: 1,320
Thanks Received: 226


Fat Tails View Post
You could also try this indicator, which I coded today.



It is still experimental, but Jura has obtained the same results with a TradeStation version. Could be better than bar overlap.

@MaxPaine and @rpqtrader this is how you tag someone to be notified.

Also, when you reply a post like I did above, the writer will be notified too..



Sent using the nexusfi.com mobile app

Reply With Quote
Thanked by:
  #9 (permalink)
rpqtrader
Bogota
 
Posts: 2 since Feb 2018
Thanks Given: 3
Thanks Received: 0

Hi Fat Tails
FatTails View Post
I could not find the OverLap2.zip. Do you still have one, and perhaps for Ninjatrader 8?


Reply With Quote
  #10 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,523
Thanks Received: 26,292



rpqtrader View Post
Hi Fat Tails

Hi @rpqtrader,

When you are quoting someone else, do not type your own text as if it were theirs, as you did here:



This has your text, not Fat Tail's, in the quote box. Quote is only for quoting another person.

Obviously you meant no harm and just misunderstood, but please don't type into the quote you are displaying. When you use the Quote key, it displays the quoted text in the text editor within tags that say "Quote".

Just leave the quoted text as it is (you can shorten it for clarity but don't add to it) and type your text outside the Quote area.

Thanks.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
Thanked by:




Last Updated on April 10, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts