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

Re: To MarkBrown: Real-time datafeeds in Python



PureBytes Links

Trading Reference Links

At 11:49 AM 5/6/2004, Alex Matulich wrote:

>Good heavens, from my first month or two of using tradestation I
>identified a bunch of stuff I couldn't do:

Come now! You can find work-arounds for most of these:


>== Backtesting of portfolios -- the single biggest weakness of TS

This is easy if you build our own buy/sell functions. Pretty simple. Conceptually:

   Buy  XXX shares of Data(YYY) next bar at market
   Sell XXX shares of Data(YYY) next bar at market

These are easy to use for that purpose. I do it all the time.

You also need to call an "ExecuteOrders" function at the top of the code to actually modify the positions.


>== Optimizing against any result *I* define, not canned results like
>   net profit

Just write the results of the optimization run to a file and work with the file in Excel. You could probably also write the results to a global variable and analyze the data in some other code or Excel.


>== Executing trades on ANY price data stream, not just data1

See no. 1 above


>== Backtesting of spreads determined by rules on the fly, between
>   several data streams (i.e. you can't predefine the "spread data")

You can define a spread variable which is a combination of any data stream. You home-made Buy/Sell orders could work on this variable or place an order on each half of the spread.


>== Plotting indicators from strategies

If you use your own Buy/Sell functions they will work in indicators.


>== Double precision data types and double precision math

I think TradeStation 7 has higher precision math.


>== Complex number data types, and complex math operators (not using
>   user function calls)

So what is wrong with function calls?


>== Data structures (makes passing groups of variables back and forth
>   between functions a lot easier, especially if you have an array of
>   groups of variables)

The call-by-reference feature lets you pass anything you want including arrays.


>== Structured programming, including organizing my code into logical
>   directories

I have a naming convention that effectively keeps the stuff organized.


>== No decent way to break out of the middle of a loop (even a 'goto'
>   statement would be useful for this)

You can break out of a "while" loop, obviously. You can break out of a "for" loop by reassigning the loop variable to a high value within the loop. 


>== No way to operate on characters within strings

My copy of TradeStation has 11 text string manipulation functions. Have you seen them?


>== No backtesting of combinations things displayed in different
>   charting windows (you can do this in real time with PushPop DLL,
>   but backtesting DOES NOT work with PushPop due to TradeStation
>   not calculating each indicator in a synchronized way)

Seems a bit esoteric but I cannot think of a way to do it short of storing the data from the independent window in a global variable and running that first.


>== Reliable pass-by-reference operations in function parameters
>   (you never know when it won't work; i.e. a passed-by-reference
>   parameter that changes within a function doesn't change in the
>   calling procedure -- seems to be more reliable if all NumericRefs
>   are in the beginning of the parameter list)

I have never seen this problem in TradeStation 7 so perhaps it has been fixed.

>... and so on.

Needless to say, some of these work-arounds are a bit awkward but they can be handled without having to write your own application... :-)

Bob Fulks