|
User
2011-02-02 06:02:39
|
|
Hello,
I would like to create an indicator that will be able to compute and display forward values (no need to rely on forward bars to compute forward values, only past chart bars will be used)
That is, if I select a bar on the indicator chart, the indicator will be able to adapt its forward values based on an algorithm and display them.
Is it possible ?
I understand that the vector result stores the calculated past values.
Is it possible to set negative index in result for forward values ?
Thanks for any help you could provide.
|
|
|
|
QuantShare
2011-02-02 08:59:20
0
|
|
Can you please provide an example or maybe more explanation about "forward values".
|
|
|
|
User
2011-02-02 09:12:24
0
|
|
OK.
Forward bar values could be anything.
For example, suppose I just want to plot forward a prediction vector calculated by an algorithm based on past prices.
This algorithm could be an auto-regression model that could be used to predict future values of a timeseries.
So when I select a bar on my price chart I want the indicator to plot these predicted values forward, that is starting just at the right from where my selected bar stands.
|
|
|
|
QuantShare
2011-02-02 09:53:56
0
|
|
If you want to interact with a chart, then you should create a custom drawing tool (Tools -> Custom Drawing Tool)
When the drawing tool is selected and each time you click on a chart, the item script will be executed. Inside the script, you can get close, open, high, low series, perform calculations and draw lines, text, symbols...
|
|
|
|
User
2011-02-02 10:17:16
0
|
|
Ok thanks.
I will try using custom drawing tools.
|
|
|
|
QuantShare
2011-02-02 10:29:49
0
|
|
Let me know if you need any help
|
|
|
|
User
2011-02-03 05:00:12
0
|
|
In custom drawing tools it is easy to get for example a close timeseries :
double[] close = Functions.ChartData.GetTimeSeries("close");
Is it possible to get a timeseries based on an indicator ? Like for example a simple MA or something else ?
Or do we have to re-code the functions behind the indicators based on the simple high/low/close/open/volume timeseries ?
|
|
|
|
QuantShare
2011-02-03 05:13:29
0
|
|
Best Answer
Currently you have to re-code the function.
We can add a Parser function that will return a time-series based on a formula.
Example:
double[] sma = Functions.ChartData.Parse("a = sma(10);").GetVector("a");
Please let me know if you need this function.
|
|
|
|
User
2011-02-03 05:32:43
0
|
|
For the moment I wil re-code the functions
But this could be a nice improvment for a next relase to have acces to a Parser function for this like in the money management script.
|
|
|
|