Replies

kontodospamu5
25 Jan 2019, 17:04

Hello Panagiotis,
Thank you for a quick response, I appresiate that.

 

rsi.Result[ts.OpenTime.GetIndexByTime(Server.Time.AddHours(-5))

is able to take us 5 hours back on already calculated rsi time series.

 

Therefore all three aa0, aa1, aa2 are equal

double aa0 = rsi.Result.LastValue;
double aa1 = rsi.Result[ts.OpenTime.GetIndexByTime(Server.Time.AddMinutes(-1))];
double aa2 = rsi.Result[ts.OpenTime.GetIndexByTime(Server.Time.AddMinutes(-5))];

 

I am afraid that to achieve my goal we would need to recalculate rsi because some modifications to time series “ts.Close” are required.
Why modifications are required? Because assuming that now is 15:35 (so we are in the middle of Hour Bar), we have to move back to 9:16 in the morning (another “broken” bar 16 minutes after opening of Hour bar).


I suppose that such modifications would be of the form of combining Hour and Minute MarketData.GetSeries().
I mean: let us take Hour till 9:00 and append to it a one bar constructed from 16 bars of Minute MarketData.GetSeries(). As a result we would have now 15:35 the Hour time series as it was at 9:16 that morning.

Do you think it is possible?

Best regards,
Piotr


@kontodospamu5

kontodospamu5
14 Jan 2019, 11:33

Hello Panagiotis,

Thank you for a quick response, indeed.

Works perfectly, that is what I was looking for.

Thank you & Regards,

Piotr


@kontodospamu5

kontodospamu5
11 Jan 2019, 19:12 ( Updated at: 21 Dec 2023, 09:21 )

Hello Panagiotis,

 

Thank you for your questions. Let me start from the beginning.

What is the architecture of my solution?

There is cBot (“A”), and the dynamic library .dll (“B”). Now in B I would like to embed some methods that I often use in my cBots.

For example, in B I would like to have:

  1. the calculation methods which compute my house-made oscillators,
  2. a method that calculates my commission (some brokers offer commissions that is not so easily calculable),
  3. methods that breaks-down total unrealized PnL, to PnLs’ of a “sub-strategy”,
  4. exporting my Positions to Excel etc

Now, in “A” I would like to call a method that is placed in B. But I would like to take from A to B not only arguments which are double, int, string etc, I would like to take from A to B also the instances of "Positions", "MarketData" etc.

 

I try to construct dll as follows:

using cAlgo.API;

namespace pw_cTrader
{
    public class General : Robot
    {
        public static int GetPosCnt(Robot robot)
        {
            int iPosCnt;
            iPosCnt = robot.Positions.Count;
            return iPosCnt;
        }
        
        public static void Get_bid_ask(Robot robot, out double bid, out double ask)
        {
            cAlgo.API.Internals.Symbol s1 = robot.MarketData.GetSymbol("EURUSD");
            bid = s1.Bid;
            ask = s1.Ask;
        }
    }
}

 

then I try to call method GetPosCnt() in cBot in the following way:

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using pw_cTrader;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class sample_cBot : Robot
    {
        protected override void OnStart()
        {
            Robot robot = new Robot();
            //robot = Robot;

            int how_manyPositions = 0;
            how_manyPositions = General.GetPosCnt(robot);

            double bid, ask;
            General.Get_bid_ask(robot, out bid, out ask);


        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

 

“A” enters dll but stalls on “iPosCnt = robot.Positions.Count;” row showing the error:

Could you tell me how to effectively transfer the instance of Robot class to the dll embedded method "GetPosCnt" so that to have access to "Positions", "MarketData" etc?

Regards,

Piotr


@kontodospamu5

kontodospamu5
09 Jan 2019, 18:24 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Spotware said:

In order to access Positions collection you need to obtain it from instance of Robot class. 

For example:

public class General
    {
        private int GetPosCnt(Robot robot)
        {
            int iPosCnt;
            iPosCnt = robot.Positions.Count;
            return iPosCnt;
        }
    }

 

Dear Spotware,

 

I tried to call “GetPosCnt(robot)” in my cBot:

namespace cAlgo.Robots

{

[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]

public class sample_cBot : Robot

{

protected override void OnStart()

{

Robot robot = new Robot();

robot = Robot;

GetPosCnt(robot)


}

}

}

 

 

as following:

Robot robot = new Robot();

robot = Robot;

GetPosCnt(robot)

 

 

But it returns error of the form:

 

Could you tell me what am I doing wrong?

Could you show us the syntax of the calling method, pls.

How to effectively obtain it from instance of Robot class in the dll embedded method "GetPosCnt" so that to have access to "Positions", "MarketData" etc?

 

Regards,

Piotr


@kontodospamu5

kontodospamu5
14 Nov 2018, 02:37 ( Updated at: 21 Dec 2023, 09:20 )

Hello Panagiotis,

 

Thank you for your patience.

Let me show you the code that perfectly illustrates two issues I faced.

  1. When you attach the indicator to the chart, it takes 30secs to draw the indicator, for the first time. As far as refreshing of already drawn indicator is concerned, it luckily does not last so long as the first one. But here arises the second problem…
  2. When you attach the indicator it starts to consume more and more Memory. It becomes a real problem if you try to attach the indicator to more than 3 charts. It may even come to closing up the instance of cTrader in uncontrolled way at all.

Now let me present you the body of the Indicator.

The aim of the indicator is to show a mean prices of several currencies:

 

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


namespace cAlgo
{    
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class IndicatorName : Indicator
    {
        [Output("AUD", Color = Colors.Yellow)]
        public IndicatorDataSeries AUD { get; set; }

        [Output("CAD", Color = Colors.Orange)]
        public IndicatorDataSeries CAD { get; set; }

        [Output("CHF", Color = Colors.Violet)]
        public IndicatorDataSeries CHF { get; set; }

        [Output("EUR", Color = Colors.Blue)]
        public IndicatorDataSeries EUR { get; set; }

        [Output("GBP", Color = Colors.Red)]
        public IndicatorDataSeries GBP { get; set; }

        [Output("JPY", Color = Colors.White)]
        public IndicatorDataSeries JPY { get; set; }

        [Output("NZD", Color = Colors.Pink)]
        public IndicatorDataSeries NZD { get; set; }

        [Output("USD", Color = Colors.Green)]
        public IndicatorDataSeries USD { get; set; }


        protected override void Initialize()
        {
        }

        public override void Calculate(int index)
        {
            TimeFrame TF_chart = MarketSeries.TimeFrame;                                            // bieżący wykres na jakim jest TimeFrame'ie?

            // USD
            //MarketSeries AUDUSD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("AUDUSD"), TimeFrame.Daily);                
            MarketSeries AUDUSD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("AUDUSD"), TF_chart);                  
            MarketSeries USDCAD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("USDCAD"), TF_chart);                  
            MarketSeries USDCHF_ohlc = MarketData.GetSeries(MarketData.GetSymbol("USDCHF"), TF_chart);                  
            MarketSeries EURUSD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURUSD"), TF_chart);                  
            MarketSeries GBPUSD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("GBPUSD"), TF_chart);                  
            MarketSeries USDJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("USDJPY"), TF_chart);                  
            MarketSeries NZDUSD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("NZDUSD"), TF_chart);                  

            // EUR            
            MarketSeries EURAUD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURAUD"), TF_chart);                  
            MarketSeries EURCAD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURCAD"), TF_chart);                  
            MarketSeries EURCHF_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURCHF"), TF_chart);                  
            MarketSeries EURGBP_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURGBP"), TF_chart);                  
            MarketSeries EURJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURJPY"), TF_chart);                  
            MarketSeries EURNZD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("EURNZD"), TF_chart);                  


            // AUD
            MarketSeries AUDCAD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("AUDCAD"), TF_chart);                  
            MarketSeries AUDCHF_ohlc = MarketData.GetSeries(MarketData.GetSymbol("AUDCHF"), TF_chart);                  
            MarketSeries AUDJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("AUDJPY"), TF_chart);                  
            MarketSeries GBPAUD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("GBPAUD"), TF_chart);                  
            MarketSeries AUDNZD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("AUDNZD"), TF_chart);                  

            // CAD
            MarketSeries CADCHF_ohlc = MarketData.GetSeries(MarketData.GetSymbol("CADCHF"), TF_chart);                  
            MarketSeries GBPCAD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("GBPCAD"), TF_chart);                  
            MarketSeries CADJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("CADJPY"), TF_chart);                       

            // CHF
            MarketSeries GBPCHF_ohlc = MarketData.GetSeries(MarketData.GetSymbol("GBPCHF"), TF_chart);                  
            MarketSeries CHFJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("CHFJPY"), TF_chart);                  
            MarketSeries NZDCHF_ohlc = MarketData.GetSeries(MarketData.GetSymbol("NZDCHF"), TF_chart);                  

            // GBP
            MarketSeries GBPJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("GBPJPY"), TF_chart);                  
            MarketSeries GBPNZD_ohlc = MarketData.GetSeries(MarketData.GetSymbol("GBPNZD"), TF_chart);                  

            // NZD
            MarketSeries NZDJPY_ohlc = MarketData.GetSeries(MarketData.GetSymbol("NZDJPY"), TF_chart);                  
            


            // USD
            // EURUSD
            double USD_from_EURUSD = 1 / EURUSD_ohlc.Close.LastValue;
            
            // AUDUSD
            double USD_from_AUDUSD = 1 / AUDUSD_ohlc.Close.LastValue / EURAUD_ohlc.Close.LastValue;
            
            // USDCAD
            double USD_from_USDCAD = USDCAD_ohlc.Close.LastValue / EURCAD_ohlc.Close.LastValue;
            
            // USDCHF
            double USD_from_USDCHF = USDCHF_ohlc.Close.LastValue / EURCHF_ohlc.Close.LastValue;
            
            // GBPUSD
            double USD_from_GBPUSD = 1 / GBPUSD_ohlc.Close.LastValue / EURGBP_ohlc.Close.LastValue;
            
            // USDJPY
            double USD_from_USDJPY = USDJPY_ohlc.Close.LastValue / EURJPY_ohlc.Close.LastValue;
            
            // NZDUSD
            double USD_from_NZDUSD = 1 / NZDUSD_ohlc.Close.LastValue / EURNZD_ohlc.Close.LastValue;
            

            double[] USD_tdy = { USD_from_EURUSD, USD_from_AUDUSD, USD_from_USDCAD, USD_from_USDCHF, USD_from_GBPUSD, USD_from_USDJPY, USD_from_NZDUSD };
            
            USD[index] = USD_tdy.Average();


            // AUD:
            // AUDUSD                
            double AUD_from_AUDUSD = AUDUSD_ohlc.Close.LastValue;
            
            // AUDCAD
            double AUD_from_AUDCAD = AUDCAD_ohlc.Close.LastValue / USDCAD_ohlc.Close.LastValue;
            
            // AUDCHF
            double AUD_from_AUDCHF = AUDCHF_ohlc.Close.LastValue / USDCHF_ohlc.Close.LastValue;
            
            // EURAUD
            double AUD_from_EURAUD = 1 / EURAUD_ohlc.Close.LastValue * EURUSD_ohlc.Close.LastValue;
            
            // GBPAUD
            double AUD_from_GBPAUD = 1 / GBPAUD_ohlc.Close.LastValue * GBPUSD_ohlc.Close.LastValue;
            
            // AUDJPY
            double AUD_from_AUDJPY = AUDJPY_ohlc.Close.LastValue / USDJPY_ohlc.Close.LastValue;
            
            // AUDNZD
            double AUD_from_AUDNZD = AUDNZD_ohlc.Close.LastValue * NZDUSD_ohlc.Close.LastValue;
            
            double[] AUD_tdy = { AUD_from_AUDUSD, AUD_from_AUDCAD, AUD_from_AUDCHF, AUD_from_EURAUD, AUD_from_GBPAUD, AUD_from_AUDJPY, AUD_from_AUDNZD };
            
            AUD[index] = AUD_tdy.Average();



            // CAD:
            // USDCAD                
            double CAD_from_USDCAD = 1 / USDCAD_ohlc.Close.LastValue;
            
            // AUDCAD
            double CAD_from_AUDCAD = 1 / AUDCAD_ohlc.Close.LastValue * AUDUSD_ohlc.Close.LastValue;
            
            // CADCHF
            double CAD_from_CADCHF = CADCHF_ohlc.Close.LastValue / USDCHF_ohlc.Close.LastValue;
            
            // EURCAD
            double CAD_from_EURCAD = 1 / EURCAD_ohlc.Close.LastValue * EURUSD_ohlc.Close.LastValue;
            
            // GBPCAD
            double CAD_from_GBPCAD = 1 / GBPCAD_ohlc.Close.LastValue * GBPUSD_ohlc.Close.LastValue;
            
            // CADJPY
            double CAD_from_CADJPY = CADJPY_ohlc.Close.LastValue / USDJPY_ohlc.Close.LastValue;
            
            double[] CAD_tdy = { CAD_from_USDCAD, CAD_from_AUDCAD, CAD_from_CADCHF, CAD_from_EURCAD, CAD_from_GBPCAD, CAD_from_CADJPY };
            CAD[index] = CAD_tdy.Average();



            // CHF:
            // CHFUSD                
            double CHF_from_USDCHF = 1 / USDCHF_ohlc.Close.LastValue;
            
            // AUDCHF
            double CHF_from_AUDCHF = 1 / AUDCHF_ohlc.Close.LastValue * AUDUSD_ohlc.Close.LastValue;
            
            // CADCHF
            double CHF_from_CADCHF = 1 / CADCHF_ohlc.Close.LastValue / USDCAD_ohlc.Close.LastValue;
            
            // EURCHF
            double CHF_from_EURCHF = 1 / EURCHF_ohlc.Close.LastValue * EURUSD_ohlc.Close.LastValue;
            
            // GBPCHF
            double CHF_from_GBPCHF = 1 / GBPCHF_ohlc.Close.LastValue * GBPUSD_ohlc.Close.LastValue;
            
            // CHFJPY
            double CHF_from_CHFJPY = CHFJPY_ohlc.Close.LastValue / USDJPY_ohlc.Close.LastValue;
            
            // NZDCHF
            double CHF_from_NZDCHF = 1 / NZDCHF_ohlc.Close.LastValue * NZDUSD_ohlc.Close.LastValue;
            
            double[] CHF_tdy = { CHF_from_USDCHF, CHF_from_AUDCHF, CHF_from_CADCHF, CHF_from_EURCHF, CHF_from_GBPCHF, CHF_from_CHFJPY, CHF_from_NZDCHF };
            CHF[index] = CHF_tdy.Average();


            // EUR:
            // EURUSD                
            double EUR_from_EURUSD = EURUSD_ohlc.Close.LastValue;
            
            // EURAUD
            double EUR_from_EURAUD = EURAUD_ohlc.Close.LastValue * AUDUSD_ohlc.Close.LastValue;
            
            // EURCAD
            double EUR_from_EURCAD = EURCAD_ohlc.Close.LastValue / USDCAD_ohlc.Close.LastValue;
            
            // EURCHF
            double EUR_from_EURCHF = EURCHF_ohlc.Close.LastValue / USDCHF_ohlc.Close.LastValue;
            
            // EURGBP
            double EUR_from_EURGBP = EURGBP_ohlc.Close.LastValue * GBPUSD_ohlc.Close.LastValue;
            
            // EURJPY
            double EUR_from_EURJPY = EURJPY_ohlc.Close.LastValue / USDJPY_ohlc.Close.LastValue;
            
            // EURNZD
            double EUR_from_EURNZD = EURNZD_ohlc.Close.LastValue * NZDUSD_ohlc.Close.LastValue;
            


            double[] EUR_tdy = { EUR_from_EURUSD, EUR_from_EURAUD, EUR_from_EURCAD, EUR_from_EURCHF, EUR_from_EURGBP, EUR_from_EURJPY, EUR_from_EURNZD };
            EUR[index] = EUR_tdy.Average();



            // JPY:
            // USDJPY                
            double JPY_from_USDJPY = 1 / USDJPY_ohlc.Close.LastValue;
            
            // AUDJPY
            double JPY_from_AUDJPY = 1 / AUDJPY_ohlc.Close.LastValue * AUDUSD_ohlc.Close.LastValue;
            
            // CADJPY
            double JPY_from_CADJPY = 1 / CADJPY_ohlc.Close.LastValue / USDCAD_ohlc.Close.LastValue;
            
            // EURJPY
            double JPY_from_EURJPY = 1 / EURJPY_ohlc.Close.LastValue * EURUSD_ohlc.Close.LastValue;
            
            // GBPJPY
            double JPY_from_GBPJPY = 1 / GBPJPY_ohlc.Close.LastValue * GBPUSD_ohlc.Close.LastValue;
            
            // CHFJPY
            double JPY_from_CHFJPY = 1 / CHFJPY_ohlc.Close.LastValue / USDCHF_ohlc.Close.LastValue;
            
            // NZDJPY
            double JPY_from_NZDJPY = 1 / NZDJPY_ohlc.Close.LastValue * NZDUSD_ohlc.Close.LastValue;
            
            double[] JPY_tdy = { JPY_from_USDJPY, JPY_from_AUDJPY, JPY_from_CADJPY, JPY_from_CHFJPY, JPY_from_EURJPY, JPY_from_GBPJPY, JPY_from_NZDJPY };

            JPY[index] = JPY_tdy.Average();


            // NZD:
            // NZDUSD                
            double NZD_from_NZDUSD = NZDUSD_ohlc.Close.LastValue;
            
            // NZDCHF
            double NZD_from_NZDCHF = NZDCHF_ohlc.Close.LastValue / USDCHF_ohlc.Close.LastValue;
            
            // EURNZD
            double NZD_from_EURNZD = 1 / EURNZD_ohlc.Close.LastValue * EURUSD_ohlc.Close.LastValue;
            
            // GBPNZD
            double NZD_from_GBPNZD = 1 / GBPNZD_ohlc.Close.LastValue * GBPUSD_ohlc.Close.LastValue;
            
            // NZDJPY
            double NZD_from_NZDJPY = NZDJPY_ohlc.Close.LastValue / USDJPY_ohlc.Close.LastValue;
            
            // AUDNZD
            double NZD_from_AUDNZD = 1 / AUDNZD_ohlc.Close.LastValue * AUDUSD_ohlc.Close.LastValue;
            
            double[] NZD_tdy = { NZD_from_NZDUSD, NZD_from_NZDJPY, NZD_from_GBPNZD, NZD_from_AUDNZD, NZD_from_NZDCHF, NZD_from_EURNZD };
            NZD[index] = NZD_tdy.Average();


            // GBP:
            // GBPUSD                
            double GBP_from_GBPUSD = GBPUSD_ohlc.Close.LastValue;
            
            // GBPAUD
            double GBP_from_GBPAUD = GBPAUD_ohlc.Close.LastValue * AUDUSD_ohlc.Close.LastValue;
            
            // GBPCAD
            double GBP_from_GBPCAD = GBPCAD_ohlc.Close.LastValue / USDCAD_ohlc.Close.LastValue;
            
            // GBPCHF
            double GBP_from_GBPCHF = GBPCHF_ohlc.Close.LastValue / USDCHF_ohlc.Close.LastValue;
            
            // EURGBP
            double GBP_from_EURGBP = 1 / EURGBP_ohlc.Close.LastValue * EURUSD_ohlc.Close.LastValue;
            
            // GBPJPY
            double GBP_from_GBPJPY = GBPJPY_ohlc.Close.LastValue / USDJPY_ohlc.Close.LastValue;
            
            // GBPNZD
            double GBP_from_GBPNZD = GBPNZD_ohlc.Close.LastValue * NZDUSD_ohlc.Close.LastValue;
            
            double[] GBP_tdy = { GBP_from_GBPUSD, GBP_from_GBPJPY, GBP_from_GBPAUD, GBP_from_GBPNZD, GBP_from_GBPCAD, GBP_from_GBPCHF, GBP_from_EURGBP };
            GBP[index] = GBP_tdy.Average();


        }




    }
}

 

