How to do this ?
"Access data of any symbol from scripts
Your indicators and strategies can access data for symbols that are not even charted, giving you maximum flexibility when making trading decisions.
"
ciao
radekj
How to access data of any symbol from scripts [SOLVED]
Re: How to access data of any symbol from scripts [SOLVED]
Find in MC .NET Help -> "DataLoader"How to do this ?
"Access data of any symbol from scripts
Your indicators and strategies can access data for symbols that are not even charted, giving you maximum flexibility when making trading decisions.
"
ciao
radekj
Re: How to access data of any symbol from scripts
Can someone please provide a small example of the code in c# or vb regarding the DataLoader and the returned DataObject. In particular I'm not able to find any reference/help on the Callback function and on the Status of the BeginLoadData.
Thanks.
Thanks.
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: How to access data of any symbol from scripts
Here is a sample to show how DataLoader works:
Code: Select all
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
namespace PowerLanguage.Strategy
{
public class Test_DataLoader : SignalObject
{
public Test_DataLoader(object _ctx):base(_ctx){}
private IOrderMarket buy_order;
protected override void Create()
{
}
protected override void StartCalc()
{
Output.Clear();
}
bool isLosded = false;
protected override void CalcBar()
{
if (Bars.CurrentBar > 1)
{
isLosded = false;
InstrumentDataRequest ir1 = Bars.Request;
ir1.Resolution.Size = 1;
ir1.Resolution.Type = EResolution.Tick;
ir1.From = Bars.Time[1];
ir1.To = Bars.TimeValue;
IDataLoaderResult iRes = DataLoader.BeginLoadData(ir1, DataCB, null);
while (!isLosded)
{
System.Threading.Thread.Sleep(100);
}
}
}
protected void DataCB(IDataLoaderResult Result)
{
if (Result.IsCompleted)
{
DataLoader.EndLoadData(Result);
Output.WriteLine("From {0} To {1} Count Bars is {2}",Result.Request.From,
Result.Request.To, Result.Data.Length);
isLosded = true;
}
}
}
}
- Attachments
-
- Test_DataLoader.pln
- (1.97 KiB) Downloaded 822 times
-
- Posts: 11
- Joined: 05 Feb 2011
- Been thanked: 1 time
Re: How to access data of any symbol from scripts
I have not yet installed .NET version..
Question: With the DataLoader features is there still a need for ADE / ELC functionality or can all calculations from higher resolution data (e.g. 40,000 share, 80,000 share, and 120,000 share when working with 10,000 share bars) be calcualted and maintained within the same study?
Thanks
Question: With the DataLoader features is there still a need for ADE / ELC functionality or can all calculations from higher resolution data (e.g. 40,000 share, 80,000 share, and 120,000 share when working with 10,000 share bars) be calcualted and maintained within the same study?
Thanks