is it possible to transfer an indicator to one another? I want to pass an interface wich contains an custom indicator. Doing that via parameter shows error when saving the indicator.
Background:
I want to separate filter and signal logic. the signal indicator should get an interface wich contains a flag or a enum when the filter indicator indicates long or short trading.
Is this possible and how would i do that?
Ich tried to do this like that and it seems to work but the filter indicator don't change its state. I guess the update mechanism isn't working like that:
FilterIndicator = KillZonesFilter(0); SignalIndicator = LiquidityVoid(1); SignalIndicator.Filter = FilterIndicator;
private ITrendFilter _filter;
public ITrendFilter Filter
{
get
{
Update();
return _filter;
}
set
{
_filter = value;
}
}
The Problem in the indicator. The filter doesn't get updated anymore...
protected override void OnBarUpdate()
{
if(Filter != null)
{
//Filter don't update anymore..
Filter.Update();
if (Filter.TradingModus == TradingMode.Long)
{
DetermineLongLiqidityGap();
}
else if (Filter.TradingModus == TradingMode.Short)
{
DetermineShortLiquidityGap();
}
return;
}

Comment