I wonder if there is a more “subtle” ie cleverer way to retrieve time-series as opposed to the brutal series of rows of:

MarketData.GetSeries(MarketData.GetSymbol("cur1cur2"), TimeSeries.Daily);  

 

Perhaps multi threading approach would be more efficient or something else.

Please share your view on the matter.

Regards,

PiotrW

PS. Please do not assess the motivation/reasoning behind the Indicator;)


@kontodospamu5

kontodospamu5
08 Nov 2018, 02:01

Hello,

sorry, what I meant is not GetSeries asynchronously.

In my INDICATOR I have the code as follows:

// USD
MarketSeries AUDUSD_D1 = MarketData.GetSeries(MarketData.GetSymbol("AUDUSD"), TF_chart);      
MarketSeries USDCAD_D1 = MarketData.GetSeries(MarketData.GetSymbol("USDCAD"), TF_chart);      
MarketSeries USDCHF_D1 = MarketData.GetSeries(MarketData.GetSymbol("USDCHF"), TF_chart);      
MarketSeries EURUSD_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURUSD"), TF_chart);      
MarketSeries GBPUSD_D1 = MarketData.GetSeries(MarketData.GetSymbol("GBPUSD"), TF_chart);      
MarketSeries USDJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("USDJPY"), TF_chart);      
MarketSeries NZDUSD_D1 = MarketData.GetSeries(MarketData.GetSymbol("NZDUSD"), TF_chart);      

