Variable Bar Width Study - futures io
futures io



Variable Bar Width Study


Discussion in Sierra Chart

Updated
    1. trending_up 1,758 views
    2. thumb_up 8 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 3 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Variable Bar Width Study

(login for full post details)
  #1 (permalink)
 josh 
Legendary Market Wizard
Georgia, US
 
Experience: None
Platform: SC
Broker: AMP+CQG
Trading: ES, HSI, Nikkei
 
josh's Avatar
 
Posts: 5,533 since Jan 2011
Thanks: 6,114 given, 14,882 received

One of the biggest pet peeves I have is when I change the bar width on a chart, and study/indicator bars do not change with it. It's one thing I miss about Investor R/T, my volume bars would always resize when I change my bar spacing on the chart, and would basically be the maximum size they could be without running together.

So, a while back I wrote a simple SC study that would accomplish the same thing, and after seeing someone's chart today with squished up volume bars (that would be @GaryD ), I thought I would compile it and share it.

So to do this, put the DLL in your Sierra Data folder (and if you like, put the source in the ACS_Source folder too). When you want to add a study that has bars as the draw type and want them to change dynamically with the bar spacing of your chart, add the study and make it invisible. Then add this custom study (it should be under the Variable Bar Width category which you can change by modifying the SCDLLName() call at the top of the source file and recompiling). In the study parameters, have "Based On" set to your study that you just hid, and be sure it's in the correct region, and that scale settings are appropriate as well.

By default, the study bars will be as wide as they can be and should have only a small space between them. When you compress the bars, the study bars will compress to maintain this spacing. However, if you wish to make the bars a little narrower, change the Offset study input to a negative number and this reduced bar width (additional spacing) will be maintained as you resize the bar spacing on the chart.

I have also included a study collection file that you can put in your Data folder as well, that has the settings preset for volume, so that if you choose Analysis->Vol, you will have a dynamically changing Volume study.

The study enables "update always" which means that whatever you update interval is set to in your general settings, this chart will update always at that interval, regardless of whether you have data coming in or not. This is so it works instantly, and will work correctly if you are using it on the weekend for example, when markets are closed and no data is coming in to update the chart. Honestly I don't think there is a performance hit for normal use, because data comes in usually at much faster than the update interval, and SC capped the update interval at 100ms for "update always" functionality anyway, so it's really not that big of a deal IMO.

As a disclaimer, this works fine for me, but I take no responsibility if you add it and something goes wrong

Attached Files
Register to download File Type: dll VariableBarWidth.dll (12.5 KB, 23 views)
Register to download File Type: stdycollct Vol-.StdyCollct (15.2 KB, 19 views)
Register to download File Type: cpp VariableBarWidth.cpp (871 Bytes, 30 views)
Started this thread Reply With Quote
The following 8 users say Thank You to josh for this post:


futures io Trading Community Platforms and Indicators Sierra Chart > Variable Bar Width Study


Last Updated on April 9, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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