Sparkster’s Algo Backtesting Progress Update Continued

Sparkster
Sparkster
Published in
9 min readNov 13, 2019

“528% ROI and 43% win rate”!

That’s feedback from one of the alpha testers of the new Sparkster Trade Backtesting Tool.

Clearly we’re on to something with big potential.

Ongoing feedback has given our team the necessary assurance from a business perspective to progress towards beta stage. Like any new product innovation, there is a tremendous amount of work that goes into making the user experience as intuitive as possible and the product performance as powerful as possible.

Here are some highlights from alpha feedback, product changes, technical enhancements, and the roadmap towards beta launch.

Alpha Tester Feedback

The alpha testing program continues to help refine the backtesting tool with various small improvements made over the past couple of months.

“I built a basic version of my indicator, it works (528% ROI, 43% win rate, pretty good) but I need to add offset conditions to some of my indicators or a rising / falling feature.”

“Great progress! It’s pretty slick, much quicker than pine script, just missing some advanced features that sadly can make a big difference to ROI. Keep it up!”

“The UI is intuitive and I think your guys have done an excellent job. A pint of bitter to everyone from me”

“fawking sweet. I like the visual coding”

Feedback gets added to our engineering backlog for implementation.

As an example, several alpha testers requested ‘offset’ parameters. Our engineering team enabled offset parameters within 2 days. Agile response development will help us build the right tools based on real-world customer demand.

From all the feedback received we have learned a lot about the current views, sentiments and opinions within the crypto trading community and have adjusted our short-term business plan accordingly.

The ultimate goal for this product is to create a multi-sided platform of signal creators and signal buyers, with viral growth built into the product itself. The Beta version will reveal the first iteration of that plan.

Progress continues.

University Trading Societies

Five British and Australian Universities have registered interest in a 3-month inter-University competition using the Sparkster backtesting tool.

Most British and Australian Student Unions run societies to help students gain real-world knowledge in support of their studies. Specifically, Investment & Trading Societies give students a chance to experience a Trading Floor, with many societies managing real investment funds sponsored by major Financial Institutions.

The aim of the Sparkster backtesting competition is for Society members to build the best performing strategy on the platform with full historical data.

Comments from the University Trading Societies include:

“This sounds very interesting and I think we can find time as a society to work with these! I’d love to hear more if possible?”

“This is a brilliant opportunity for the ____ investment and trading society! I’ve talked to the committee and we’d be very interested to participate”

The winning society will be awarded a lifetime licence to the Sparkster Backtesting Platform for their Trading Society.

This program can potentially lead to many Joint Venture opportunities and ongoing publicity during our public launch phase.

Product Updates

Various improvements have been made since the last community update, including front-end features, design, and back-end infrastructure.

A series of 3 video demo tutorials have been added to the platform, helping alpha testers get started with a general orientation and introduction to the strategy creator. These demo videos will eventually develop into full multi-media tutorials.

Our aim is to make learning and using the tool as fast and efficient as possible, allowing traders to see the big picture overview of their strategies, deep dive into the specific performance metrics of individual strategy backtests, and discover entirely new strategies that perform well in different market conditions for specific crypto asset pairs.

New Indicators Added

Based on alpha tester feedback we have added a few more indicators.

Offset EMA

This option, popular with Exponential Moving Averages, allows the trader to displace the moving average to the left or right which can produce a reduced or increased lag effect for the buy/sell trigger.

Commodity Channel Index

CCI is an oscillator used to identify cyclical trends. This indicator was requested by an alpha tester as it is a regular piece of his overall trading strategy and the backtester tool would not be useful for him without it.

We continue to respond to indicator requests, including a very popular indicator known as the Ichimoku Cloud.

Ichimoku

The Ichimoku Cloud is a sophisticated multi-factor indicator built using different types of moving average calculation.

Invented by a Japanese journalist in the 1930s and finally published in 1969 after decades testing and improvement, it was originally known as Ichimoku Kinko Hyo which translates as “equilibrium chart at a glance”.

The Ichimoku Cloud allows a trader to see the current price action in relation to overall market momentum using dynamic support and resistance levels.

To include this indicator in the Sparkster backtesting tool required splitting each component into a separate block that can be included in the strategy creator.

This allows different readings of the Ichimoku to be made by our backtesting engine to produce accurate buy sell signals based on multiple factors at once. Once the trader finds the optimal arrangement and parameters for the specific trading pair and market conditions they are trading in, the buy/sell signals can be far more accurate than an expert human trader could perform.

The screenshot below of the strategy builder shows part of a complex strategy utilising Ichimoku Cloud elements, including the conversion line, baseline, lead 1 and lead 2.

Alpha testers now have access to these indicators inside their account.

Other Adjustments