// EUR
MarketSeries EURAUD_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURAUD"), TF_chart);      
MarketSeries EURCAD_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURCAD"), TF_chart);      
MarketSeries EURCHF_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURCHF"), TF_chart);      
MarketSeries EURGBP_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURGBP"), TF_chart);      
MarketSeries EURJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURJPY"), TF_chart);      
MarketSeries EURNZD_D1 = MarketData.GetSeries(MarketData.GetSymbol("EURNZD"), TF_chart);      


// AUD
MarketSeries AUDCAD_D1 = MarketData.GetSeries(MarketData.GetSymbol("AUDCAD"), TF_chart);      
MarketSeries AUDCHF_D1 = MarketData.GetSeries(MarketData.GetSymbol("AUDCHF"), TF_chart);      
MarketSeries AUDJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("AUDJPY"), TF_chart);      
MarketSeries GBPAUD_D1 = MarketData.GetSeries(MarketData.GetSymbol("GBPAUD"), TF_chart);      
MarketSeries AUDNZD_D1 = MarketData.GetSeries(MarketData.GetSymbol("AUDNZD"), TF_chart);      

// CAD
MarketSeries CADCHF_D1 = MarketData.GetSeries(MarketData.GetSymbol("CADCHF"), TF_chart);      
MarketSeries GBPCAD_D1 = MarketData.GetSeries(MarketData.GetSymbol("GBPCAD"), TF_chart);      
MarketSeries CADJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("CADJPY"), TF_chart);      
MarketSeries CADNZD_D1 = MarketData.GetSeries(MarketData.GetSymbol("CADNZD"), TF_chart);      

