https://github.com/adlai/scalpl.git
git clone 'https://github.com/adlai/scalpl.git'
(ql:quickload :scalpl)
██████==▄████▄===▄▄▄=======██▓=====██▓███===██▓====
▒██≡≡≡≡▒≡▒██▀≡▀█≡≡▒████▄≡≡≡≡▓██▒≡≡≡≡▓██░≡≡██▒▓██▒≡≡≡≡
░=▓██▄===▒▓█====▄=▒██==▀█▄==▒██░====▓██░=██▓▒▒██░====
≡≡▒≡≡≡██▒▒▓▓▄≡▄██▒░██▄▄▄▄██≡▒██░≡≡≡≡▒██▄█▓▒≡▒▒██░≡≡≡≡
▒██████▒▒▒=▓███▀=░=▓█===▓██▒░██████▒▒██▒=░==░░██████▒
▒.▒▓▒.▒.░░.░▒.▒..░.▒▒...▓▒█░░.▒░▓..░▒▓▒░.░..░░.▒░▓..░
░.▒..░.░..░..▒...`.░...▒▒.░░.░.▒..░░▒.░..`..░.░.▒..░
░..░.`░..`..`.....`..▒.`░..░.░..`░░..`.....`░.░...
░..░..░..markets..░...`..`.░..░.`..lisp...`░..░
░.............mayhem..`..`............`..
The software is provided devoid of warantee, guarranty, liesense, and noncence: “do as thou wilt”.
ScalpL will be an engine for expressing arbitrarily intricate policies for placement and removal of offers in asset exchanges; today, it is hardcoded as a market maker.
Three Bitcoin exchanges are supported: Bitfinex, BTC-e, and Kraken. More is in the works; contact Adlai on Freenode for details and inquiries.
Documentation currently takes the form of penne bolognese; translating this to natural language is a slow process, second in priority to refactoring the dish and evolving its phenotype.
Kevin Simler's thoughts on wealth, specifically parts Ⅱ-Ⅳ (the “Congolese Trading Window”), outline the ideological basis for ScalpL;
Christ Stucchio's HFT Apology outlines the mechanics of automated market making (ie, real world Congolese Window Trading);
Peter Seibel's introduction to the excellent Practical Common Lisp lays out the factors behind the unconventional language choice; the book itself lights the larval lisper's quest; and
Timothy B Lee's cards summarize the Bitcoin phenomenon for the unfamiliar, purely as enrichment; though catalyzed by cryptocurrency, ScalpL itself is agn-asset-ic.
The hardcoded volatility harvesting algorithm obeys several parameters:
fund-factor indicates the largest total fraction of the account funds (from either asset) which should ever be offered for trade.
resilience-factor affects how deeply offers penetrate into the order book; the factor is multiplied by the recent maximal trade volume.
targeting-factor is part of a negative feedback loop used to maintain a desired balance between the traded assets, although it is not a hard limit; persistent markets can elude this factor's rebalancing effect indefinitely.
skew-factor controls the nonlinearity of the feedback loop.
cut controls the tightness of placed offers; raising it yields a more profitable spread, at the cost of reduced execution volume.
Harvesting progresses best when the market moves harmoniously with the configured parameters: for example, the most profitable targeting for a market which trends sideways will be equal allocation.
Allocation too far in the “wrong” direction other results in the harvester accumulating the asset unloaded by other market participants, eventually getting “run over”: the portfolio is sufficiently imbalanced to prevent further market making. One can either wait for the trend to reverse, or rebalance at a loss.
Poorly calibrated resilience also weakens returns: if the resilience is too high compared to current market activity, execution volume suffers; too low, and the increased volume is only beneficial when the market moves match the targeting feedback cycle (mismatch accelerates the “running-over”).