I have an indicator which uses the following code to request data:
idr.Resolution = new Resolution(EResolution.Month, 1);
dlr = dl.BeginLoadData(idr, result =>
{
this.monthlyPa.AddBars(result.Data);
dl.EndLoadData(result);
}, null);
while (!dlr.IsCompleted)
Thread.Sleep(100);
This code was working flawlessly under 8.0, but now when it gets to the while loop it just gets stuck. because the dlr.IsComplete is always false.
The interesting part is that if I put a break point inside the call back method and manually run it again it downloads the data and runs normally.
Has anyone else encountered this?
IDataLoader question
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: IDataLoader question
Hello Holya,
You need to call IDataLoader.EndLoadData(IDataLoaderResult Result) only after all data has been obtained and all actions with the data have been finished because after calling IDataLoader.EndLoadData(IDataLoaderResult Result) the Result contents are cleaned (all flags are reset to False, all data is deleted).
You need to call IDataLoader.EndLoadData(IDataLoaderResult Result) only after all data has been obtained and all actions with the data have been finished because after calling IDataLoader.EndLoadData(IDataLoaderResult Result) the Result contents are cleaned (all flags are reset to False, all data is deleted).
-
- Posts: 40
- Joined: 28 Aug 2012
- Location: Vancouver, Canada
- Has thanked: 8 times
- Been thanked: 1 time
Re: IDataLoader question
In the code above where it says:
this.monthlyPa.AddBars(result.Data);
It copies the data to the monthlyPa object. There are 7 or 8 charts which download multiple timeframes.
this.monthlyPa.AddBars(result.Data);
It copies the data to the monthlyPa object. There are 7 or 8 charts which download multiple timeframes.