Code Monkey home page Code Monkey logo

clarity's Introduction

Clarity is a framework for quickly and professionally R&D new strategies for equities and derivatives.

It is built on top of the powerful R programming language, providing bindings to C, C++ as well as the most popular databases.

Beyond R's standard functionalities (basic statistics, time series, statistical mechanics, chaos, etc), Clarity proposal offers a handful of possibilities to leverage algotraders from portfolio theory to arbitrage to high frequency trading.

ETL equities and derivatives

Indicators and instruments are available for pre-loading and pre-calculation. Simulations can involve multiple instruments, either equities or derivatives, as well as multiple indicators, either pre-calculated or calculated on-the-fly.

Extract-Transform-Load

Event profiler

Track position evolution throughout the trades and diagnose what are their behaviour.

Event profiler

Reporting and journaling

Equity growth

Returns distribution

Win vs Loss distribution

All backend events are tracked in journaling. Journaling is a simplex channel to the frontend serving as a communication tool informing different notification levels, from warnings to errors.

Journaling

Further applications include abnormality detection and error correction & recovery.

Position sizing

Position sizing is an important part in scaling the trading strategy and there are optimal ways to calculate the right amount for each strategy. Widely known position sizing methods are Kelly criteria and Optimal/Fractional/Secure F.

Positions and position sizing

Position management

Act according to the position evolution using the basic or more elaborate techniques to cap risks.

  • Stop Loss
  • Take Profit
  • Trailing stop and dynamic trailing stop.

Links to other technologies

  • Languages: C, C++.
  • Data providers: Quandl.
  • Databases: Postgresql and all databases supported through DBI.
  • Platforms: Matlab.

Further links will include S-plus, Mathematica, and Q (Kdb).

Arbitrage spot

Comes with an extended triangular arbitrage module to spot latent arbitrage opportunities.

Arbitrage spot

Impact aggregator

Facing either same or opposite directions, an one-axis view over events at different impact levels plays in important role on strategy's success.

Pulse continuous impact aggregator

Vector- and Iteration-based simulation at same environment

Alike MetaTrader, the well known tool for retail traders, Clarity bundles the standard iteration loop begin()-start()-end(), specially useful in HFT, and the traditional vector-based simulation, as in Matlab, in one single environment enabling both approaches to be used simultaneously.

begin-tick-end loop

Parameter optimisation can be performed using genetic algorithms, simulated annealing, and a few others depending on parameters restrictions.

Installation

Run

./setup

and follow the given instructions.

clarity's People

Contributors

cassiopagnoncelli avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

clarity's Issues

Limit orders

Limit orders to be processed on the client side.

FIFO system

Backend should be able to process transactions as with FIFO system (OCO orders), so no hedging capabilities.

Stop Loss and Take Profit

Currently backend is unable to process Stop Loss and Take Profit on the server side. Perform an assessment whether that is plausible to implement since it downgrades performance, same for Take Profit.

Kelly criterion couldn't be poorer

Another optimization tool should be used rather than Kelly. It should accommodate different position sizes across simulation then provide an optimal position size that would maximize equity curve.

Oust vignettes

They don't belong to this project, they stand in the repo for mere convenience.

Short selling

No short selling for the moment, long buying only. Implement it.

Slippage simulation

Order execution performance is a challenge when volatility kicks in, then slippage is a problem. Framework should be able to simulate slippage.

Real time module

Engine should be able to simulate real time environment not just polling data from the database.

No FIFO

CFTC and other regulators use non-FIFO system so hedge-enabled. System should be able to replicate that model.

Trade on margin

Currently Clarity operates on equity only. Operating on margin would be a huge leverage as it open up the system for trading derivatives.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.