// CHF
MarketSeries GBPCHF_D1 = MarketData.GetSeries(MarketData.GetSymbol("GBPCHF"), TF_chart);      
MarketSeries CHFJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("CHFJPY"), TF_chart);      
MarketSeries NZDCHF_D1 = MarketData.GetSeries(MarketData.GetSymbol("NZDCHF"), TF_chart);      

// GBP
MarketSeries GBPJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("GBPJPY"), TF_chart);      
MarketSeries GBPNZD_D1 = MarketData.GetSeries(MarketData.GetSymbol("GBPNZD"), TF_chart);      

// NZD
MarketSeries NZDJPY_D1 = MarketData.GetSeries(MarketData.GetSymbol("NZDJPY"), TF_chart);  

The problem is that the calculation comsumes so much time to retrieve TimeSeries of above crosses when the every "index" is triggered to populate the INDICATOR.

Perhaps there is more sophisticated way to retrieve timeseries faster: e.g split on seperate threads or similar.

Regards,

kontodospamu5

 


@kontodospamu5

kontodospamu5
06 Nov 2018, 22:51

Hello,

 

yes, I was referring to the last issue raised by bachapk on 2015-09-09

The problem faced was how to speed up loading full history of a number of Symbols through calling GetSeries asynchronously.

Many Thanks,

