Topics
Replies
eynt
11 Oct 2020, 10:15
( Updated at: 21 Dec 2023, 09:22 )
RE:
Hello
I've attached the same chart (GBPJPY 100 range pips) from last week of 2 different machines. Please examine the low price and see that the low value is different, on one machine the value is 136.412 and on the second it's 136.409. These kind of differences happens many times.
@eynt
eynt
16 Jun 2020, 10:03
RE:
According to what you wrote, upon reconnecting the Bars value (which is one of the most important and basic property there is )is changed. This causes 2 problems:
a. Reloading takes time (and in some cases, a lot of time)
b. All other objects which relies on the original Bars value are now irrelevant and needs to recalculate itself. This can be super complicated (and time consuming).
Isn't this issue should be solve on your end and on the even of reconnecting the Bars value should fix itself as if nothing has happened?
Thanks
@eynt
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, 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
23 Nov 2020, 12:00
RE:
I understand there was a maintanace issue, it's not the first time that it happens, but why was able to connect only after the market was opened?
@eynt