Custom Indicators
Hi,
Is it possible to produce our own indicator classes that behave in
the same way as the builtin ones? where they autoupdate on a new
bar?
Will we be able to extend the IndicatorBuilder class to provide our custom indicators?
Cheers,
Mark
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Guillaume on 14 Apr, 2010 12:42 PM
Hi Mark,
Currently, it is possible to write your own custom indicator and extend the IndicatorBuilder class (even though at first IndicatorBuilder was designed for market runner build-in indicators).
You will need to implement 2 interfaces : Indicator and BarSeriesListener. And invoke barSeries.register(this) in your indicator constructor to receive new bar notification and compute your indicator values.
There is one limitation though with the current market runner code : you will not be able to draw your custom indicators as build-in indicators.
As a workaround, you can draw a TimeSeries indicator in your strategy code and and feed values from your custom indicator.
Not sure yet how this will evolve in the future to avoid this limitation and improve custom indicators.
Hope this helps.
Regards
Guillaume
Guillaume closed this discussion on 14 Apr, 2010 12:42 PM.
Support Staff 3 Posted by Guillaume on 16 Apr, 2010 10:03 AM
Hi Mark,
Just to let you know, our next release will include the possibility to plug your indicators as built-in indicators (and draw them, etc.).
Next to newIndicator().sma(), you will have a method newIndicator().custom(IndicatorBuilderClass), and you will be able to extends AbstractIndicator for your indicator class (a bit easier than implementing indicator from scratch).
Stay tuned...
Guillaume