[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

Bob,

>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:

Well, that was the point, actually.  I am constantly finding ways to
work around the deficiencies of TS.  I shouldn't have to.

>>== 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

You can do that?  I honestly didn't know that.  I learn something new
every day.  Is this a TS7 feature only, or also TS2000i?

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

Hm... I don't see that anywhere in TS2000i.

>>== 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.

Yes, I do this already.  That's the point.  I shouldn't have to.  It's a
kludge.

>>== Plotting indicators from strategies
>
>If you use your own Buy/Sell functions they will work in indicators.

Again, a kludge.  Not an example of good software design.

>>== Double precision data types and double precision math
>
>I think TradeStation 7 has higher precision math.

Good to know.  Unfortunately it's software I have to rent.  I'd rather
own something outright.

>>== Complex number data types, and complex math operators (not using
>>   user function calls)
>
>So what is wrong with function calls?

Have you tried anything with significant complex math content?
You'd figure out real quick that relying on function calls instead
of math operators are an easy way to introduce bugs and make
mistakes.  It also makes the code extremely unclear.  Something like

y = a/b + log(c*(d-e)) / sqrt(cos(g)^2 + sin(f)^2)

...is a bloody mess when a,b,c,d,e,f,g are all complex, and you
have to use function calls for division, addition, multiplication,
and subtraction, as well as having special transcendental functions
for complex numbers.  Not to mention what happens when some of the
numbers are NOT complex but real instead.

I remember once (and this has nothing to do with trading) developing
a synthetic aperture radar imaging system from raw complex data.
Having a language with builtin complex math (HP Rocky Mountain
BASIC, actually) made the job much easier, and made maintenance of
the code easier for others after I left the company (they kept using
it for 10 years afterward).

>>== 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.

When it works.  Again, this is a kludge.  I can pass anything I
want, yes, but I have to pass a lot of parameters sometimes just to
describe one data structure.  For example, try passing an array of
trendlines, each having a start date, start time, start price, end
date, end time, end price, and ID.  It's a mess.  As I said, limiting
one to using arrays is a deficiency, not an asset, to EL.

>>== Structured programming, including organizing my code into logical
>>   directories
>
>I have a naming convention that effectively keeps the stuff organized.

So do I.  Again, it's a kludge.

>>== 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.

I said "No decent way to break out of the MIDDLE of a loop."  The
workaround you suggest will work only when the loop attempts to
repeat.  Again, solving this involves a kludge.  A simple "break" or
"leave" statement like other languages have to abort a loop from any
point, would be a great help in complex code.

>>== No way to operate on characters within strings
>
>My copy of TradeStation has 11 text string manipulation
>functions. Have you seen them?

My copy of TradeStation doesn't.

>>== Reliable pass-by-reference operations in function parameters
>
>I have never seen this problem in TradeStation 7 so perhaps it has been fixed.

Good to know.

Make no mistake, I think TradeStation is great.  Sometimes I just
wish I had one of the developers next to me, so I can grab him by
the neck and shake him, shouting "what were you THINKING?  Fix
this!"  Actually I have that feeling about Microsoft too.

It's enough to make a guy want all products to be open source...

-Alex