Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 11-19-2009, 09:30 AM   #1

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Multi Data Stream Analysis (EasyLanguage)

This thread is about using the EasyLanguage keyword DATA in multi data stream analysis



Data


Used to specify a particular data series in a multi-symbol chart;
each data series in a multi-symbol chart has a unique Data Number.


Usage

DataN

Where: N - the Data Number of the data series

Or (for MultiCharts):

Data( N )

Where: N - a numerical expression specifying the Data Number of the data series


Example

High Of Data2
will return the high price of a bar in the data series with the Data Stream #2


High Of Data( 2 )
will return the high price of a bar in the data series with the Data Stream #2



source: EasyLanguage manual
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
The Following 2 Users Say Thank You to Tams For This Useful Post:
aaa (11-21-2009), TIKITRADER (12-21-2009)
Old 11-21-2009, 05:41 AM   #2
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

TAMS

I don't understand

Is it a way 2 access to a second symbol in a chart ?

Or an other resolution of the same symbol in a chart ?

if it's a 2 stupid question, please don't answer

aaa

------------------------------------------

Data (Reserved Word)
Disclaimer

Reserved word used to reference information from a specified data stream.

Remarks
Data is normally used with a number between 1-50 that allows the specification or which data set is being referred to in terms of price values and functions calculations.

Examples
Close of Data3 returns the Close price of Data stream 3.

Low of Data10 returns the Low price of Data stream 10.
aaa is offline  
Reply With Quote
Old 11-21-2009, 09:26 AM   #3

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

you can use this keyword to access additional data stream.

the additional data stream can be of a different symbol and/or resolution.


for MultiCharts users, the resolution can also be mixed:
i.e. time based chart with non-time based chart

e.g.
5 min data1 with 15 min data2
5 min data1 with 2401 contract volume bar data2
5 min data1 with 500 tick data2
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
The Following 3 Users Say Thank You to Tams For This Useful Post:
aaa (11-28-2009), DugDug (12-05-2009), TIKITRADER (12-21-2009)
Old 11-21-2009, 11:08 AM   #4

Join Date: May 2009
Location: Dallas
Posts: 93
Ignore this user

Thanks: 52
Thanked 136 Times in 56 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

The most important thing to remember with the DATA keyword, which constantly trips people up, is that you are accessing the other data only when events happen in the primary data stream. (the primary one is the one you apply the indicator to when you add it to your chart, not necessarily DATA1)

So, if you apply the indicator to a 5-min chart, update-intrabar turned off... then even if Data2 is a 1-tick chart, you will still only run once every 5 minutes, and Close Data2 will be the most recent close for the 1-tick chart, even if you've missed hundreds of 1-tick bars in between.

For this same reason, certain optimizations like AverageFC (which assumes it will "see" every bar it needs to, and only once), and any algorithm that needs to "see" every tick will generally not work across data streams and are best avoided.

Things are a bit more intuitive when you have update intrabar on, but it still pays to keep this in mind. Most errors I come across in multi-data indicators stem from this issue.
RichardTodd is offline  
Reply With Quote
The Following 5 Users Say Thank You to RichardTodd For This Useful Post:
aaa (11-28-2009), Charlton (11-21-2009), DugDug (12-05-2009), Tams (11-21-2009), TIKITRADER (12-21-2009)
Old 11-23-2009, 06:23 AM   #5

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

Richard makes good points. In MC you can minimise the impact of this by having a 1 tick chart of the fastest instrument as data1 to 'clock' your indicator. Be aware that it's at time like this that having fairly well optimised code is important (yes I know I keep banging on about that )

You can hide the 1 tick bars if you don't need them. The problem with this approach is irregular scaling, the charts X scale is done in regards to data1.
BlowFish is offline  
Reply With Quote
The Following 3 Users Say Thank You to BlowFish For This Useful Post:
aaa (11-28-2009), Tams (11-23-2009), TIKITRADER (12-21-2009)
Old 11-28-2009, 06:25 AM   #6
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

ThanX to TAMS + Richard Todd + Blowfish 4 your Xcellent info

2 illustrate what have been said, here are graphs showing the problem of bar interval

it is not smooth + we have 2 wait the end of the bar 2 draw the avg

Is it the same problem that ADE which send the info only at the end of the bar ?

On chart 3 An other solution is to plot a 240 ( 60/5) * 20) avg directly on the 5 mn chart but it is not accurate





Attached Thumbnails
Multi Data Stream Analysis (EasyLanguage)-01.jpg   Multi Data Stream Analysis (EasyLanguage)-02.jpg   Multi Data Stream Analysis (EasyLanguage)-03.jpg  

Last edited by aaa; 11-28-2009 at 06:34 AM.
aaa is offline  
Reply With Quote
Old 11-28-2009, 09:59 AM   #7

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

this chart illustrates the data1 and data2 application differences.

the resultant calculations are the same,
but the visual presentation is different.


Here's the code for data2 application.

note that you should not use FC functions when calculating secondary data.

Code:
inputs:  
Price( Close data2 ), 
Length( 9 );

variables:  
MA( 0 ) ;
	
MA = Average( Price, Length ) ;

Plot1( MA, "Avg" ) ;


Attached Thumbnails
Multi Data Stream Analysis (EasyLanguage)-data2.png  
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
The Following 2 Users Say Thank You to Tams For This Useful Post:
aaa (11-28-2009), TIKITRADER (12-21-2009)
Old 12-05-2009, 06:19 AM   #8
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Multi Data Stream Analysis (EasyLanguage)

Is there a way 2 eliminate steps scale ?

1 way is 2 plot directly the avg from data2 to data 1

That's what I've done here (always with step)

http://www.traderslaboratory.com/for...html#post82170

I've read that there is a way 2 compute an avg from a hiher time w/o data2 with a limitation = it must B a multiple

May B on a 1 mn chart take the close of all the 5th mn and then compute the avg of the last 20 * 5 mn close ?

And then add each mn close from 1 to 4 th mn to the close of the last 5 mn ?

PS Sorry I'm not good with maths

I'm quite sure that TAMS will ask a mock up
aaa is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADE - All Data Everywhere (EasyLanguage) Tams Trading Indicators 22 05-01-2010 01:48 AM
Multi Time Frame Indicator dhelmin Coding Forum 11 08-25-2009 07:14 PM
TradeStation Chart Analysis Refresh for 3rd Party Data sneo Coding Forum 0 10-22-2008 12:35 AM
September 26, 2008 Market Analysis - Some ES Data Also Soultrader Market Analysis 0 09-25-2008 10:37 PM
Multi Monitor Software AbeSmith General Discussion 2 07-10-2007 03:01 PM

All times are GMT -4. The time now is 02:12 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.