Multitimeframe

Created at 27 Mar 2020, 19:18
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
50

5026484

Joined 12.10.2015

Multitimeframe
27 Mar 2020, 19:18


Hey guys,

 

I'm using a indicator with a higher timeframe. 

Initialize           

_laguerreFilter = MarketData.GetSeries(LaguerreTimeFrame); // up to 2h---
_alf = Indicators.GetIndicator<AdaptiveLaguerreFilter>(_laguerreFilter, LaguerrePeriod);

 

To access in a lower timeframe the right value of the higher timeframe indicator I tried this 
       public override void Calculate(int index)
        {

            Result[index] = _rsi.Result[index];
            int alfIndex = _alf.Result.Count - 1;

            if (!double.IsNaN(_alf.Buy[alfIndex]))
            {
                ChartObjects.DrawText("info", "Laguerre Buy", StaticPosition.TopRight, Colors.Green);
                DirectionBuy[index] = 50;
                _bullish = true;
                _bearish = false;
            }
            else if (!double.IsNaN(_alf.Sell[alfIndex]))
            {
                ChartObjects.DrawText("info", "Laguerre Sell", StaticPosition.TopRight, Colors.Red);
                DirectionSell[index] = 50;
                _bullish = false;
                _bearish = true;
            }

I get always the same "Buy" of the indicator. Using it separately on a chart it shows the right changing values between Buy and Sell.

Hope the problem is exactly enough explained so that you can help me?

Cheers Markus


@5026484
Replies

firemyst
28 Mar 2020, 10:55

RE:

5026484 said:

Hey guys,

 

I'm using a indicator with a higher timeframe. 

Initialize           

_laguerreFilter = MarketData.GetSeries(LaguerreTimeFrame); // up to 2h---
_alf = Indicators.GetIndicator<AdaptiveLaguerreFilter>(_laguerreFilter, LaguerrePeriod);

 

To access in a lower timeframe the right value of the higher timeframe indicator I tried this 
       public override void Calculate(int index)
        {

            Result[index] = _rsi.Result[index];
            int alfIndex = _alf.Result.Count - 1;

            if (!double.IsNaN(_alf.Buy[alfIndex]))
            {
                ChartObjects.DrawText("info", "Laguerre Buy", StaticPosition.TopRight, Colors.Green);
                DirectionBuy[index] = 50;
                _bullish = true;
                _bearish = false;
            }
            else if (!double.IsNaN(_alf.Sell[alfIndex]))
            {
                ChartObjects.DrawText("info", "Laguerre Sell", StaticPosition.TopRight, Colors.Red);
                DirectionSell[index] = 50;
                _bullish = false;
                _bearish = true;
            }

I get always the same "Buy" of the indicator. Using it separately on a chart it shows the right changing values between Buy and Sell.

Hope the problem is exactly enough explained so that you can help me?

Cheers Markus

 

I'm not sure I fully understand, but from what I gather, you have two statements:

_laguerreFilter = MarketData.GetSeries(LaguerreTimeFrame); // up to 2h---
_alf = Indicators.GetIndicator<AdaptiveLaguerreFilter>(_laguerreFilter, LaguerrePeriod);

The first "_laguerreFilter" gets a timeframe; the second "_alf" gets a Period.

TimeFrames are not the same as a Period.

TimeFrames are what chart time frames you're looking at: H2, H4, M5, M1, etc.

Periods are how many candles/bars you're looking at: the last 5 bars, the last 13 bars, etc, of the current timeframe.

Otherwise I don't understand what your issue is. :-(

 

 


@firemyst