Using Data2 and scaling to Data2

Questions about MultiCharts and user contributed studies.
JamesMH
Posts: 1
Joined: 01 Oct 2008

Using Data2 and scaling to Data2

Postby JamesMH » 01 Oct 2008

I am trying to create a strategy that uses a second data however the problem that I am running into is that the strategy scales the data2 to data one and not data two. In other words if I have 4 bars for data2 and one bar in data one per spacing then the strategy seems to scale all of the data2s 4 bars into one to match the one bar in data one. What I would like to see would be to just look at the last of the 4 bars in data one.

Simply: Data2 plots 4 bars per data1, when I try to access data2 in a strategy it combines all 4 bars of data2 instead of looking at the last bar of data2.

So how do I create my strategy to look at the last bar of data2 that has been completed (I would imagine that when the bar closes on data1 that the data2 bar might still be mid bar)

I hope that you can understand my question, it is hard to explain.

Thankyou

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 08 Oct 2008

Hi JamesMH,

I am not sure I quite understand your explanation.

Below, you will find the description of how the calculations work on two dataseries. I hope it helps.

Even if your strategy references data 2, the calculations are tied to the bars of data 1. So if you have two dataseries: data1 with 5-minute bars and data2 with 2-minute bars, the strategy will be calculated on close of the 5 minute bar and reference the value of the nearest in time 2 minute bar.

If the above explanation does not help to make things more clear, please post (or send me to mpashkova@tssupport.com) your strategy together with the print output and your comments.

Regards.

drwar
Posts: 218
Joined: 31 Jul 2005

Re: Using Data2 and scaling to Data2

Postby drwar » 08 Oct 2008

[quote]So how do I create my strategy to look at the last bar of data2 that has been completed (I would imagine that when the bar closes on data1 that the data2 bar might still be mid bar)

Thankyou[/quote]

The good news is that you can use Barstatus(2)=2 to detect the close of Data2
the close of Data1 would similarly be Barstatus(1)=2.

However, there is currently a bug in there barstatus command and until they fix it you cannot detect the status of any other data stream then the one your strategy/indicator is applied to.

J~


Return to “MultiCharts”