Multi-symbol robots and indicators

constantromeo1987 since: 13 Sep 2019; 
 13 Sep 2019, 18:28
Multi-symbol robots and indicators

Hi Spotware Team, nice improvements. I still cannot run average true range indicator on multiple symbols.

Please could you let us know when the feature will be available or if there is a way to get around the problem.

Thanks in advance.

Regards,

Abhi

constantromeo1987 since: 13 Sep 2019; 
 13 Sep 2019, 18:29
RE: RE: RE: Multi-symbol robots and indicators

Abhi said:

Spotware said:

Abhi said:

Hi Spotware Team, nice improvements. I still cannot run average true range indicator on multiple symbols.

Please could you let us know when the feature will be available or if there is a way to get around the problem.

Thanks in advance.

Regards,

Abhi

Please specify what you mean by saying that. You can use multi-symbol data in code of your indicator. You can also add ATR to several charts.

I want to show ATR for multiple symbols on a single chart. The  method call "Indicators.AverageTrueRange(int period , MovingAverageType.Exponential)" can be only called for a single symbol in a chart. Is there anyway to call ATR on multiple symbols and show up on a chart like you showed for RelativeStrengthIndex in this forum on previous posts.

Does it make sense now.

danblackadder since: 17 Sep 2017; 
 11 Nov 2019, 14:03

BUMP. Multi-symbol support in back testing when? I have been waiting over 2 years for this... 

Panagiotis Charalampous's avatar
Panagiotis Charalampous since: 13 Jan 2017; 
 11 Nov 2019, 16:42
RE:

danblackadder said:

BUMP. Multi-symbol support in back testing when? I have been waiting over 2 years for this... 

Hi danblackadder,

It will be included in 3.7

Best Regards,

Panagiotis

Head of Community Management at cTrader
taha.benbrahim.ic since: 09 Oct 2019; 
 21 Nov 2019, 10:01
Multiple Renko charts

Hi,

Can i access a multiple  Renko charts with 

MarketSeries series = MarketData.GetSeries("EURCAD", TimeFrame.Minute15);

Thanks.

ctid1574514 since: 18 Oct 2019; 
 23 Nov 2019, 03:15
RE: RE:

Panagiotis Charalampous said:

danblackadder said:

BUMP. Multi-symbol support in back testing when? I have been waiting over 2 years for this... 

Hi danblackadder,

It will be included in 3.7

Best Regards,

Panagiotis

https://ctrader.com/forum/suggestions/21283?page=6#post-56

3.7 will be before Xmas

ctid1574514 since: 18 Oct 2019; 
 23 Nov 2019, 03:16
RE: RE:

Panagiotis Charalampous said:

danblackadder said:

BUMP. Multi-symbol support in back testing when? I have been waiting over 2 years for this... 

Hi danblackadder,

It will be included in 3.7

Best Regards,

Panagiotis

https://ctrader.com/forum/suggestions/21283?page=6#post-56

3.7 will be before xmas 

DelTrader's avatar
DelTrader since: 25 Jun 2017; 
 02 Jan 2020, 23:59
RE: Correlation Coefficient

cAlgo_Fanatic said:

The correlation coefficient compares how currency pairs have moved in relation to each other.

The correlation coefficient formula is:

using System;
using cAlgo.API;
using cAlgo.API.Internals;

namespace cAlgo.Indicators
{
    [Levels(-1, -0.5, 0, 0.5, 1)]
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, ScalePrecision = 2)]
    public class CorrelationCoefficient : Indicator
    {
        private MarketSeries series2;
        private Symbol symbol2;

        [Parameter(DefaultValue = "EURUSD")]
        public string Symbol2 { get; set; }

        [Parameter(DefaultValue = 22)]
        public int Period { get; set; }

        [Output("Correlation Coefficient", Color = Colors.Yellow)]
        public IndicatorDataSeries Result { get; set; }

        protected override void Initialize()
        {
            symbol2 = MarketData.GetSymbol(Symbol2);
            series2 = MarketData.GetSeries(symbol2, TimeFrame);
        }

        public override void Calculate(int index)
        {
            if (index < Period)
                return;

            double sumX = 0, sumY = 0, sumXY = 0, sumX2 = 0, sumY2 = 0;
            double x, y, x2, y2;

            int index2 = GetIndexByDate(series2, MarketSeries.OpenTime[index]);

            if (index2 == -1)
                return;

            for (int i = 0; i < Period; i++)
            {
                x = MarketSeries.Close[index - i];
                y = series2.Close[index2 - i];

                x2 = x * x;
                y2 = y * y;
                sumX += x;
                sumY += y;
                sumXY += x * y;
                sumX2 += x2;
                sumY2 += y2;
            }

            Result[index] = (Period * (sumXY) - sumX * sumY) / 
                               Math.Sqrt((Period * sumX2 - sumX * sumX) * (Period * sumY2 - sumY * sumY));
        }

        private int GetIndexByDate(MarketSeries series, DateTime time)
        {
            for (int i = series.Close.Count - 1; i >= 0; i--)
            {
                if (time == series.OpenTime[i])
                    return i;
            }
            return -1;
        }
    }
}

Good night,

I want to get the correlation of 2 symbols, for example EURGBP with GBPCHF but showing on EURUSD chart.

Can someone help me? 

Thank you so much
www.instagram.com/delfonsecaa/
kerrifox19 since: 11 Dec 2019; 
 13 Jan 2020, 16:39
RE: RE: Correlation Coefficient

Thanks for sharing this useful information with us.