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

Re: Recognizing a series function based on how it's called. Possible?


  • To: Bob Fulks <bobfulks@xxxxxxxxxx>
  • Subject: Re: Recognizing a series function based on how it's called. Possible?
  • From: Joel Reymont <joelr1@xxxxxxxxx>
  • Date: Tue, 29 May 2007 15:33:05 +0100

PureBytes Links

Trading Reference Links

Bob,

This is a very complicated topic. Mark Jurik has some papers on his web site relating to this so you might look there:

Thanks for the tip. I re-read the Jurik papers and I think the following heuristic can be used when looking at how the function is called:

1) If the function takes a local variable as argument then it's not a series function.

Actually, this doesn't seem to apply anymore.

2) If the function is referenced historically (value1 = Xaverage (close,9)[8] ;) then it's not a simple function.

Does this still apply?

According to Mark Jurik:

"If there are multiple calls to the same series function, with the same parameter names, then the user probably meant to call the function only once, store it in a variable and use the result as needed."

So if we have

    var: X(0), Y(0), Z(0);

    Value1 = 10; X = XAverage(Close, Value1);
    Value1 = 20; Y = XAverage(Close, Value1);
    Value1 = 30; Z = XAverage(Close, Value1);

then TradeStation will rewrite it as follows:

    var: X(0), Y(0), Z(0);

    Value1 = 10; temp = XAverage(Close, Value1);
    X = temp;
    Y = temp;
    Z = temp;

I'm wondering how many people actually rely on this type of rewriting by TradeStation in their strategies.

The reason that I ask is that it's rather hard to duplicate this heuristic in C# without having access to the trader's library of user functions.

I have been trying to avoid storing any strategy or user function code on my server so far to ease privacy concerns. Starting to store everything just to duplicate an assumption that TS makes seems excessive.

What do you think?

	Thanks, Joel

--
http://topdog.cc      - EasyLanguage to C# translator
http://wagerlabs.com  - Blog