Moving Average .XScreenToValue
Posted: Mon May 23, 2005 8:05 am
Sorry to seem lazy but I am pressed for time.
I plot a price line which has 751 points. Of which 250 are visible at any one time to user.
I add a 21 day moving average.
As user moves mouse pointer (the requirement is to be able to do this WITHOUT a cursor) I need to update a 'data window' to show the Y values at the current mouse point.
I use .Series(SeriesIndex).XScreenToValue(X) to determine the index value to pass to .YValues
This works fine for the main line, but when I use the same logic for the moving average it is out by the period (ie, 21).
As there may be many series plotted is there a way to write a generic piece of code that will return the value for the series relative to the pointer? Thanks again.
I plot a price line which has 751 points. Of which 250 are visible at any one time to user.
I add a 21 day moving average.
As user moves mouse pointer (the requirement is to be able to do this WITHOUT a cursor) I need to update a 'data window' to show the Y values at the current mouse point.
I use .Series(SeriesIndex).XScreenToValue(X) to determine the index value to pass to .YValues
This works fine for the main line, but when I use the same logic for the moving average it is out by the period (ie, 21).
As there may be many series plotted is there a way to write a generic piece of code that will return the value for the series relative to the pointer? Thanks again.