Redundancies.

Created at 04 Jan 2021, 09:06
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!
PA

patrock333

Joined 05.01.2020

Redundancies.
04 Jan 2021, 09:06


Can someone please provide information to correct what I understand on the following? Thanks.

If I have multiple cBots using the same parameters on two Moving Average Indicators there will be multiple copies of the same data series. I am trying to reduce redundancies in running indicators and cBots that will use the same parameters.


@patrock333
Replies

PanagiotisCharalampous
04 Jan 2021, 10:02

Hi patrock333,

Which data series are you referring to? If you can share some come then it would be easier to understand what do you mean. If the data series you are referring to are local to each cBot instance, then yes you will have multiple copies of it.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

patrock333
05 Jan 2021, 09:07

RE:

PanagiotisCharalampous said:

If the data series you are referring to are local to each cBot instance, then yes you will have multiple copies of it.
 

Thank you Panagiotis, that's what I thought.

 

        private void InitializeData()
        {
            TimeFrame tf = TimeFrame;
            price = MarketData.GetBars(tf);
            ma20 = Indicators.MovingAverage(price.ClosePrices, 20, MovingAverageType.Simple);
            ma200 = Indicators.MovingAverage(price.ClosePrices, 200, MovingAverageType.Simple);
            bb20 = Indicators.BollingerBands(price.ClosePrices, 20, 2, MovingAverageType.Simple);
            bb200 = Indicators.BollingerBands(price.ClosePrices, 200, 2, MovingAverageType.Simple);
        }

I was thinking of designing the cBots such that there will only be one instance of the Moving Average Indicator running and multiple cBots receiving data from it. One cBot may trade on a crossover of the 20-period moving average with the 200-period moving average. Another will trade if it does not. Other cBots will trade with different stop losses, etc. I have the same thought on trading using Bollinger Bands. One cBot trades in a regular manner, that is, when the price hits the top band it buys; when it hits the bottom it sells. Another cBot will do the opposite (contrarian trading). If this Bollinger Band uses a 20-period moving average then that will add to the number of stored data that are identical.

I tried nesting the above indicators in my own indicator to reduce identical data series (eg. the 20-period moving average in the ma20 and the bb20). However, wouldn't each cBot still create its own local copy of the indicator's data? The indicators are also instantiated in different time frames, hence, the concern over limitations in resources.

I may have to go back to getting an external named pipes server working...

I appreciate the help you have been providing Panagiotis. Thanks.


@patrock333

PanagiotisCharalampous
05 Jan 2021, 09:44

Hi patrock333,

If you run multiple instances of the cBot, then you will have multiple local instances of the moving averages. The best and simplest approach would be to incorporate all the logic in a single cBot so that you initialize the shared information only once.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

... Deleted by UFO ...