Speculation on Fractal Programming Language

We flew east out of Panama City, and I looked down on the faceted green hills of the Cordillera de San Blas, perhaps for the last time.  In the sky were statistically similar puffs of white cumulus cloud.  Naturally, I was thinking of fractals.

I had spent the past few days coding technical analysis indicators in Python, which reminded me of coding same in C#.  This, in turn, reminded me that although the TA community talks a lot about geometric repetition, we have yet to invent a single fractal indicator, much less a trading strategy.

I write my trading strategies in C# on the MultiCharts platform.  Its procedures for time series data look a lot like the vector-oriented syntax of Python.  Here is how to do Bollinger bands in each:

  • StandardDeviationCustom(length, devs)
  • df[price].rolling(length).std() * devs

I have to admit not having much intuition about vector operations.  Matrices and summations just look like for loops to me – clearly an obstacle to the proper appreciation of Python.  I have worked with SAS and SYSTAT, though, so Python at the command prompt seems natural.

What I noticed with the Python exercise is that the classic TA indicators were designed with an iterative mindset, reflecting the programming languages of the day – Sapir’s theory, again – and so I imagine that the reason we have no fractal indicators is that our language can’t express them.

Here are some basic things I would expect from a fractal-oriented programming language:

  • Create a dataset from a generator function
  • Derive fractal metrics, like the Hausdorff dimension
  • Compare two datasets for statistical similarity
  • Compare a dataset to subsets of itself

Admittedly, I have only a cursory notion of how this would work.  That’s why this piece has “speculation” in the title.  Meanwhile, I will continue plugging away in C# and Python.

Author: Mark Virag

Management consultant specializing in software solutions for the auto finance industry.

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

%d bloggers like this: