|
Finance Chart, indicator above and below main price chart |
Posted by icm63 on Apr-29-2018 13:34 |
|
Hi,
Currently I do this, the normal presentation
Price chart (main OHLC chart) then underneath two indicators
- RSI (xyChart) [****BELOW PRICE CHART****]
- CCI (xyChart) [****BELOW PRICE CHART****]
How can I do this with your finance chart demo???
- RSI (xyChart) [****ABOVE PRICE CHART****]
Price chart (main OHLC chart)
- CCI (xyChart) [****BELOW PRICE CHART****]
Thanks |
Re: Finance Chart, indicator above and below main price chart |
Posted by Peter Kwan on Apr-30-2018 17:40 |
|
Hi icm63,
I think you just need to do it in the same way as the sample code. If you want the chart to be RSI - mainChart - CCI (from top to bottom), then just add these 3 items in the same order (addRSI, then addMainChart, then addCCI).
Regards
Peter Kwan |
Re: Finance Chart, indicator above and below main price chart |
Posted by icm63 on May-01-2018 03:59 |
|
yeah I tried that. but I got this visual error
With this code (see image AError)
mainChart.addROC(200, 14, &H0)
'Set Finance Chart as XYChart and OHLC layer
mainXYChart = mainChart.addMainChart(FinHeight)
Of course this works well
'Set Finance Chart as XYChart and OHLC layer
mainXYChart = mainChart.addMainChart(FinHeight)
mainChart.addROC(200, 14, &H0)
ANY IDEAS ??
|
Re: Finance Chart, indicator above and below main price chart |
Posted by Peter Kwan on May-01-2018 16:17 |
|
Hi icm63,
I suspect the issue is caused by the code that you have not included in your message. Is it possible that there are some code that manipulate the x-axis scale or labels of the mainXYChart?
If you are using the FinanceChart object, in the original unmodified FinanceChart implementation, the x-axis labels are determined using the first chart, which can be the ROC chart or can be the mainXYChart, depending on which one is added first. The x-axis configuration of all subsequent charts are just copied from the first chart. This ensures all the charts are consistent.
If the addROC chart is added first, the mainXYChart will become inconsistent with the addROC chart if your code modify the x-axis configuration of the mainXYChart. If you need to modify the x-axis labels, please modify the x-axis of the chart that is added first.
Regards
Peter Kwan |
Re: Finance Chart, indicator above and below main price chart |
Posted by icm63 on May-01-2018 17:06 |
|
Yip you can do it unless your make the first chart the
mainChart.addMainChart(FinHeight)
AddMainChart has a base built in function that has to go on the first chart. |
Re: Finance Chart, indicator above and below main price chart |
Posted by Peter Kwan on May-02-2018 14:30 |
|
Hi icm63,
I am not sure the meaning of your last message. You mentioned the "AddMainChart has a base built in function that has to go on the first chart". Do you mean you have derived from the FinanceChart and overridding the addMainChart and add additional code it?
If this is the case, I assume you mean modifying those code solves the problem.
Regards
Peter Kwan |
|