Multiple Symbols in the same Strategy

Questions about MultiCharts and user contributed studies.
TraderJ
Posts: 37
Joined: 14 Jul 2009
Location: Germany

Multiple Symbols in the same Strategy

Postby TraderJ » 16 Jul 2009

Is it possible to access more than only one symbol in a strategy?
I would like to use BID and ASK at the same time in my strategy.
For example, I would like to calculate the current BID-ASK spread before placing a BUY or SELL order.

SUPER
Posts: 622
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 times

Postby SUPER » 17 Jul 2009

Have a look at this post on Bid/Ask

http://forum.tssupport.com/viewtopic.ph ... ght=#27045

TraderJ
Posts: 37
Joined: 14 Jul 2009
Location: Germany

Postby TraderJ » 17 Jul 2009

It is correct that BID/ASK based backtesting is the ultimately coolest feature of MC. This single feature is the main reason why I bought a license.

But I want more than backtesting.
I want to use BID and ASK in my strategy.
I fear it is not possible, but I want to be sure.
In general, I am looking for a way to have multiple symbols in multiple timeframes not only on my chart, but in my automated trading strategy.
For now, I would be happy to reference BID and ASK in a single strategy.


For example:

// The symbol Ask.Close denotes the Close of the Ask price series.
// The symbol Bid.Close denotes the Close of the Bid price series.

avgAsk = XAverage(Ask.Close, 14);
avgBid = XAverage(Bid.Close, 14);

if avgAsk - avgBid <= 3 then begin
Buy("Long Entry") next bar market;
end;

Is this possible somehow?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 17 Jul 2009

Yes, you just need to insert ASK and BID series and reference them in your strategy. You don't need to use advanced back testing to archive what you want.

TraderJ
Posts: 37
Joined: 14 Jul 2009
Location: Germany

Postby TraderJ » 18 Jul 2009

That sounds good. But how do I do that?
Can you please provide an example?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 20 Jul 2009

Just reference data1, data2 or Data3. See MultiCharts documentation for more information.

TraderJ
Posts: 37
Joined: 14 Jul 2009
Location: Germany

Postby TraderJ » 20 Jul 2009

As a professional programmer, I always refer to the documentation first.
I did not find anything on this topic, so I posted my question here.
I am afraid, but Data1, Data2 and Data3 tells me nothing.
Searching the help file for "Data1" directs me to the section "Creating Portfolios" which is not what I am looking for.
Can you please tell me where in the documentation I can find what I am looking for or post an easylanguage (powerlanguage) example directly?

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Postby TJ » 20 Jul 2009

look under Data.

TraderJ
Posts: 37
Joined: 14 Jul 2009
Location: Germany

Postby TraderJ » 20 Jul 2009

That's it! Thank you all!

SiliconTiger
Posts: 24
Joined: 21 Feb 2009

Postby SiliconTiger » 20 Jul 2009

Searching the MC help file for "Data" yields tons of results. Which help topic shows how to do this (i.e. further clarifies Andrew’s comments of “Just reference data1, data2 or Data3”)? Alternatively, any code snipets of how to code a strategy to use/access multiple symbols would be just as useful.

Thanks!

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Postby TJ » 20 Jul 2009

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:

Data(N)

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


Examples


High Of Data2

will return the high price of a bar in the data series with the Data Number of 2


High Of Data(2)

will return the high price of a bar in the data series with the Data Number of 2


Return to “MultiCharts”