TSI: TradeSignal implementation

Bellow you find the implementation of TSI for TradeSignal . The syntax is very similar to TradeStation.

Please be aware that TradeSignal’s ATR calculation is based on a simple moving average (read here for more information)

.

equilla – code

Meta:
  SubChart(True);
VAR:
  Ratio, TSI;

Ratio = abs((close - close[10])) / AvgTrueRange( 10 ) ;
TSI   =  Average(Average(Ratio,10),100);

DrawLine( TSI, "TSI" );

Comments

  1. Russ Abbott says:

    Would you say something about why you take two averages of Ratio. It looks like you are computing the 100 day moving average of the 10 day moving average. Is that really very different from a straight 100 day moving average?

  2. Hi Russ,

    the idea of using an average of an average is simply to get a smoothed indicator line without loosing to much of directional change (compared to a 200MA).

    The principle is still working, even with a single longer MA.

    Frank

  3. Russ Abbott says:

    I’m afraid I still don’t see it. To take a simple example, consider Average(Average(X, 2),5), where X is some time series. I chose 2 and 5 so that I could show the details of the example. This is

    (Average(X, 2)(-4) + Average(X, 2)(-3) + Average(X, 2)(-2) + Average(X, 2)(-1) + Average(X, 2)(0) ) / 5 where Average(X, 2)(-N) is the 2 period average of X N periods ago. But Average(X, 2)(-N) is (X(-N) + X(-(N+1))/2. Substituting:

    ((X(-4)+X(-5))/2 + (X(-3)+X(-4))/2 + (X(-2)+X(-3))/2 + (X(-1)+X(-2))/2 + (X(0)+X(-1))/2 ) / 5
    = (X(-5) +X(0)+ 2*(X(-4) + X(-3) + X(-2)+X(-1) ) / (5*2)
    = (X(-5) + X(0))/2 + X(-4) + X(-3) + X(-2)+X(-1))/5

    But that is very much like Average(X, 5). It’s not exactly the same since it includes X(-5) and uses only 1/2 X0). But it”s so close that it would seem not to make too much of a difference. Am I doing something wrong here?

    • Hi Russ,

      thanks for challenging me :-) . I did some tests with a version of a single MA100 and a second version of MA100(MA10). The results are very similar, though i got slightly slightly better results. Overall i agree, there isn’t much of a difference. I will send you an email with a picture showing the two different versions, of course the single MA100 version has a slightly more noisy line.

      All the best,
      Frank

  4. hptrade says:

    This is a great indicator, could you post the code for Tradestation.
    Thanks

  5. hptrade says:

    Hi,

    The indicator is very helpful. This is the code I am using for Tradestation.
    var: TSIratio(0),TSI(0);

    TSIratio=AbsValue(close-close[10])/avgTrueRange(10);

    TSI=average(average(TSIratio,10),100);

    Plot1(TSI, “TSI”);
    Plot2(0,”0″);

    Thanks

  6. B. Bhanushali says:

    Is it possible to have code for eSignals Advanced GET. It looks very promising indicator to filter out the noise.
    Thanks
    BB

Trackbacks

  1. [...] dax ← TSI: Amibroker AFL – Code TSI: TradeSignal implementation → [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 226 other followers