Multi-Timeframe Indicator in Realtime Scanner

Questions about MultiCharts .NET and user contributed studies.
FB2013
Posts: 20
Joined: 12 Mar 2013
Has thanked: 3 times
Been thanked: 5 times

Multi-Timeframe Indicator in Realtime Scanner

Postby FB2013 » 03 Jan 2014

I have successfully implemented an indicator using the Dataloader to load minute based data.
However, it seems to be impossible to use that indicator within the Realtime scanner.
I get a message "Range.From must be specified and must be less then 31.12.2078"
Right now I use the following call to determine the dataset range:

Code: Select all

m_Req = Bars.Request;
DateTime ToTime = m_Req.To;
ToTime.AddHours(23-ToTime.Hour);
Output.WriteLine(m_dictDict.ContainsKey(m_Req.Symbol).ToString());
if( m_dictDict.ContainsKey(m_Req.Symbol) == false )
{
m_Req = Bars.Request;
if(Bars.Request.From == null )
m_Req.Range = DataRequest.CreateBarsBack(ToTime,1000);
else
m_Req.Range = DataRequest.CreateFromTo(Bars.Request.From,ToTime);
Is it possible to have an indicator based on a dataloader added to the realtime scanner and if so how would it be done correctly ?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Multi-Timeframe Indicator in Realtime Scanner

Postby Henry MultiСharts » 06 Jan 2014

Hello FB2013,

Please send me (support@multicharts.com) the following information for analysis:
- what exact version and build number of MultiCharts are you running? (in MultiCharts go to Help tab-> About);
- attach the workspace you are using;
- in QuoteManager select the symbol you are using, make a right click on it->Export data->Export instrument (without data). Send me the QMD export file;
- in PowerLanguage NET editor->File->Export->export the study you are having problem with. Send me the study export file.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Multi-Timeframe Indicator in Realtime Scanner

Postby Henry MultiСharts » 08 Jan 2014

We have checked your inquiry. We can see that the data request is incorrect:

Code: Select all

m_Req = Bars.Request;
if (Bars.Request.From == null)
m_Req.Range = DataRequest.CreateBarsBack(ToTime, 1000);
else
m_Req.Range = DataRequest.CreateFromTo(Bars.Request.From, ToTime);
Bars.Request.From is never == null. This condition must be changed, for example like that:

Code: Select all

if (Bars.Request.From.Year < 2000)
....
else
.....


Return to “MultiCharts .NET”