Strategy Backtesting System

Kuants
Algorithmic Trading-Complete Guide by Kuants
2 min readSep 5, 2018

Should it be a random formula? Do you wish to invest your money into an unknown randomly generated formula?

No. A strategy is developed from an idea. Any idea from any domain of life you like.

A 1-hour long boring meeting with the boss can be taken as a motivation for an investment idea.

What happens when you get out of that boring meeting?

You feel happy, right?

An analogy to this in terms of investment ideas can be: if the markets are cold for a specified period, neither moving up or down, but just hopping within low range, can you expect a “breakout” , i.e. can you expect that the “boring” period will end with a positive or a negative sentiment?

That’s a small invest idea.

An example of a line of thought to qunatify a qualitative idea is as follows:

A cold period in the markets will mean that the prices are not moving much. There is a very low range, meaning the recent standard deviation i.e. the amount of movement in the markets is lesser than the volatility in the longer range.
Our simulator has a predefined function called volatility(price, time period ). It takes the price of the stock and the time period to be considered to calculate the volatility.

std(open,10) gives the value of the standard deviation of open prices of the stock of last 10 minutes.

std(open,30) gives the value of the standard deviation of open prices of the stock of last 30 minutes.
Since the idea of the strategy is that if the recent movement in the market is lesser than the movement in its longer time period, a breakout is expected and you buy at that point.

std(close, 10) < std(close, 30)
Voila!

The left-hand side of the equation is the movement in recent times, the right-hand side of the equation is the movement in a longer time frame, then this formula causes our systems to buy when the recent 10 minutes standard deviation is lower than long-term 30 minutes standard deviation.

Test your strategies for free at kuants.in

--

--