Hi,
I am trying to get the ticks value from bars loaded with the dataloader but can't figure out how.
In the calculate bar function for the current bar the property "TicksValue" is available.
When I load in data with the dataloader, the only property I see is TickId but this holds the value 0.
Simply said, how can I get the ticksvalue property on data loaded with the dataloader?
Cheers,
Gerard
dataloader ticksvalue
-
- Posts: 30
- Joined: 24 Oct 2013
- Has thanked: 9 times
- Been thanked: 3 times
-
- Posts: 36
- Joined: 04 Feb 2010
- Location: Calgary, AB Canada
- Has thanked: 7 times
- Been thanked: 19 times
- Contact:
Re: dataloader ticksvalue
Hi Gerard,
The data loader triggers an event callback that you provide for each new real time tick received, as shown in the simplified example below. Each time an event is triggered, the Event code can be used to determine how to interpret the associated data value. Each new real time tick will either start a new bar (DataLoadedEvent.RTNewBar) or update the current "working" bar (DataLoadedEvent.RTUpdateLastBar) . As the current working bar is updated you can check the TickId value in Result.RTData.Value.TickID and you should see this increment as expected.
Hope this helps,
Jeff
The data loader triggers an event callback that you provide for each new real time tick received, as shown in the simplified example below. Each time an event is triggered, the Event code can be used to determine how to interpret the associated data value. Each new real time tick will either start a new bar (DataLoadedEvent.RTNewBar) or update the current "working" bar (DataLoadedEvent.RTUpdateLastBar) . As the current working bar is updated you can check the TickId value in Result.RTData.Value.TickID and you should see this increment as expected.
Hope this helps,
Jeff
Code: Select all
List<bar> barData = new List<Bar>();
public void OnData(IDataLoaderResult Result)
{
switch (Result.Event)
{
case DataLoadedEvent.History:
barData.AddRange(Result.Data);
break;
case DataLoadedEvent.RTUpdateLastBar: // this tick is updating the last bar
int n = barData.Count;
if (n > 1)
barData[n - 1] = Result.RTData.Value;
break;
case DataLoadedEvent.RTNewBar: // this tick starts a new bar
barData.Add(Result.RTData.Value);
if (barData.Count > MaxBars)
barData.RemoveAt(0);
break;
}
}
-
- Posts: 30
- Joined: 24 Oct 2013
- Has thanked: 9 times
- Been thanked: 3 times
Re: dataloader ticksvalue
Hi,
Thanks for your answer.
I am loading historic data, I am doing this the same way as in your example.
But the loading bars in barData don't have the property TickValue like in the bars you get in the calculatebar function.
I need a way to access the TickValue of the historic bars, the TickId property seems not being that and result in 0.
Cheers,
Gerard
Thanks for your answer.
I am loading historic data, I am doing this the same way as in your example.
But the loading bars in barData don't have the property TickValue like in the bars you get in the calculatebar function.
I need a way to access the TickValue of the historic bars, the TickId property seems not being that and result in 0.
Cheers,
Gerard
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: dataloader ticksvalue
Hello Gerard,
TicksValue is similar to PowerLanguage "Ticks". It works the following way:
In order to achieve your goal you can utilize the TotalVolume value.
TicksValue is similar to PowerLanguage "Ticks". It works the following way:
TickID are realtime only ticks stamped with a unique number. This is not what you need.Returns the total number of ticks for the current bar if Build Volume On is set to Tick Count.
Returns the total volume for the current bar if Build Volume On is set to Trade Volume.
With Build Volume On is set to Tick Count:
- the value of 1 will be returned for 1-tick charts
- the total number of ticks in the current bar will be returned for multi-tick, volume, and time-based charts
With Build Volume On is set to Trade Volume:
- the volume of the current tick will be returned for 1-tick charts
- the total volume of the current bar will be returned for multi-tick, volume, and time-based charts
In order to achieve your goal you can utilize the TotalVolume value.