How to add Supertrend indicator to Bot
Created at 05 Aug 2020, 03:31
How to add Supertrend indicator to Bot
05 Aug 2020, 03:31
I'm trying to add the built-in Supertrend indicator using the following code:
private Supertrend _st;
protected override void OnStart()
{
_st = Indicators.GetIndicator<Supertrend>(10, 3);
}
but this results in the following error:
Error CS0311: The type 'cAlgo.API.Indicators.Supertrend' cannot be used as type parameter 'TIndicator' in the generic type or method 'cAlgo.API.Internals.IIndicatorsAccessor.GetIndicator<TIndicator>(params object[])'. There is no implicit reference conversion from 'cAlgo.API.Indicators.Supertrend' to 'cAlgo.API.Indicator'.
Can someone please advise me on how to get this to work? Thank you in advance.
PanagiotisCharalampous
05 Aug 2020, 08:30
Hi rgasch,
Here is the correct way to do this
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous