Home
Software
Prices
Download
Yahoo Charts


NEW:
ADVANCED
TRADESTATION TECHNIQUE

US Markets Daily
snapshots

Technical
Description


Forthcoming Releases:

Fuzzy Logic:
sFLC3
DLL & API


Neural Net:
Release of NXL3
DLL & API


 

Entropy

Entropy is a well-known measure of disorder or unavailability of energy in a (closed) system.  More entropy generally means less predictability, hence one often tries to minimize it.   Instead of plagiarizing or copying information to this page, I recommend the reader to take a look at the excellent math site (www.mathworld.com), and particularly to the definition of Entropy.  Entropy has a different meaning in maths and physics, and many different measures have been devised in the literature.

The Maximum Entropy Method is one way to enhance the signal-to-noise ratio in data.  There is ample information and even software available (cf. MESA).  We would recommend the NtropiX site from John Conover, from which we have designed a simple Entropy indicator for NeuroShell Trader.  John Conover's site also includes a Excel spreadsheet calculating entropy.  We have implemented our own flavour for TradeStation in our toolset (http://ts-trading-technique.blogspot.com)

 

Here is a sample chart showing our earlier Entropy indicator for NeuroShell Trader:

Entropy Sample Chart

 

The source C code for this indicator is quite simple and is here provided for NeuroShell Trader, which can be compiled with any (free) C compiler:

#include "math.h"
#include "stdlib.h"

__declspec(dllexport) void Entropy (double *price, double *entropy, long int size, long int numbars)
{
double *in, *out, P, G;
long int i,j;
double sumx = 0.0;
double sumx2 = 0.0;
double avgx = 0.0;
double rmsx = 0.0;

in=price;
out=entropy;

for (i=0; i<size; i++)
{
if (i < numbars+1) *out = 3.4e38;
else
{
sumx = sumx2 = avgx = rmsx = 0.0;
for (j=0;j<numbars+1;j++)
{
sumx += log(*(in-j) / *(in-j-1)) ;
sumx2 += log(*(in-j) / *(in-j-1)) * log(*(in-j) / *(in-j-1));
}
if (numbars==0)
{
avgx = *in;
rmsx = 0.0;
}
else
{
avgx = sumx / numbars;
rmsx = sqrt(sumx2/numbars);
}

P = ((avgx/rmsx)+1)/2.0;
G = P * log(1+rmsx) + (1-P) * log(1-rmsx);
*out=G;
}
in++; out++;
}
}

It can easily be called from within NeuroShell Trader (4 parameters: input, output, size, numbars).
 

Best viewed with MS Internet Explorer 5 and above

Page last modified: May 08, 2008
Copyright © ForeTrade Technologies 21st century and thereafter