Buy and Sell on data2 ??

Questions about MultiCharts and user contributed studies.
skan
Posts: 36
Joined: 15 Jul 2010

Buy and Sell on data2 ??

Postby skan » 06 Dec 2010

Hello

If I want to calculate something on Data2 chart I just need to add Data2 at the end of my instruction.

For example
myvar=(close data1)/(close data2)

What I don't know is how to send an order to the underlying of data2, all my orders get executed on data1.

What do I have to do?
For example I have on miniRusell data1 and S&P500 on data2 on the same chart. I make some calculations with both and I'd like to buy 1 contract of S&P500.

cheers

sptrader
Posts: 631
Joined: 09 Apr 2010
Location: Colorado
Has thanked: 394 times
Been thanked: 235 times
Contact:

Re: Buy and Sell on data2 ??

Postby sptrader » 06 Dec 2010

Orders can ONLY be applied to data1, so you'd have to reverse data1 and data2, so the order is applied to data1.

skan
Posts: 36
Joined: 15 Jul 2010

Re: Buy and Sell on data2 ??

Postby skan » 06 Dec 2010

What I really need is to execute orders on data1 and data2 at once, in order to do some kind of pair trading.

sptrader
Posts: 631
Joined: 09 Apr 2010
Location: Colorado
Has thanked: 394 times
Been thanked: 235 times
Contact:

Re: Buy and Sell on data2 ??

Postby sptrader » 06 Dec 2010

Maybe you could set up 2 charts and use a global variable for them to communicate and generate the signals..
In any event, all signals must be applied only to data1.

skan
Posts: 36
Joined: 15 Jul 2010

Re: Buy and Sell on data2 ??

Postby skan » 07 Dec 2010

Hello
Thanks.
The problem with global variables is that you need to use external dll and not standard easylanguage, and is not as portable.

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Buy and Sell on data2 ??

Postby Dave Masalov » 07 Dec 2010

Dear skan,

This cannot be done from one chart. You can try to write a symmetrical strategy - the same calculations with reversed data series.

miniRusell data1 and S&P500 on data2 - original data series (buy miniRussel)
S&P500 data1 and miniRusell on data2 - the same calculations(sell S&P)

skan
Posts: 36
Joined: 15 Jul 2010

Re: Buy and Sell on data2 ??

Postby skan » 07 Dec 2010

OK thanks

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Buy and Sell on data2 ??

Postby Dave Masalov » 07 Dec 2010

You are welcome.


Return to “MultiCharts”