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

Re: Opening Sequence of Charts in WorkSpace



PureBytes Links

Trading Reference Links

At 8:15 AM -0600 10/22/99, Larry McBride wrote:

>I had thought there was supposed to be some degree of control over the
>sequence in which charts within a given workspace were opened.  However, in
>trying to clarify this with OR regarding TS2k I received the following
>answer from Customer Support.
>
> >All charts in one workspace will open at one time there is no sequence for
> >it to open in.
>
>Does anyone have a different answer than that?


The best description I have seen is in the HashNums Global Variable
documentation, the portion of which I have quoted below.

Bob Fulks

---------

System Order

If you have multiple systems in a workspace, and are using the DLL in
real time to share data between systems, then the order the systems
run in will be important. Unfortunately, the order systems run in
cannot be controlled or obtained from Easylanguage. However, you can
store a workspace with systems that you know run in a specified
order. The order the systems run in is the order the charts were
opened in. You can change this order after opening the charts by
clicking on each chart in the reverse order you want them to run in.
So the first chart you click on will be the last to run. This method
for specifying order is frought with disaster, but it is all that
Tradestation provides.

Real Time Verses Historical

Passing values between Indicators and Systems (and paintbars and
showme's) may not work as seems. Unfortunately, Tradestation
processes data differently in real time and historically.

When testing systems historically, Tradestation calculates the two
separately not concurrently bar by bar. So if you assumed you could
use the DLL to pass bar data from a system to an indicator you were
wrong. You can however pass final or initial values or calculations
from one to the other. To pass bar by bar data you need to use the
DLL file writing utilities and re-run the system and indicator as
required. So if we have one System (S1) and an Indicators (I1). Then
S1 will be run through all the data, then I1 will be run through the
data.

However, in real time, things are calculated bar by bar. So if you
calculate a value in a system on a bar you can then read that new
value in an indicator. But its not all that simple. The order things
are calculated in also depends on the order they are inserted.
However,  systems are calculated before Indicators. So if we have one
System (S1) and two Indicators (I1, I2) then we get the following:

Insert Order:           S1, I1, I2
Calculated Order:       S1, I1, I2

However:

Insert Order:           I2, I1, S1
Calculated Order:       S1, I2, I1

Looking at all the types of analyses, the calculation order seems to be:

Systems then Indicators then PaintBars then ShowMe's

Within each similar type the order depends on the inserted order.

You can force a particular order by switching the status of
individual analyses from ON to OFF to ON. It is re-calculated in
isolation. Note that if you are doing historical testing and adding
new indicators, each new addition will be calculated when added. Only
when you re-calculate all the analyses, will the above order have an
effect.

See Example 16 on how to test this for yourself.

Example 16

Here is one system and two indicators to test the real time verses
historical order things run in. Try inserting them into a chart in
different orders. Choose a 1 Minute Bar. You may write your own
paintbar and showme along these lines to test them also. You can see
the first one to update the Current Bar stored in the DLL. This
property can be used to cache a calculated value. If all three check
if the current bar is equal to the stored bar value then one only
needs to update the calculation when the current Bar is not equal to
the stored bar number. You may place this into a function and call it
from all of them.

{System - 1}

DefineDllFunc: "c:\omega\prog\hashnums.dll", INT,  "putAt", LPSTR,
LPSTR, FLOAT;
DefineDllFunc: "c:\omega\prog\hashnums.dll", FLOAT,  "getAt", LPSTR, LPSTR;
DefineDllFunc: "c:\omega\prog\hashnums.dll", FLOAT,  "cleanUp";

Variable: CBar(0);

CBar = getAt("Test", "CBar");
print("System-1: ", CurrentBar, CBar);
putAt("Test", "CBar", CurrentBar);

{ Indicator 1 }

DefineDllFunc: "c:\omega\prog\hashnums.dll", INT,  "putAt", LPSTR,
LPSTR, FLOAT;
DefineDllFunc: "c:\omega\prog\hashnums.dll", FLOAT,  "getAt", LPSTR, LPSTR;
DefineDllFunc: "c:\omega\prog\hashnums.dll", FLOAT,  "cleanUp";

Variable: CBar(0);

Plot1(Open,"Open");

CBar = getAt("Test", "CBar");
print("Indic-1: ", CurrentBar, CBar);
putAt("Test", "CBar", CurrentBar);

{ Indicator 2 }

DefineDllFunc: "c:\omega\prog\hashnums.dll", INT,  "putAt", LPSTR,
LPSTR, FLOAT;
DefineDllFunc: "c:\omega\prog\hashnums.dll", FLOAT,  "getAt", LPSTR, LPSTR;
DefineDllFunc: "c:\omega\prog\hashnums.dll", FLOAT,  "cleanUp";

Variable: CBar(0);

Plot1(Open,"Open");

CBar = getAt("Test", "CBar");
print("Indic-2: ", CurrentBar, CBar);
putAt("Test", "CBar", CurrentBar);