karlwancl / Trady

Trady is a handy library for computing technical indicators, and it targets to be an automated trading system that provides stock data feeding, indicator computing, strategy building and automatic trading. It is built based on .NET Standard 2.0.

Home Page:https://lppkarl.github.io/Trady

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indicator on Indicator 'TInput TOutput not matched'

andyb1979 opened this issue · comments

Hi there!

Does Trade support indicators on indicators?

If I try this ->

var rsi = new RelativeStrength(PrimaryPriceData, 14).Compute();
var emaOnRsi = new ExponentialMovingAverage<AnalyzableTick<decimal?>, AnalyzableTick<decimal?>>(rsi, tick => tick.Tick, 9).Compute();

Then I get an exception

System.ArgumentException: 'TInput, TOutput not matched!'
at Trady.Analysis.Infrastructure.AnalyzableBase`4..ctor(IEnumerable`1 inputs, Func`2 inputMapper)

Any ideas?

Take a look here .
If you map AnalyzableTick<decimal?> to IOhclv, it should work, I think.
Like rsi.Compute().Select(c=> new Candle(c.DateTime, c.Tick, c.Tick....)