|
Adding future X Axis time values to get Future Price... |
Posted by Chuck on Dec-31-2019 00:20 |
|
I have an OHLC Financial Chart that populates with stock price... I draw a Trendline and use the Cursor to find the intersection of the Trendline with X Axis (DateTime)... I am adding future X Axis intervals (15 minute intervals) with the hopes of getting my Trendline (drawn as a right ray) to extend into this area to get “future” price... however, the chart crashes at the point the orig data ends and my blank Bars start... so, I am doing something wrong, but am unable to determine what...
Could an experienced user provide a VB.NET example of the “correct way” to add future X Axis intervals allowing my Trendline (as a right ray) to extend into this new area, so I can cursor-over and get the future price? Just need the proper way to extend the X Axis.
Thank you,
Chuck |
Re: Adding future X Axis time values to get Future Price... |
Posted by Peter Kwan on Dec-31-2019 16:20 |
|
Hi Chuck,
To add future x-intervals, please just add the time to the timeStamps array. For example:
... get timeStamps data array as usual ...
'Extend 10 intervals
ReDim timeStamps(UBound(timeStamps) + 10)
'Each timeStamp is the previous timeStamp plus 15 minutes. Note that the following
'assumes there is at least one timeStamp in the original data
For i As Integer = 0 To 9
timeStamps(UBound(closeData) + i) = timeStamps(UBound(closeData) + i - 1).AddMinutes(15)
Next
The trend line is added like:
' This is the main price chart to add the trend line to
Dim mainPriceChart = c.addMainChart(240)
' Add the trend line
mainPriceChart.addTrendLayer(closeData)
Hope this can help.
Regards
Peter Kwan |
Re: Adding future X Axis time values to get Future Price... |
Posted by Chuck on Jan-03-2020 09:52 |
|
Thank you Peter, I’m working now!
Chuck |
Re: Adding future X Axis time values to get Future Price... |
Posted by Chuck on Jan-03-2020 10:06 |
|
Thank you Peter, I’m working now!
Chuck |
|