Variable Bar Width Study - Sierra Chart | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > Sierra Chart

Variable Bar Width Study
Started:April 9th, 2013 (10:11 PM) by josh Views / Replies:458 / 0
Last Reply:April 9th, 2013 (10:11 PM) Attachments:3

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Variable Bar Width Study

Old April 9th, 2013, 10:11 PM   #1 (permalink)
Elite Member
Georgia, US
Futures Experience: None
Platform: Various
Favorite Futures: Various
josh's Avatar
Posts: 4,898 since Jan 2011
Thanks: 5,143 given, 11,193 received

Variable Bar Width Study

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, 22 views)
Register to download File Type: stdycollct Vol-.StdyCollct (15.2 KB, 18 views)
Register to download File Type: cpp VariableBarWidth.cpp (871 Bytes, 24 views)
Reply With Quote
The following 8 users say Thank You to josh for this post:

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > Sierra Chart > Variable Bar Width Study

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Color bar study always outputting 0 to spreadsheet study vegasfoster Sierra Chart 2 January 3rd, 2013 12:30 PM
A Case Study in Custom Bar Types rk142 The Elite Circle 59 September 20th, 2012 09:24 AM
[SC] Overlay a study, but only at bar open Nicolas11 Sierra Chart Programming 3 August 13th, 2012 08:59 AM
PAINT BAR STUDY gparkis NinjaTrader Programming 2 February 16th, 2012 07:22 PM
Variable Bar Chart DavidHP Traders Hideout 0 December 4th, 2009 03:53 PM

All times are GMT -4. The time now is 11:58 AM.

Copyright © 2016 by 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 2016-10-24 in 0.07 seconds with 20 queries on phoenix via your IP