Click here to Login





How to remove a chart pane's margins

Updated on 2011-09-24 04:22:04

Share |

Let us say you want to create a chart pane that is colored in green when the stock is trending up and in red when it is trending down. You want the whole area to be colored and you don't want white spaces, "create indicators" icons and date/price information. These three items can be hidden by calling a special instruction that removes a chart pane's margins.

Steps:

- Create a new pane
- Right click on it then select "Edit Formula"
- Type the following formula:

a = LinearReg_Angle(30);
Plot(a > 0, "Trend", colorGreen|255|colorGreen, ChartStep, StyleOwnScale);
Plot(a < 0, "Trend", colorRed|255|colorRed, ChartStep, StyleOwnScale);
UpdateSettings("Full Pane", 1);

Margins are removed by calling the "UpdateSettings" function. To display the list of available options (within this function), use CONTROL+SPACE shortcut after you type: "UpdateSettings(".

The second parameter gets a rule that determines whether to apply the setting or not. "1" means that the new setting should be applied on all bars. If you had specified "open > close" then the full pane mode will be activated only when the open price is higher than the close price.

In the above formula, stock trend direction is defined by measuring the angle of the 30-Bar linear regression of the close series.










no reviews (Log in)







Other how-to articles




How to print a chart





How to plot a stock using different periods in the same chart





How to display two stocks on the same chart





How to create a chart with a black background





How to create a log scale chart





How to create a hatched area in a chart





How to display notes/commentaries on a chart





How to add a trading indicator to a chart





How to plot two different time frames in the same chart







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.