NexusFi: Find Your Edge


Home Menu

 





Variable Bar Width Study


Discussion in Sierra Chart

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




 
Search this Thread

Variable Bar Width Study

  #1 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,215 since Jan 2011
Thanks Given: 6,740
Thanks Received: 18,107

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
You must login first File Type: dll VariableBarWidth.dll (12.5 KB, 26 views)
You must login first File Type: stdycollct Vol-.StdyCollct (15.2 KB, 19 views)
You must login first File Type: cpp VariableBarWidth.cpp (871 Bytes, 35 views)
Started this thread Reply With Quote
The following 8 users say Thank You to josh for this post:





Last Updated on April 9, 2013


© 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