Buy and Sell on data2 ??  [SOLVED]

Questions about MultiCharts and user contributed studies.
skan

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: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Buy and Sell on data2 ??  [SOLVED]

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

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: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 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

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: 489 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)


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

Re: Buy and Sell on data2 ??

Postby Dave Masalov » 07 Dec 2010

You are welcome.


Return to “MultiCharts”