Topic: I'm Yet to Build the Best Backtester and Generator
Hello Traders and fellow followers,
I'm going to start designing and building a strategy tester and a generator from scratch.
After ten years of working on FSB and FSB Pro and six years on EA Studio, I'm more experienced and more critical to my previous work.
Let's say I'm not completely happy with my achievements so far.
The significant drawbacks on the current backtesting engines are:
- FSB Pro is very complex, making it slow, impossible to fix or expand, and impossible to export pretty looking MQL code.
- EA Studio addresses the FSB Pro issues but lacks some requested features.
So what to do next?
Here is an outline of my plans and rationals:
Application:
- the product will be web-based - The browser-based applications are as fast as the classical desktop solutions.
Strategy structure:
- a single entry point and a single exit point - The strategies will open position at bar's Open and close at next bar's Open (on the same bar's Close for TradingView).
- Stop Loss, Take Profit, Break Even implemented as indicators. It will make it possible to have variable values based on Standard Deviation, previous High or Low, percentage of the price, percentage of the account (I know some traders die for that ). Of course, they will accept fixed Pip or Point values also.
- variable entry-amount - lots, dollar value, equity %, free margin %...
Computation:
- the indicators will reuse data and signals arrays to reduce the memory allocation and cleanup.
- separation of the calculation code from the code for generating MQL, PineScript, ...
- calculating strategies on pristine market conditions - this will allow us to reject strategies that fail early.
- applying spread, slippage, swaps, commissions, Monte Carlo distortions later. It will make the calculations faster and reusable. For example, Monte Carlo effects can be indicator signals instead of hard-coded within the backtester.
Imagine the simulation of 'Randomly skip entries'. Now the backtester looks at it every time because it doesn't know if it is allowed to open a position or not. It will be much easier to make it an indicator with buy and sell signals where the entries are randomly distributed and take, let's say, 20% of the length — no unique code for that purpose in the backtester anymore.
- having pristine strategy results will allow us to collect them on a central repo and recalculate them later on new data with specific market conditions applied. It will even not need to recalculate the indicators.
- calculating backtesting stats and applying Acceptance Criteria gradually - it means why to calculate R-squared if the strategy fails on Drawdown. We can reject it and continue with the next one.
Work in progress
I'm already working on a new application now.
It is a Generator for creating strategies for TradingView and exporting PineScript. It is a perfect moment to start from scratch because TradingView works differently from MetaTrader. It closes positions at Bar CLose and has a different set of embedded indicators.
I'll test my ideas with this app. I'm planning it to be simple and oriented towards traders with no experience with the algotrading. I hope it will take me 4-6 months to finish it.
Later, I'll see what works best and optimize EA Studio whit whatever is possible without breaking its current workflow.
My final goal is to test and calculate such fast to make a standby mobile phone application possible to calculate real-time trading signals.
Please share your opinion.
Trade Safe!