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.
Multiple Symbols in the same Strategy
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?
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?
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact:
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact:
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?
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?
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
-
- Posts: 24
- Joined: 21 Feb 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!
Thanks!
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
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
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