Bug IDataLoaderResult

Questions about MultiCharts .NET and user contributed studies.
chris1206
Posts: 3
Joined: 07 Aug 2013

Bug IDataLoaderResult

Postby chris1206 » 07 Aug 2013

Hello,

I used the code with ES #F (1000 barsback) and got only the value of 128 for countbars....
With FromTo, everything is ok!

Code: Select all

using System;
using System.Drawing;
using System.Linq;
using System.Collections.Generic;
using PowerLanguage.Function;

namespace PowerLanguage.Strategy {
public class CST_DTest : SignalObject {
public CST_DTest(object _ctx):base(_ctx){}

VariableSeries<double> close;
VariableSeries<DateTime> time;
VariableObject<double> test;

protected override void Create()
{
close = new VariableSeries<double>(this);
time = new VariableSeries<DateTime>(this);
test = new VariableObject<double>(this);
}

protected override void StartCalc()
{
Output.Clear();
InstrumentDataRequest Req;
Req = Bars.Request;
Req.Subscribe2RT = true;

IDataLoaderResult iRes = DataLoader.BeginLoadData(Req, ResultCallback, null);

}


protected override void CalcBar()
{
//Output.WriteLine("{0}, {1}",close.Value,test.Value);
}


void ResultCallback(IDataLoaderResult Result) {

if (Result.IsCompleted)
{

int countbars = Result.Data.Length;
Output.WriteLine("{0}", countbars);

switch (Result.Event)
{
case DataLoadedEvent.History:
{
break;
}
case DataLoadedEvent.RTNewBar:
{
close.Value = Result.RTData.Value.Close;
break;
}

}

}
}
}
}


chris1206
Posts: 3
Joined: 07 Aug 2013

Re: Bug IDataLoaderResult

Postby chris1206 » 08 Aug 2013

FromTo is also incorrect, but i found a Solution for this bug...

Code: Select all

InstrumentDataRequest request = Bars.Request;
request.Range = DataRequest.CreateBarsBack(DateTime.Now, Bars.FullSymbolData.Count);
This works fine, also in RealTime. You must declare the Range separately....
Please focus on my third topic! It's impossible for me to bring the IDataLoaderResult Bar[] in a VariableSeries<>.....

Best regards,

Christian

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 76 times

Re: Bug IDataLoaderResult

Postby Alex MultiCharts » 13 Aug 2013

Thank you for reporting this issue. The information was forwarded to the Developers and confirmed. It should be fixed in the future versions.


Return to “MultiCharts .NET”