Tuesday, 23 June 2015

Data mining with Asirikuy's OpenKantu to discover trading strategies

Over the course of the last three years I've been studying trading as a method of portfolio diversification. One promising looking option for strategy discovery seems to be data mining, and I've had a look at OpenKantu from the Asirikuy stable.

OpenKantu is billed as the "first free and open source price action based trading system generator".  All of which sounds very promising.  The author, Daniel Fernandez sounds like he knows what he's doing.  OpenKantu has been superseded by pKantu, which forms part of the Asirikuy paid-for service.  Daniel has released OpenKantu for general use, and because he signposts the user towards Asirikuy, I think it reasonable to assume he's using OpenKantu as a "try-before-buy" system.  Indeed, he specifically states that there are no trials available for the Asirikuy service.

With that all in mind, I embarked on a trial of OpenKantu.

My impressions are:
  • it's easy to use
  • it's fast
  • the documentation is OK
  • it can produce systems
But:
  • the MetaTrader4 (MT4) ExpertAdviser (EA) included with OpenKantu (RecordBars_MT4.mq4) to export data for testing direct from MT4 produced a vast multi-gigabyte file of the 4 hour data I fed it, creating huge numbers of multiple entries
  • it's no trivial matter to import data and then correctly run tests outside of the RecordBars_MT4 EA, the manual is short on information, and Daniel politely made it clear he would not answer my query surrounding data digit depth (0.0001 is 4 digit, 0.00001 is 5), and how to correctly set OpenKantu up to deal with this
  • I could not get any strategies that it produced to replicate on MT4
Here's what I did:
  • Read the OpenKantu manual
  • Found a source of 4 digit data from Forextester.com
  • Using CSVed, edited the data to import into MT4
  • Created a .csv of the data, 4 hour timeframe
  • Edited this with CSVed, and following the manual's instructions, imported this into OpenKantu
  • Ran a basic simulation in OpenKantu
  • Used OpenKantu's "export to MQL4" function to create an EA
  • Ran this in MT4
Remember, I'd used the same data both in OpenKantu and MT4, same date range, etc., so should have had (almost) identical results.

But no.  Even a cursory glance at the following balance graphs shows there are no similarities.  Even the number of trades do not match.

The following chart and table is the output of the results generated in OpenKantu for a trial strategy, from which the MT4 EA was generated: 


Balance - OpenKantu - from which eurusd EA was generated








P No. Symbol Abs. Profit Profit/trade Profit Longs Profit Shorts No. Longs No. Shorts Total Trades
1 66 EURUSD240 28160 461.63 891 27269 30 31 61










Max DD Ideal R R^2 Ulcer Index Max DD Length Cons.Loss Cons.Wins Profit:Max DD Win % Reward:Risk
3.29 0 0.939 1.25 129 4 9 7.94 59.02 0.69










Skewness Kurtosis PF Std.Dev Std.Dev Breach Total ME SQN Mod. Sharpe Ratio Custom Criteria Bars out
8.4 1.79 2.61 1534.56 2.35 17.9509 2.35 0.3 0 0










OSP OSP/trade OS_ProfitLongs OS_ProfitShorts OS_TotalLongs OS_TotalShorts OS_TotalTrades OS_MaxDD OS_UlcerIndex OS_MaxDDLength
0 0

















OS_Cons.Loss OS_Cons.Wins OS_ProfitToMaxDD OS_WinningPercentage OS_RewardToRisk OS_Skewness OS_Kurtosis OS_PF OS_StdDev OS_StdDevBreach




















OS_TotalME OS_R2 OS_SQN OS_ModifiedSharpeRatio OS_CustomCriteria OS_BarsOut Lowest Lag
















The following chart is the output from MT4, using the same data and strategy from OpenKantu:

Balance and Report - MT4 using eurusd EA




So, what do I conclude?  Not a lot, really.  OpenKantu, and therefore I assume (but can't tell) by association pKantu and the Asirikuy system works and seems to produce results.

But in order to test this, I'd have to buy into the product, taking a leap of faith - that's $300 worth of leap that I'll get a return.  I'm not ready to take that leap yet.