kontdospamu5


@kontodospamu5

kontodospamu5
03 Nov 2018, 14:09

Hello,

I would like to refresh the thread as I encountered the same problem with retrieving timeseries of Symbols applying MarketData.GetSeries a number of times (28 or so).

Dear Spotware tell us please if you solved issue with calling GetSeries asynchronously.

Many Thanks,

kontdospamu5


@kontodospamu5

kontodospamu5
03 Nov 2018, 02:07

Dear Panagiotis,

Thank you for a quick response indeed.

Sorry to tell you but the solution you proposed is not working.

I received “Error CS1061  'Form' does not contain a definition for 'UpdateLabel' and no extension method 'UpdateLabel' accepting a first argument of type 'Form' could be found (are you missing a using directive or an assembly reference?)” although I applied:

using System.Windows.Forms;

using System.Threading;

 

I know how to build a Windows Form in cBot, but I have problems with updating label in the Form.

Panagiotis I have request, if it is not a problem, could you please present an exemplary but full script of how to construct a Windows Form with one label in a cBot in OnStart() and how to update that label.Text with Symbol.Bid in OnTick(), please.

 

Best Regards,

kontodospamu5


@kontodospamu5

kontodospamu5
01 Nov 2018, 02:09

RE:

Dear Panagiotis,

 

could you please give an example how to construct in "OnTick()" section a cross-thread reference to a label1 placed in the "_f1" form?

Best Regards,

PiotrW


@kontodospamu5

kontodospamu5
13 Mar 2017, 19:00

RE:

Multi-symbol backtesting is not supported yet (2017-03-13).

Could you pls tell us when it will be available.

Regards,Pit

 

 


@kontodospamu5