PureBytes Links
Trading Reference Links
|
Hello List,
I can make it so that you know the total number of bars on the chart from
the first bar. : )
Let me know privately if you are interested.
Best regards,
Benjamin Blanco,
EasyLanguageŽ Specialist
( former TradeStation Technologies, Inc. employee of six years )
http://www.blancofamily.net/ezlang.htm
EasyLanguage is a registered trademarks of TradeStation Technologies, Inc.
----- Original Message -----
From: "Gary Funck" <gary@xxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Wednesday, September 18, 2002 2:35 AM
Subject: RE: On the first bar, how to access the last bar?
A bit off-topic, but ... there've been times using TS4 where I've wanted to
run
studies where either I was interested in projecting the data into the
future,
or looking at the next bar or next few bars, when executing simulated trades
(to see what the behavior would be like in certain worst case scenarios, for
example). Something I thought about doing was have one study write out a
text
(ie, delimited) file that is then loaded in the next study, and to some how
ensure the read-in of the generated data after the study that writes it. I
thought perhaps TS4's chart scanning capability might offer the proper
sequencing, either that or I'd need to know the order that TS4 opens up the
charts.
----- Original Message -----
From: "Kent Rollins" <kentr@xxxxxxxxxxxxxx>
To: "OmegaList" <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 17, 2002 6:42 PM
Subject: Re: On the first bar, how to access the last bar?
Instead of accessing the last bar from the first bar, why don't you access
the first bar from the last bar? Easy Langugage contains a "for" statement
which can be used to loop across past bars.
Kent
----- Original Message -----
From: "Bob Fulks" <bfulks@xxxxxxxxxxxx>
To: "Traktor Topaz" <traktor@xxxxxxxxxxx>; <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 17, 2002 11:30 AM
Subject: Re: On the first bar, how to access the last bar?
There are two approaches to this problem.
You can store all the values you will need for the calculation at the
last bar on the chart in arrays and then do the calculation from the
data in the arrays.
Alternately, you can accumulate the partial results as you go through
the data and then do the final calculation at the end using the
partial results.
As a simple example, assume you wanted the average values of all the
closing prices on all bars.
Vars: Sum(0), Count(0), Ave(0);
Sum = Sum + Close;
Count = Count + 1;
if LastBarOnChart and Count <> 0 then
Ave = Sum / Count;
Bob Fulks
----- Original Message -----
From: "Mike Eggleston" <mikee@xxxxxxxxxxxxxx>
To: "Traktor Topaz" <traktor@xxxxxxxxxxx>
Cc: <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 17, 2002 10:40 AM
Subject: Re: On the first bar, how to access the last bar?
I don't think it is possible to look into the future. However, you can
write an indicator that waits until it is on the last bar (lastbaronchart =
true)
and when it is on the last bar it then does your statistical calculation.
Mike
----- Original Message -----
From: "Traktor Topaz" <traktor@xxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 17, 2002 10:26 AM
Subject: On the first bar, how to access the last bar?
This is probably simple, but it's eluded me so far:
I wish to go through the bars of a given contract, performing some
statistical calculations, looking to see how often something happens. But
before I run through the bars I need to know one simple thing about the
last and next-to-last bars.
As a (simplified) example, let's say that today (the last bar on the
chart) the open is so-much higher/lower than yesterday's open, and now I
want to run through all the bars and count up how often that is the case.
So I'd like code like this:
If currentbar > 1 then begin
OpenPosition = Open[lastdayonchart] - Open[nexttolastdayonchart];
if open[today] blah-blah open[yesterday] then add-some-stuff-up.
if lastbaronchart then plot1( results, 'results' );
end;
The part that's eluded me so far is how, on the first (or second) bar of
the chart to find out how many bars exist in this chart so as to access
the last-bar and next-to-last-bar on the chart.
Can someone point me at the answer?
-- Arthur Cronos, Fairfax California
PS: Does anybody else find the TS 'help' system for looking up commands to
be inferior to a printed book which organizes similar commands together?
Does anyone else think that for $95 a month, those folks could send a
printed book?
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
MOBIUS MEGATAR TAPPING BASSES
'Making Music Easier' http://www.megatar.com
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|