[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EasyLanguage: trading 2 datastreams in 1 strategy



PureBytes Links

Trading Reference Links

Hi Tony,

Yes it is possible.  However, depending on how complicated your strategy is it
can be a real mind bender to code.  You are correct - by default TS looks at
data1, unless you tell it to look at data2 - - ie a = close;  b = close of
data2;.  Now value 'a' is the close of the bar of data1 and value 'b' is the
close of bar of data2.

xyz is the symbol of the data1 stream and zyx is the symbol of the data2 stream

If b > close then;
buy zyx;
sell xyz;

Which is to say - if the close of data2(zyx) is greater than the close of
data1(xyz) then buy zyx and sell xyz.

Even if you are using some interaction between the two data streams you may find
it a whole lot easier to just use two separate charts. And just pass the
information that is needed between the two charts.  Dynastore sells a program
that allows TS to use "Global Variables" - ie one can create a variable in one
chart then 'write' this value to a global variable and 'read' this value in a
different chart.  You can even use this 'Global Variables' approach to get
around some of problems if you have a need to mix data with different time
frames.  TS will not allow you to mix different time frames in the same chart -
however, using the 'Global Variables' one can do pretty much the same thing just
not in the same chart - with data from a minute chart being feed to a one tick
chart or the other way round.  You can even use this approach to allow you to
use an 'indicator' in TS to generate buy / sell signals that are passed to a
'strategy' that does nothing but look for the buy /sell GV's and then generate
the buy / sell orders.

Back testing, is a whole different matter.  I have not found any way to
effectively do this, however with a real time demo account (available from most
forex dealers) you can test your strategy in real time.

Larry

Tony Ross wrote:

> Greetings, and thanks for allowing me to join this discussion list.
>
> I have 2 datastreams in a chart. Is it possible from within a signal to
> generate buy and sell orders for both data1 and data2?
>
> Each trade is to generate some combination of buy/sell orders for the 2
> datastreams. This might be buy both, buy one/sell one or sell both,
> depending on the conditions that may exist at any given time. This can be
> viewed as a spread-type trade, I suppose.
>
> As far as I can tell, it appears that the EL buy/sell can be applied only to
> data1 by default, but I'm hoping that somebody has some insight as to how to
> buy/sell both datastreams simultaneously.