Script Bar Chart
Last updated: Sep 17, 2021 01:52
The Script Bar Chart is a style that allows the user to control the width of each bar via a value produced from a custom script.
In the above example, the width of each bar is determined by the Volume each day. The wider the bar, the higher the Volume value that day.
To open a new script bar chart click on the New menu, go to Single Code Chart, and in the menu that appears select the Script Bar Chart option.
Note: This chart style uses scripting. If you are unfamiliar with Optuma scripts please refer to the free video courses here:
There are 3 courses available, Beginner, Intermediate and Advanced. It is highly recommended you complete all 3 courses before attempting to write your own scripts in Optuma.
Actions and Properties
**![ScriptBarChart2](../images/script-bar-chart-scriptbarchart2.png)Copy Colours to Toolbar:** Copies the bar colour scheme and creates a custom toolbar button. Use the button to apply the colours to other charts.
**Copy Data to Clipboard:** Copies the raw data values (Open, High, Low, Close, and Volume) to your clipboard, which can then be used in other programs (such as Notepad, MS Excel, etc). Note that the values copied will be in the timeframe of the chart, so a weekly chart will copy weekly values.
**Apply Settings to All:** Any changes to the chart's setting can be applied to all the other charts on the page or in the workbook. For example, change the colour scheme or line width of the chart and click this option to automatically change all the other charts in the workbook.
**Move to Back:** If the lines of the Script Bar Chart are displaying in front of other tools or indicators clicking this action will move the line's view to the background.
**Move to Front:** If the lines of the Script Bar Chart are displaying behind other tools or indicators on the chart, clicking this action will bring the lines to the forefront.
**Restore Default Settings:** Click this action if you have adjusted the default settings of the Script Bar Chart, and wish to return to the standard properties originally installed with Optuma.
**Save Settings as Default:** If you have adjusted any of the Script Bar Chart's properties (such as the Colour Scheme or bar thickness, for example) you can save the adjustments as your new default setting. Each time you open a new Script Bar Chart it will display using the new settings.
**Delete:** Deletes the Script Bar Chart from the page.
**Tool Name:** This allows for the name of the chart to be changed, as displayed in the Structure Panel.
**Relative Index:** Use this option to create a relative strength chart. Type the symbol of the index or other security, eg SPX from World Indices to see the chart relative to the S&P500 index.
**Chart Style:** This allows you to change the Script Bar Chart to another chart style (such as a Line Chart).
**Date Range:** This setting allows you to choose how much historical data is displayed on the chart. By default, all data contained in the data file is displayed but this option can be used to limit the amount of data in the chart, eg Last 10 Years, or from a user-defined date or range of dates.
**Default Price Unit:** Used to set the Price Unit various Gann-based tools will use by default when applied to the selected chart. For example, setting the Default Price Unit to 0.01 will set any Gann Fan applied to the chart to use 0.01 as its price unit. For more information on the Price Unit, please [click here](../gann-and-astro/price-units--factors--and-harmonics-for-gann-tools).
**Width Script:** Click this property to open the script manager. From here you can enter the script you wish to use for controlling the width of the chart. The script must produce a numerical value (no Boolean results, etc). Some example scrips to use:
- VOL() Will set the script based on the volume value for the bar.
- ATR() Will set the script based on the Average True Range (10 period 1x Multiplier).
- V1 = MA(BARS=25, STYLE=Exponential) ; V2 = MA(BARS=50, STYLE=Exponential) ; ABS(DIFFPCT(V1,V2)) Will set the script based on the percentage difference between a 25EMA and 50EMA.
Price Adjustment: This allows you to set the underlying data being used from Price Returns, Total Returns, and Unadjusted.
Filters: Mouse over this option to open the Filters panel:- Calendar Days - Ticking this option will add a dash for every day on the chart not filled by an existing bar, such as weekends and public holidays.
- Show Blanks - When enabled a dash will be added for weekdays where no trading activity is recorded (public holidays for example), however, no dashes will be added for weekends.
- Allow Zero Close Price - There are codes in Bloomberg that are binary plots i.e. 0 and 1s only. This filter allows the zero values to be displayed.
- Ignore Out of Session Ticks - Any data coming in outside of the designated session times (assigned to the specific code in use) will not be added to the chart. Requires a real-time data feed.
- Show Single Session - For codes containing two sessions in a single day (e.g. Session 1 = Day, Session 2 = Night). Ticking this checkbox will allow you to view only one of those sessions on the chart, with data from the other session being hidden from view. Requires a real-time data feed.
**Blank Bars:** The number of blank bars to the right of the current price action. After the last bar, there will be an area of blank charting space used for plotting tools and indicators into the future. Increasing this value will increase the amount of blank space.
**Currency:** Each chart you load will display in the default exchange currency (or point measurement). You can adjust the chart so that it displays in a different currency, or even priced in Silver or Gold.
**Colour Scheme:** Controls the colours used to display the bars on the chart. There are seven preset colour schemes available:
- Single Colour - One colour displayed for all bars, regardless of their position / price action.
- Time Intervals - Bars are coloured in 2 groups. On a daily chart, the colours change between each week (for example Week 1 would be blue, Week 2 Green, Week 3 Blue, etc).
- Bar Strength - Bars which close higher than their open are blue, bars which close lower than their open are red and bars that have an equal open and close are green. The intensity of the colour is also based on the price range of the bar. The greater the range of the bar, the more intense the colour.
- Swing Relations - Based on W.D. Gann’s swings, by default the higher bars are coloured green and lower bars coloured red. Inside bars (bars where the Open/High/Low/Close occur entirely within the range of the previous bar) are coloured black and outside bars (bars where the high/low are higher/lower than the previous bars) are coloured blue.
- Strength - Bars which close higher than their open are blue and bars that close lower than their open are red.
- Close Position - Bars that close higher than the previous bars are coloured blue. Bars that close lower than the previous bars are coloured red.
- Coloured Volume - When selected, a coloured volume overlay will be displayed over the chart. The tool overlays a colour on each bar in the chart to represent the range of volume traded on that day. The volume ranges are completely user-definable.
- RRG Quadrant Bars - This colour scheme will paint each bar or candle in the same colour as the RRG Quadrant that it was in on that date-time. The RRG calculation is based on the Relative Strength of the security against the Index shown in the properties when RRG Quadrants is selected.
- RRG Trend Bars - This study paints the bars or candles in a regular chart based on trend-following trading rules that were the basis for the development of the RRG.
- Custom - Allows a custom, user-defined colour scheme to be created using the Optuma Scripting Language.
**Data File Properties:** This field can be expanded to display information on the data file being used to generate the chart. Items such as the Data File's name, Exchange, physical location on your system are all displayed here. Generally, this information is only required for troubleshooting purposes and is not something you will use on a regular basis.
**Tool Transparency:** This slider bar is used to adjust the transparency of the chart itself. Moving the slider to the left will increase the transparency of the bars. Moving the slider to the right will increase the opacity of the chart.
**Visible:** Unticking the checkbox will hide the bar chart from view.
**Show in Price Scale:** When selected the last closing value will be highlighted in the Price Scale.
**Lock Tool:** Tick this checkbox to lock the chart so that it can be altered (no properties changed, etc). When enabled, no other properties in the chart will be adjustable.