Click here to Login





                                                   Limiting the scale of a candlestick chart with volume?

  1

0
Josh McCormick
2020-07-07 16:36:10


I've got a pane that combines a candlestick chart with a volume chart (and a couple of info boxes).
I'm having problems controlling the scale of the volume chart. It wants to fill 100% of the pane.
How can I position the volume chart to be at the bottom of the pane and still consume no more than 20% of the vertical space?

FORMULA ===============================================
PrintChart(Name()." STOCK CHART", "", BottomCenter, colorBlack, colorBlack, colorWhite, 200);
p = SymbolInformation();

PlotCandleStick("Quotes", colorBrown|255|colorViolet|255|0, StyleSymbolVdash);
plot(volume, "Volume", colorLightGreen|100, ChartBar, StyleOwnScale|StyleHideValues|StyleHideYAxisValue);
UpdateSettings("Top-Bottom Chart Margin", 0);

SCREENSHOT =============================================
https://i.imgur.com/a09Wmff.png



QuantShare
2020-07-09 12:10:45

  0

I see a volume bar going to the "Date" text at the top. I don't see any issue here.
If that bar has a volume of say 100 and the other ones have 10 as volume then it is normal that the other bars will only take 10% of the chart height.



Josh McCormick
2020-07-09 13:24:04

  0

The chart is not flawed, it just isn't what I'm after.

If instead, I want the largest volume bar to only reach a height of 20% (of the available space in the pane), how do I code that limitation?

My preference is to limit how much the volume chart can overlap with the stock chart. (See: Yahoo Finance stock charts)



QuantShare
2020-07-13 12:50:43

  1

Best Answer
After the plot volume and updatecolor lines, add this:

Plot(volume * 5, "Volume", colorTransparent, ChartNone, StyleOwnScale);
UpdateSettings("MergeWithPreviousOwnScale", 1);

Other solutions:
You can put the volume on the lower pane or make it more transparent.



Josh McCormick
2020-07-13 20:50:57

  0

MergeWithPreviousOwnScale? Awesome!
That fixed things up just *perfect*. Thank you, sir!



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Enhanced Candlestick Chart with Volume Variation
Stocks with an EPS Several Times Higher than the Industry Average...
Stocks with the highest Volume Increase
Trading Rules to use with the Trading System Optimizer
Update the Stock Exchange Associated With U.S. Stocks - Market Fi...

How-to Lessons
How to plot a time-series that do not update the chart scale
How to scale and move the chart Y-axis
How to plot a stock using different periods in the same chart
How to display the bar index of a stock on a chart
How to create a chart with a black background

Related Forum Threads
TO SHARE: Candlestick chart with a few interesting features
Locks up when market is open while using the *daily* chart with I...
Horizontal line on the intraday chart with the day's opening pric...
Basic features and some issues with the background
Is it possible to make a spread chart with futures contracts?

Blog Posts
How to Use the Percentage Scale
Chart Layouts Explained - With Custom Scripts
Ranking stocks based on their correlation with the S&P 500 Index
Trading Forex with the commitments of traders report
Detect chart patterns using the auto support/resistance indicator









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.