How to use multi timeframe bollinger bands in cbot

Created at 06 Jul 2022, 09:09
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!
MongolTrader's avatar

MongolTrader

Joined 12.02.2015

How to use multi timeframe bollinger bands in cbot
06 Jul 2022, 09:09


I want use in my cbot daily 4hour 1hour data bollinger band parameters together. 


@MongolTrader
Replies

PanagiotisCharalampous
06 Jul 2022, 14:23

Hi MongolTrader,

You need to make your question more specific. What exactly do you need to find out? How to initialize the indicator using data from another timeframe?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

MongolTrader
06 Jul 2022, 14:39

RE:

PanagiotisCharalampous said:

Hi MongolTrader,

You need to make your question more specific. What exactly do you need to find out? How to initialize the indicator using data from another timeframe?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

I ask before about like this question adx multitime frame its same as this question only using indicator is bollinger band i dont know how use it in bollinger band case please check link below https://ctrader.com/forum/calgo-support/38261


@MongolTrader

PanagiotisCharalampous
06 Jul 2022, 14:44

Hi MongolTrader,

Here you go

using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None)]
    public class ADXOtherTimeFrame : Robot
    {
        private BollingerBands _bb;
        private Bars _otherTimeFrameBars;

        [Parameter("Other Time Frame")]
        public TimeFrame OtherTimeFrame { get; set; }

        [Parameter("Periods")]
        public int Periods { get; set; }

        [Parameter("Deviation")]
        public int Deviation { get; set; }

        protected override void OnStart()
        {
            _otherTimeFrameBars = MarketData.GetBars(OtherTimeFrame);

            _bb = Indicators.BollingerBands(_otherTimeFrameBars.ClosePrices, Periods, Deviation, MovingAverageType.Simple);
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous