PureBytes Links
Trading Reference Links
|
Hi Bob
Your note is very interesting.
I tried putting a simple mov. average system as you suggested.
What is the proper syntax for using the code and the false buy signal.
The way I currently do this ..
I have my family of mutual funds in Data1 to Data14.
I cycle through each one using the data icon to see the ones with the highest
momentum for 5 and 20 days.
I then stick with the top 2 .
Thanks
Frank
Input: Price(close),Length1(9),Length2(18);
Variables:Index(0);
for Index = 1 to 34 begin
if Close of data(Index) > Close[1] of data(Index) then
IF CurrentBar > 1 and Average(Price,Length1) crosses over
Average(Price,Length2) Then Buy on Close;
IF CurrentBar > 1 and Average(Price,Length1) crosses below
Average(Price,Length2) Then Exitlong {Sell} on Close;
end;
=================================================
{
Date: Thu, 3 Sep 1998 20:04:40 -0400
From: Bob Fulks <bfulks@xxxxxxxxxxxx>
Subject: Re: Mutual Fund Rotation
>How would one go about using Tradestation to develop a strategy to rotate
>between a hand full of mutual funds [and cash when appropriate]. For
>instance, using the "Pankin" method, one would rotate into the top ranked
>Fidelity Select Fund and would stay in the fund so long as the fund was in
>the top 8 of the Fidelity Selects (based on a 5 week return).
>Can Tradestation compare the performance of a fund to the performance of a
>number of other funds and then provide a ranking . . . and can one develop
>a system to back test the performance.
Below is a message I previously posted to the Omega list on this subject
(on 1/12/98) I used this method to implement the Pankin method and was able
to duplicate his results fairly closely.
The Pankin method is described on his web site at
http://www.retrosheet.org/mdp/select/
Bob Fulks
------------
I built a "system" that switched between 34 securities in TradeStation by
inserting all 34 prices as 34 data series. You then use, for example, a
loop to cycle through the data series.
for Index = 1 to 34 begin
if Close of data(Index) > Close[1] of data(Index) then ...
...
end;
You probably need to make the securities "Hidden" so they don't clutter up
the screen. With this many securities, I couldn't save the workspace as it
said it was too big to save.
Most built-in functions, such as Average, do not work properly since they
are built to sequence through successive bars of a single price. You have
to include the code for the functions you need in-line and use arrays to
save intermediate values for each security. For example, I needed a
function that used the past six values of a variable, so I needed to store
the variable in an array, such as "SValue[34,6]", and sequence through the
values with two loops, one for the 34 securities and one for the past 6
values.
You cannot use the internal buy and sell commands since they only work on
data1 so you need to program your own accounting and print everything using
print statements. You need to include a false buy signal to make the system
verify. I used
"if FALSE then Buy;"
You can, however, use the optimization functions to cycle through a range
of values if you send the results to the print log for manual inspection or
exporting to Excel.
In summary, it is very tricky and not without problems but it can be done
and allows you to use the price data collected in TradeStation.
Bob Fulks
|