Click here to Login





                                                   Horizontal line incorporated in indicator overlaid on main chart

  0

0
dare2
2012-09-14 18:53:18


I often like to overlay an indicator, such as ROC, on the main chart. When I do so, I use the indicators "own scale" setting. I have been unsuccessful though
in editing the formula to add a horizontal line at '0'. The horizontal line is placed at the price charts '0' line and not the ROC '0' value.



QuantShare
2012-09-15 09:46:26

  0

Try this:

PlotCandleStick("Quotes", colorBrown|255|colorViolet|255|0, StyleOwnScale);

plot(roc(20), "", colorBlue, ChartLine, StyleSymbolNone);
plot(0, "", colorGreen, ChartLine, StyleSymbolNone);



dare2
2012-09-15 13:05:48

  0

That works for price and roc, BUT the volume bars are now upside down with their base at the roc '0' line.

Darrell



dare2
2012-09-15 13:14:45

  0

Actually that is okay with me as I will put volume in its own pane. Although it would be nice to have it in the main chart.

Darrell



QuantShare
2012-09-15 13:18:27

  1

Replace the volume plot line by this:
Plot1(volume, -100, "Volume", "", colorLime|60, colorTransparent, colorTransparent, ChartStep, StyleOwnScale);



dare2
2012-09-15 13:28:39

  0

The other thing I just noticed is that the price scale on the right has disappeared, and has been replace with the roc scale. The closing price does show on the right of the candlestick and the c, o, h, l show in the upper left of the main chart which is as it should be.




dare2
2012-09-15 13:30:03

  0

Ignore my last message as I just got yours and will change the vol plot and see what that does.



dare2
2012-09-15 13:36:21

  0

That worked as far as putting the volume bars back where they belong however the price scale on the right has disappeared, and has been replace with the roc scale. The closing price does show on the right of the candlestick and the c, o, h, l show in the upper left of the main chart which is as it should be.





dare2
2012-09-15 13:41:32

  0

Another problem is that I no longer have the control over the volume bar's color. I tried 'updating dynamically' to change the colors to two colors and it seems to only let me have one color.

Darrell



QuantShare
2012-09-17 11:25:09

  1

Best Answer
Here is another way to display ROC on main chart. However, instead of the zero line, you will see the ROC color changes from Green to Red.

PlotCandleStick("Quotes", colorBrown|255|colorViolet|255|0, StyleSymbolNone);
Plot(volume, "Volume", colorLime|55|colorLime|64|0, ChartBar, StyleOwnScale);

plot(roc(20), "", colorRed, ChartLine, StyleOwnScale);
UpdateColor(roc(20) > 0, colorGreen);



dare2
2012-09-17 12:37:58

  0

Now that I like. Thank you.

Darrell



dare2
2012-09-17 12:54:58

  0

Although I would rather have an ROC scale on the left and price scale on the right with a horizontal line corresponding to zero on the left scale.

Perhaps something could be done in a future edition of Quantshare.

Thanks again,
Darrell



QuantShare
2012-09-17 13:12:26

  0

Yes, thank you for the suggestion.


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
Rate of Change Horizontal Line
Chart Pattern Indicator
Year over Year Chart Indicator
Horizontal Line - Changes by Value and Percentage
AccuTrack Indicator

How-to Lessons
How to draw an horizontal segment line using QS language
How to add a trading indicator to a chart
How to create a custom trading indicator
How to plot a stock using different periods in the same chart
How to display notes/commentaries on a chart

Related Forum Threads
Horizontal line on the intraday chart with the day's opening pric...
Horizontal line on indicator
Profit loss protection trailing stop line on chart .
Positioning horizontal line
INTRADAY CHART AND VERTICAL LINE TO SEPARATE EACH DAYS

Blog Posts
Backtesting chart patterns using the auto support and resistance ...
Detect chart patterns using the auto support/resistance indicator
Compare stocks and securities by creating a relative performance ...
Custom Indicator: Accumulation Distribution Line
Create a stock index or a trading indicator using the composite t...









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 2021 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.