Topics
03 May 2025, 17:17
 263
 0
01 May 2025, 16:34
 343
 7
09 Apr 2025, 11:13
 265
 1
01 Apr 2025, 08:01
 302
 1
07 Mar 2025, 14:54
 263
 1
11 Feb 2025, 13:04
 503
 2
26 Jan 2025, 11:42
 353
 1
14 Jan 2025, 09:21
 353
 1
19 Dec 2024, 16:10
 0
 393
 0
11 Dec 2024, 09:55
 481
 2
04 Nov 2024, 17:12
 716
 5
22 Oct 2024, 06:29
 0
 481
 0
20 Oct 2024, 04:36
 511
 1
11 Oct 2024, 06:30
 0
 516
 0
11 Oct 2024, 06:30
 0
 505
 0
10 Oct 2024, 12:37
 513
 2
13 Sep 2024, 07:14
 1
 487
 0
Replies

eynt
10 Jun 2020, 16:01

RE:

Hello

 

Luckily I was able to reproduce the problem easily using the robot's code at the bottom.

Please run it on a 1-pip range bar, on a live chart as I am not sure if it will work on a back test. I suggest to run it on GBPNZD or even several symbols simultaniously since it might take a few hours before the problem happens.

 

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CatchBug : Robot
    {
        private int _startBarCount;

        protected override void OnStart()
        {
            LoadBars(this.Time.AddDays(-60));

            _startBarCount = Bars.Count;
            
            Print("OnStart " + _startBarCount);
        }

        protected override void OnTick()
        {
            if (Bars.Count < _startBarCount)
            {
                Print("Bug catch. Bars.Count= " + Bars.Count + " _startBarCount= " + _startBarCount);

                throw new Exception("Bug catch. Bars.Count= " + Bars.Count + " _startBarCount= " + _startBarCount);
            }
        }
        public void LoadBars(DateTime requiredStartDate)
        {
            while (Bars.OpenTimes[0] > requiredStartDate)
            {
                int loadedCount = Bars.LoadMoreHistory();

                if (loadedCount == 0)
                    break;
            }
        }
    }
}

 


@eynt

eynt
10 Jun 2020, 11:01

RE:

Thanks

 

Is there a way to know if the object or chart was double clicked?


@eynt

eynt
10 Jun 2020, 10:05 ( Updated at: 21 Dec 2023, 09:22 )

RE:

Hi

 

The steps which led me to the problem were a bit complicated however in order to simplify I would use the following steps and hopefully it will give the same results:

1. Create a cBot and save its bars count

OnStart:         _startBarCount = Bars.Count;

2. Make sure the bars count does not go below the initial value

OnTick:          if (Bars.Count  < _startBarCount )  throw new exception("");

3. Run the bot on 1 pip range chart and make sure it loads history for 30 days at least on the Initialize

 

This might take some time even a few days until the problem occurs. Maybe loading more than 30 days will reproduce it faster. I would also use a symbol such has GBPNZD which has a lot of movement.

I'm attaching a debug screenshot. As you can the see the Bars.Count equals to 1068 only, which is impossible value for a 1-pip range chart. Moreover, the RightBar value which is held in one of my indicators and often save the last bar index has the value of 357663 which means the Bars.Count value should be at least that.

Besides knowing if you were able to reproduce the problem, I would like to know if the Bars property has some sort of size limitations?

 

Thanks

 

 

 

 

 


@eynt

eynt
07 Jun 2020, 09:33

RE: RE:

Hello

 

Anything new on the subject?

 


@eynt

eynt
04 Jun 2020, 09:25

RE:

Thank you.

 

What if each symbol loads an indicator (base on its symbol and a specific time frame. How can I access that from the Symbol_Tick? 


@eynt

eynt
04 Jun 2020, 09:16

RE:

Thank you 

 

Please understand the following problem:

My chart has many indicators, and one of them calls the function LoadMoreHistory many times (on a loop until a specific data is reached). As a result, on each  call of the LoadMoreHistory ALL of my indicators are refreshing and reloading themselfs again. This cause the load of the chart to last very long time, even minutes.

 

What do you suggest to solve this issue?


@eynt

eynt
02 Jun 2020, 10:31

RE:

Thank you

 

1. How can I choose between with or without the source code?

2. This means that if I made changes on code in the origin computer after I ran the algo file on the destination computer I need to build my cBot?


@eynt

eynt
01 Jun 2020, 17:50

RE:

Hi

 

1. It will only add an algo file without the source code, correct?

2. Do I need to build my cBot on the destination computer after double clicking the algo file?

 


@eynt

eynt
31 May 2020, 10:04

RE:

Thank you

 

Is there a way to change a chart's symbol by code of an indicator?


@eynt

eynt
28 May 2020, 16:14

RE:

Hi

 

What about prints for an indicator?


@eynt

eynt
28 May 2020, 15:36 ( Updated at: 21 Dec 2023, 09:22 )

RE:

Thanks

 

I don't have a log tab at all when I switch to automate

 


@eynt

eynt
26 May 2020, 16:52

RE:

Does the Algo file contains inside all the references used by it?

 

Thanks

 


@eynt

eynt
26 May 2020, 09:31

RE:

What if I want to move 50 files from computer A to computer B. Is there an easier way to do that instead of double click 50 times?

 

Thanks

 

 


@eynt

eynt
26 May 2020, 09:21

RE:

Thanks

 

Is there a way to export all my Robots/Indicators together in one time instead of double click them one by one?

 


@eynt

eynt
26 May 2020, 08:45

RE:

Than you

 

In order to close the position I need to use ClosePosition which takes a parameter of type Position which does not has a constructor and therefor even if I have all the data from the files I can't create a new position instance in order to close the open position.


@eynt

eynt
25 May 2020, 12:45

RE:

Thank you.

 

When I call LoadMoreHistory it causes my indicator to reload itself and therefor call the LoadMoreHistory which again reloads then indicator which again calls LoadMoreHistory etc.

How can I stop this loop?


@eynt

eynt
22 May 2020, 12:14

RE:

Thank you

 

Unfortuanatlly I did not completly understood the way the SyncObjectsInstance works and therefor do not know how to add the ScrollXBy/ScrollXTo. Perhaps you show me the modifications I need to add to the SyncObjectsInstance itself so it not only sync objects but scrolling as well. I'm pretty sure it's a small change and I could take if from there.

 


@eynt

eynt
22 May 2020, 11:03

RE:

Thank you.

Once I discovered such an object how can I remove it from the chart?


@eynt

eynt
22 May 2020, 09:55

RE:

How can one charts interact with another?

 

Thanks


@eynt

eynt
21 May 2020, 21:24

RE:

What I meant is that my custom indicator creates objects on the charts such as lines, texts, etc. When I remove the indicator the objects remain. I want them automatically removed as well.

 

Thanks


@eynt