Various adjustments to the user interface have also been made:

  • Login and registration page design.
  • Profile and user page functionality and design.
  • Pagination and navigation bars for large tables and windows.
  • Toggle button for the strategy creator window with new design and functionality.
  • Dropdown menu’s for various actions including commenting, liking and sharing strategies.
  • Comments popup design and functionality.

We are progressing towards a public beta launch, pending various elements for product and marketing.

Beta Launch Roadmap

There are three vital components for the public beta launch, all of which are now in development by the engineering team.

First…

Real-Time Signal Broadcasting

Real-time signals need to be received by trade execution platforms. To begin with, Telegram will be enabled via API connection. Signals will be sent from the Sparkster platform to private Telegram channels where traders can consume signal data either manually or via automated execution tools.

Second…

Re-Seller Marketplace

A re-seller marketplace is required for signal creators to promote their signals. We note that other signal providers and bot trading platforms are not transparent about the real performance of their strategies.

While Sparkster will ensure that indicators and parameters will be kept private to strategy creators, we will also ensure that full visibility of a strategies trading performance will be available in the public marketplace so that signal buyers know exactly what performance history a signal has historically performed at.

There are no guarantees that past performance will equal future performance, but this will help a fair comparison between signals, driving low performers out, and supporting top performers with the rewards they deserve of more paying subscribers.

Third…

Smart-Contract Payments Solution

We need a payment solution that incorporates smart-contracts enabling the SPRK token as the medium of payment, allowing users to subscribe to strategies of their choice.

Beyond that, a number of enhancements will be made for user experience including:

Performance Table Descriptions

Descriptors will be added in tip-tool popups for each column available in the performance table. This will help traders to fully understand what different metrics mean and how they are calculated.

More Sample Strategies

Beyond the three sample strategies already included we aim to include a wider selection giving traders a head-start on strategy ideas that can be easily customised with alternative indicators or parameters.

This will include RSI, OBV, Ichimoku, and MACD.

More Indicators

We continue to add more. Next on the to-do list is an indicator called Stochastics.

Technical Update

From the backtesting tool’s development team:

For the current release, most of the work on the server-side was focused on optimization. One of the consequences to using an environment such as NodeJS is that the environment’s single-threaded nature imposes limits on CPU-intensive operations. This impediment is especially noticeable in applications such as our trading platform which performs many complex computations to generate data based on financial indicators.

Because NodeJS runs in a single-threaded environment, it is not advisable to perform CPU-intensive operations with it (such as iterating over millions of records.) The reason for this is that while the iteration is executing, the event loop is said to be blocked. The event loop is responsible for processing incoming requests, IO callbacks, etc. If the loop is blocked due to some long-running operation, the code either never reaches or takes a long time to reach the part where it dequeues incoming web requests and IO operations. This means that until the computation is done, all other operations — such as processing incoming web requests — are stalled.

For the end-user, blocking the event loop creates a situation where pages load slower, the connection to the server times out, etc. This is because the requests are queued, and the event loop is taking a long time to dequeue and process them because it is currently processing a long running piece of code. Overall, it’s simply not a good experience, particularly in today’s complex web environment. We expect servers to respond nearly instantly to any type of request.

We were noticing performance degradations when new strategies were being generated and tested or saved. In light of this, we employed the use of two options NodeJS offers to run a program in a multi-threaded manner. A multi-threaded program runs one set of instructions while concurrently running another set. On a system with multiple processors or a single processor with Hyper-Threading technology, one set of instructions is run in parallel to another set, so multi-core systems benefit more from multi-threaded programs than single-core systems.

The first option we employed is the use of worker threads in NodeJS. A worker thread allows CPU-intensive tasks to run on a different thread than the main NodeJS thread. This keeps the main NodeJS thread free from event loop blocking, all while the CPU-intensive task (such as calculating the result of indicators over a very large dataset) continues to run.

While this solution was sufficient for the main part of the program that was causing the event loop to block, we also had to consider the part of the program that pulls in the data and streams it to the indicator calculation section of the program. A worker thread solution would have sufficed here, but we ran into issues when employing a worker thread model here. The reason for this was that we use the Canvas.JS NodeJS module that is not context aware. So, when you spawn one worker thread that requires the Canvas module, the program runs fine. Subsequent spawning of the worker thread results in exceptions. This means that if your code uses Canvas, you can run that code in only one worker thread at a time.

The solution here is to create a new process instead of a thread. The main difference between threads and processes is that threads have access to shared memory space and subprocesses do not. Since Canvas is not context-aware, the best solution for our problem is to create a separate memory space for the code that requires Canvas. By doing this we prevent conflicts between the different Canvas modules.

Once we split the program up into many threads and a few subprocesses, we solved the problem of blocking the main thread’s event loop, allowing the application to respond quickly whether or not we had strategies running in the background. This enhancement greatly improved the feel of the application.

The Sparkster Team

--

--

Sparkster
Sparkster

Build smart software in Plain English! Run at 10 million TPS. Join us at https://sparkster.me/ @Sparkster_Me