Topics
14 Sep 2019, 20:25
 1167
 9
21 Jan 2019, 12:19
 1083
 3
16 Jan 2019, 22:29
 1887
 8
Replies

pmcarvalho
21 Sep 2019, 21:35

RE:

Panagiotis Charalampous said:

Hi Pedro,

But it doesn't go that far.  It probably stops at the first value it has available on the chart.

Indeed this is true. See below a workaround

 

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            Chart.ScrollChanged += OnChartScrollChanged;
            if (MarketSeries.OpenTime[0] > new DateTime(2014, 1, 1))
            {
                Chart.ScrollXTo(MarketSeries.OpenTime[0]);
            }
        }

        void OnChartScrollChanged(ChartScrollEventArgs obj)
        {
            if (MarketSeries.OpenTime[0] > new DateTime(2014, 1, 1))
            {
                Chart.ScrollXTo(MarketSeries.OpenTime[0]);
            }
        }



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

Best Regards,

Panagiotis

Panagiotis Charalampous

Thanks.

It worked.

By the way. There is a way to pass the date to the handler (OnChartScrollChanged), instead of beeing hardcoded (new DateTime(2014, 1, 1))?

Thanks

Pedro


@pmcarvalho

pmcarvalho
19 Sep 2019, 15:35

RE:

Panagiotis Charalampous said:

Hi Perdo,

Can you tell me symbol and the broker you are using?

Best Regards,

Panagiotis

Hi Panagiotis Charalampous

Any idea?

Thanks

Pedro


@pmcarvalho

pmcarvalho
16 Sep 2019, 13:36

RE:

Panagiotis Charalampous said:

Hi Perdo,

Can you tell me symbol and the broker you are using?

Best Regards,

Panagiotis

Panagiotis Charalampous

Symbol: EURUSD - H1

Broker: FxPro

Thanks

Pedro


@pmcarvalho

pmcarvalho
16 Sep 2019, 11:22

RE:

Panagiotis Charalampous said:

Hi pmcarvalho,

From where do you want to access the prices? From the chart? If yes then just scroll back to the specific date.

Best Regards,

Panagiotis

Hi Panagiotis Charalampous
I am building a bot for statistics and caching.
I already tried to use this: "Chart.ScrollXTo ([date]);"
But it doesn't go that far.  It probably stops at the first value it has available on the chart.
Any idea?

Thanks

Pedro


@pmcarvalho

pmcarvalho
04 Feb 2019, 11:24

Hi Panagiotis

Because I wanted to do a functions library.

I have functions that are used in some bots and I have to have the same functions in all of them. And when I have to change one, I have to be looking at all the bots.

And I do not know a way to do a library of functions.

Thanks


@pmcarvalho

pmcarvalho
25 Jan 2019, 16:22

So there is no way to solve my question?

Thanks


@pmcarvalho

pmcarvalho
25 Jan 2019, 15:24

RE:

pmcarvalho said:

I think I have the latest version.
But at the top of the application appears FxPro cTrader 3.0
But I downloaded it right now and I ran the setup and it still says the same thing.
I can not find this new version.

Thanks

It's Beta???


@pmcarvalho

pmcarvalho
25 Jan 2019, 15:19

I think I have the latest version.
But at the top of the application appears FxPro cTrader 3.0
But I downloaded it right now and I ran the setup and it still says the same thing.
I can not find this new version.

Thanks


@pmcarvalho

pmcarvalho
24 Jan 2019, 22:48

Hi Panagiotis

I have tried your code but it does not work. 

Error CS0117: 'cAlgo.API.Chart' does not contain a definition for 'ScrollXTo'

Am I missing something?

Thanks


@pmcarvalho