Tuesday 3 October 2017

Arkkitehtuuri Of Algo Kauppa Järjestelmä


Järjestelmäarkkitehtuuri AlgoTraderin arkkitehtuuri koostuu seuraavista osista. AlgoTrader-palvelin tarjoaa infrastruktuurin kaikkiin sen päällä oleviin strategioihin. AlgoTrader-palvelimella on keskeinen Esper Complex Event Processing (CEP) - moottori. Se vastaa kaikista verkkotunnusobjekteista ja niiden pysyvyydestä tietokantaan. Eri markkinasovittimia on saatavilla käsittelemään live - ja historiallisia markkinatietoja. Toisessa päässä on saatavana sovittimia eri toteutusvälittäjille ja pörsseille, jotka ovat vastuussa tilausten tekemisestä ja teloitusten vastaanottamisesta. AlgoTrader-palvelin tarjoaa myös liiketoiminnan komponentteja salkunhallintaa, suorituskyvyn mittaamista, riskienhallintaa, rahanhallintaa, optiohinnoittelua, sovittelua, Forex-suojausta ja parametrien optimointia. AlgoTrader-palvelimen päälle voidaan ottaa käyttöön useita strategioita. AlgoTraderilla on tapahtumavetoinen arkkitehtuuri, joka käyttää strategiaa kohti yhden omituisen Esper CEP - moottorin. Strategia voi ottaa käyttöön SQL-kaltaisia ​​Esper-lausekkeita aikaperusteiseen markkinatietojen analyysiin ja signaalien generointiin. Esper-lausunnot voivat vedota mihinkään menettelytapoihin, kuten järjestykseen tai sulkemiseen, jotka on koodattu Java: ssa. Esper-lausekkeiden ja Java Codein yhdistelmä tarjoaa parhaan mahdollisen lähestymistavan. Järjestelmän hallintaan ja seurantaan on olemassa neljä erilaista graafisen käyttöliittymän asiakasta. Uusi AlgoTrader HTML5 Frontend tarjoaa kaupankäynnin kohteena olevia toimintoja, kuten kaaviota, tilauksia, asemia ja markkinatietoja. AlgoTrader Eclipse - asiakas on oletusstrategian kehitysympäristö. EsperHQ-asiakas hallitsee Esper CEP - moottoria. Grails-asiakas on yleinen asiakaskunta referenssitietojen hallintaan. Tuottavissa asennuksissa ja käyttöönotossa AlgoTrader käyttää Dockeria. AlgoTrader 3.1 integroi InfluxDB: n tammi-20-2017 AlgoTrader integroi InfluxDB: n tallentamaan elävää ja historiallista markkinatietoa. InfluxDB: n avulla voidaan varastoida miljardeja punkkeja ja käyttää niitä takaisin testaamiseen. Esittelyssä AlgoTrader 3.0 8211 Tehokkain AlgoTrader vielä Apr-07-2016 AlgoTrader 3.0 on julkaistu. Tämä julkaisu sisältää uuden HTML5 Frontendin, yhden napsautuksen käytön Dockerilla, kolmella uudella Execution Algorithmilla ja Excel-pohjaisella Back Test Raportilla, jossa esitellään AlgoTrader One-Click - installaatiota Dockerin kanssa. Mar-15-2016 AlgoTrader 3.0 tuo markkinoille yhden napsautuksen kaupankäyntistrategiaan Docker AlgoTrader-lisenssiehdot Tämän END USER LICENSE-SOPIMUKSEN EHDOT (8220AGREEMENT8221) KÄYTÄ OHJELMISTON KÄYTTÖÖN, JOS ETÄ JA LISENSSINSA OLETETUT OHJELMISTON KÄYTÖSTÄ OLEVA SEPARATE KIRJALLINEN LISENSSISOPIMUS. Lisenssinantaja on halukas myöntämään Ohjelmiston käyttöoikeuden vain, jos hyväksyt kaikki tämän Sopimuksen sisältämät ehdot. Allekirjoittamalla tämän Sopimuksen tai lataamalla, asennat tai käytät Ohjelmistoa, olet ilmoittanut ymmärtävänsi tämän Sopimuksen ja hyväksysi kaikki ehdot. Jos et hyväksy kaikkia tämän Sopimuksen ehtoja, Lisenssinantaja ei ole halukas lisensoimaan Ohjelmistoa sinulle, etkä voi ladata, asentaa tai käyttää Ohjelmistoa. 1. LISENSSIN MYÖNTÄMINEN a. Arviointi Käyttö ja kehitys Käyttöoikeus. Jollei tämän Sopimuksen ehtoja noudateta, Lisenssinantaja myöntää sinulle henkilökohtaisen, ei-yksinomaisen, ei-siirrettävän lisenssin, jolla ei ole oikeutta alilisensoida tämän Sopimuksen voimassaoloaikana, käyttää Ohjelmistoa sisäisesti vain Arviointi Käyttö ja kehitys. Luvattajan toimittamia kolmannen osapuolen ohjelmistotuotteita tai - moduuleja voidaan käyttää vain Ohjelmiston kanssa, ja niihin voi liittyä näiden kolmansien osapuolten antamien ehtojen hyväksyminen. Kun lisenssi päättyy, sinun on lopetettava ohjelmiston käyttö ja poistettava kaikki asennukset. Kaikki oikeudet, joita ei ole nimenomaisesti myönnetty sinulle tässä, säilytetään Lisensoijalla. Kehittäjä ei saa käyttää kaupallista ohjelmistoa tai mitään sen johdannaistyötä (mukaan lukien Developer8217: n omat sisäiset liiketoiminnan tarkoitukset). Ohjelmiston tai kehittäjän sovelluksen kopioiminen ja jakaminen missä tahansa muodossa suoraan tai epäsuorille asiakkaille on kielletty. b. Tuotannon käyttöoikeus. Jollei tämän Sopimuksen ehtoja ja ehtoja noudateta, mukaan lukien voimassa olevan lisenssimaksun suorittaminen, Lisenssinantaja myöntää sinulle ei-yksinomaisen ja ei-siirrettävän lisenssin ilman lisenssisopimuksen mukaista oikeutta tämän sopimuksen voimassaoloaikana : (A) käyttää ja toistaa Ohjelmistoa vain omaan sisäiseen liiketoimintaan (8220Production Use8221) ja (b) tehdä kohtuullinen määrä kopioita Ohjelmistosta pelkästään varmuuskopiointitarkoituksiin. Tällainen käyttöoikeus rajoittuu CPU: n (mikäli CPU: n lisensointi) tai Java Virtual Machinesin (jos virtuaalikoneiden lisenssit) määrä on tietyn määrän CPU: lle, josta olet maksanut lisenssimaksun. Ohjelmiston käyttö useammissa Java Virtual Machinesin suorittimissa tai instansseissa edellyttää lisenssimaksun maksamista. Kolmannen osapuolen ohjelmistotuotteita tai - moduuleja, joita Licensor toimittaa, jos niitä käytetään, voidaan käyttää vain Ohjelmiston kanssa. C. Ei muita oikeuksia. Ohjelmiston käyttöoikeudet ja käyttöoikeus rajoittuvat niihin, jotka on nimenomaisesti myönnetty tässä jaksossa 1. Ohjelmistoa ei saa käyttää muuhun tarkoitukseen. Jollei tässä jaksossa nimenomaisesti ole toimilupaa, Lisenssinantaja ei anna sinulle muita oikeuksia tai lisenssejä, implisiittisesti, estoppel tai muuten. KAIKKI OIKEUDET, JOTKA EIVÄT LISÄTIETOJA TAI SEN TOIMITTAJAT VASTAA ILMAISESTI. 2. RAJOITUKSET Jollei 1 jaksossa toisin määrätä, et (a) muokkaa, kääntänyt, purkaa, luo ohjelmiston johdannaisia ​​tai kopioi ohjelmistoa (b) vuokraa, lainata, siirtää, jakaa tai myöntää oikeuksia Ohjelmisto missä tahansa muodossa mille tahansa henkilölle (c) toimittaa, paljastaa, paljastaa tai asettaa saataville Ohjelmiston käyttöoikeudet kolmannelle osapuolelle (d) julkaisee minkä tahansa Ohjelmiston tai sen osan tai E) poistaa kaikki omistusoikeusilmoitukset, tarrat tai merkinnät Ohjelmistosta. Et jakaa ohjelmistoa kenellekään itsenäiselle tai alkuperäiselle laitevalmistajalle (OEM). 3. OMISTUS Osapuolten välinen ohjelmisto on ja tulee olemaan ja pysyy lisenssinantajan ainoana ja yksinomaisena ominaisuutena, mukaan lukien kaikki immateriaalioikeudet. a. Jos käytät Ohjelmistoa kohdan 1 (a) mukaisen lisenssin nojalla, tämä sopimus pysyy voimassa arvioinnin tai kehitysaikana. b. Jos käytät Ohjelmistoa kohdan 1 (b) mukaisen lisenssin alle, tämä sopimus pysyy voimassa joko a) yhden vuoden ajan, jos se on ostettu vuosittaisena tilauslisenssinä tai (b) jatkuvasti, jos se on ostettu Jatkuva lisenssi. Vuosittainen tilauslupa uusitaan automaattisesti vuodella, ellei se irtisanota yhden kuukauden etukäteen. Tämä sopimus irtisanotaan automaattisesti ilman irtisanomista, jos loukkaat tämän sopimuksen voimassaoloa. Päätyttyä sinun on välittömästi lopetettava Ohjelmiston käyttö ja tuhottava kaikki hallussaan tai valvomassasi ohjelmistossa olevat kopiot. 5. TUKI PALVELUT Jos olet ostanut tämän lisenssin, joka sisältää tukipalvelut, nämä sisältävät ylläpitoilmoitukset (päivitykset ja päivitykset), puhelintuen ja sähköpostin tai verkkopohjaisen tuen. a. Lisenssinantaja tekee kaupallisesti kohtuullisia ponnistuksia toimittaa päivitys, jonka tarkoituksena on ratkaista tai ohittaa raportoitu virhe. Jos tällainen virhe on korjattu huoltovapauteen, lisenssinhaltijan on asennettava ja toteutettava sovellettava huoltovapautus muuten, päivitys voidaan antaa tilapäisen korjauksen, menettelyn tai rutiinin muodossa, kunnes käytetään huoltovapautta, joka sisältää pysyvän päivityksen on käytettävissä. b. Lisenssisopimuksen voimassaoloaikana lisenssinantajan on pidettävä ylläpitoilmoituksia käyttöoikeuden haltijan saataville, jos ja milloin lisenssinantaja tekee tällaiset ylläpitoilmoitukset yleensä asiakkaidensa saataville. Jos ilmenee kysymys siitä, onko tuotetarjous Upgrade tai uusi tuote tai ominaisuus, Licensor8217: n lausunto on voimassa, edellyttäen, että Lisensoija käsittelee tuotetuottoa uudeksi tuotteeksi tai ominaisuudeksi loppukäyttäjäasiakkailleen yleensä. C. Licensor8217: n velvollisuus tarjota tukipalveluja edellyttää seuraavia ehtoja: (a) Lisenssinsaaja tekee kohtuulliset ponnistelut virheen korjaamiseksi kuultuaan Lisenssinantajaa (b) Lisenssinsaaja antaa Lisenssinantajalle riittävät tiedot ja resurssit virheen korjaamiseksi joko Licensor8217s - sivustossa (C) lisenssinhaltijan viipymättä asennat kaikki ylläpitoilmoitukset ja (d) lisenssinhaltija hankkii, asentaa ja ylläpitää kaikkia laitteita, viestintää liitännät ja muut laitteet, jotka ovat välttämättömiä tuotteen toiminnan kannalta. d. Lisenssinantaja ei ole velvollinen toimittamaan Tukipalveluja seuraavissa tilanteissa: (a) Tuote on muutettu, muokattu tai vahingoittunut (paitsi jos lisenssinantajan suora valvonta) (b) Virhe johtuu Licensee8217: n laiminlyönnistä, laitteiston toimintahäiriöstä (C) Virhe johtuu kolmannen osapuolen ohjelmistosta, jota ei ole lisensoinut Lisensoijan kautta (d) Lisenssinhaltija ei ole asentanut ja toteuttanut ylläpitovälinettä (Release Release (s)) niin, että Tuote on Lisenssinantaja tai e) Lisenssinhaltija ei ole maksanut lisenssimaksuja tai tukipalvelujen maksuja milloin tahansa. Lisenssinantaja ei myöskään ole velvollinen antamaan Tukipalveluja sellaisen ohjelmistokoodin varalle, jonka asiakas itse on itse luonut. e. Lisenssinantaja pidättää itsellään oikeuden keskeyttää tukipalvelut, jos lisenssinantaja harkintansa mukaan päättää, että jatkuva tuki tuotteille ei ole enää taloudellisesti mahdollista. Lisenssinantaja antaa lisenssinhaltijalle vähintään kolme (3) kuukautta etukäteen kirjallista ilmoitusta kaikista tällaisista tukipalveluiden lopettamisesta ja palauttaa kaikki kerättämättömät tukipalvelupalkkioiden maksut Lisenssinhaltija voi maksaa ennakkomaksua kyseessä olevan tuotteen suhteen. Käyttöoikeuden myöntäjällä ei ole velvollisuutta tukea tai ylläpitää mitään Tuotteen tai taustalla olevien kolmannen osapuolen käyttöympäristöjen (mukaan lukien, mutta ei rajoittuen, ohjelmistoja, JVM: tä, käyttöjärjestelmää tai laitteistoa), joita varten Tuotetta tuetaan, paitsi i) tämänhetkinen versio Tuote ja taustalla oleva kolmannen osapuolen foorumi sekä (ii) kaksi tuoteversion ja käyttöjärjestelmän välitöntä edellistä versiota kuuden (6) kuukauden kuluttua siitä, kun ohjelmisto on ensin korvattu. Lisenssinantaja pidättää itsellään oikeuden keskeyttää tukipalveluiden suorittamisen, jos lisenssinhaltija ei maksa mitään summaa, joka maksetaan lisenssinantajalle sopimuksen mukaisesti kolmenkymmenen (30) päivän kuluessa siitä, kun summa erääntyy. 6. TAKUU a. Lisenssinantaja takaa, että ohjelmisto pystyy suorittamaan kaikilta olennaisilta osin sovellettavien asiakirjojen toiminnallisten eritelmien mukaisesti 90 päivän ajan ohjelmiston asentamisen jälkeen. Jos takuu on ristiriidassa, lisenssinantajan on optio-oikeutensa mukaan korjattava ohjelmisto tai korvaava tällainen ohjelmisto maksutta. Edellä mainitut ovat ainoat ja yksinomaiset korjaustoimenpiteet ja Licensor8217: n ainoa vastuu näiden takuiden rikkomisesta. Edellä mainitut takuut on tehty vain sinun eduksi. Takuu koskee vain, jos (a) Ohjelmisto on asennettu oikein ja sitä käytetään kaikkina aikoina ja käyttöohjeiden mukaisesti. (C) Ohjelmistoon on sovellettu viimeisimpiä päivityksiä ja (c) Mitään muutoksia, muutoksia tai lisäyksiä Ohjelmisto on luovuttanut muille kuin Licensorille tai Licensor8217: n valtuuttamalle edustajalle. 7. VASTUUVAPAUSLAUSEKKEET, JOTKA LISÄKSI MUKAISESTI 6 JAKSOON SOVELLETTAVANA, LISENSSIN KÄYTETTÄVISSÄ ILMOITETTAVUUTTA KÄYTETTÄVÄT KAIKKI TAKUUT, MUKAAN LUKIEN MYYNTIKELPOISUUDESTA, SOPIVUUDESTA TIETTYYN TARKOITUKSEEN SOVELTUVUUDESTA TAI KÄYTETTÄVISSÄ OLEVAT TAKUUT, MUKAAN LUKIEN KAIKKI TAKUUT, TAI KÄYTTÖÄ. EI LISENSSIN TAI MUUTA TIETOJA, OTTELAAN TAI KIRJALLISESTA TAI TIETOISTA, JOTKA LUOVUTTAVAT TAKUUTA, JOTKA TÄMÄN SOPIMUKSEN EI OLE TÄMÄN ERITTÄIN TODETTU. Käyttöoikeuden myöntäjä ei takaa, että ohjelmistotuote täyttää asiakkaan tarpeet tai että hän noudattaa erityisiä käyttöehtoja. Lisenssinantaja ei takaa, että ohjelmistotuote toimii turvallisesti, virheettömästi tai keskeytyksettä. MÄÄRITETÄÄN, ETTÄ OHJELMISTOTUOTTEEN TÄYTETTÄVÄ TÄYDENTÄVÄ TURVALLISUUTTA JA YMPÄRISTÖVAHOITUSTA KOSKEVAT VAATIMUKSET. SAAT VASTAAVAA VASTUUTA JA KAIKKI VASTUU OHJELMISTON KÄYTTÖÖN OTTAMISESTA VAATIMUKSESTA VAATIMUSTEN TÄYTTÄMISESTÄ. LISENSSINOSSA EI OLE MISSÄÄN OLESKELUA VASTUULLISESTI TAI VASTUUSSA TIETOJEN MENETYKSESTÄ TIETTYYN TIETOKONEEN TAI TIETOJENVARUSTUSLAITTEESTA. 8. VASTUUN RAJOITTAMINEN LISENSSIN TOTEUTTAMINEN YHTEENSOPIVUUDESTA KAIKISISTA TOIMISTA KOSKEVISTA JA KAIKISISTA VASTUUN TEOLLISUUKSISTA KÄYTETTÄVISSÄ ON RAJOITTUA JA EI KÄYTÄ OHJELMISTON LISENSUORITTA KÄYTETTÄVÄ LISENSSIMAKSUT. LISENSSINTO EI OLE MISSÄÄN TAPAUKSESSA OLE VASTUUSSA MISTÄÄN ERITYISISTÄ, SATUNNAISISTA, ESIMERKKEISTÄ, KIERRÄTYKSELLÄ TAI VÄLILLISISTÄ VAHINGOISTA (MUKAAN LUKIEN KÄYTTÖÖN, TIETOJEN, LIIKETOIMINNAN TAI TUOTANNON MENETYKSISTÄ) TAI TÄMÄN OHJELMISTON SOPIMUS TAI KÄYTTÖ TAI SUORITUSKYKY OTSIKKO, SITOUDELLISESTI OLISI VASTUUSSA SOPIMUKSESTA, TAKUUTA, RIKKOMUKSESTA (MUKAAN LUKIEN MERKITTÄMINEN), VAKUUDEN VASTUU TAI MUUTA, ETTÄ LISENSSIN ON TIETTY TIETTYJEN TAPPIEN MAHDOLLISUUDESTA TAI VAHINGOITTAA. AJAN RAJOITUKSET YLIJÄÄTETÄÄN JA SOVELLETTAVAT, JOS JOKA KOSKEE TÄSSÄ SOPIMUKSELLA MÄÄRITTÄVÄ RAJOITETTU KORVAUS RAJOITTAA OLENSSISEN OLENNAISEN TARKOITUKSENSA. Sikäli kuin sovellettava toimivalta rajoittuu LISENSSIN KÄYTTÖÖN, JOTKA EIKÄ MISSÄÄN TAKUITA TAKUITA, TÄMÄ VASTUUVAPAUDEN VASTUUVAPAUDEN SOVELTUVUUS ON HYVÄKSY MÄÄRÄLLÄ MÄÄRÄLLÄ MÄÄRÄLLÄ. 9. YLEISTÄ Jos tämän Sopimuksen määräykset ovat pätemättömiä tai täytäntöönpanokelvottomia, tämän sopimuksen jäljelle jäävä osa on täysi voima. Siinä missä nimenomaiset tai epäsuorat rajoitukset eivät ole sovellettavien lakien mukaisia, nämä nimenomaiset tai epäsuorat rajoitukset ovat voimassa ja tulevat voimaan sovellettavan lainsäädännön sallimissa rajoissa. Tämä sopimus on osapuolten täydellinen ja yksinomainen sopimus tämän aiheen suhteen, korvaa ja korvaa kaikki edelliset sopimukset, viestinnät ja ymmärrykset (sekä kirjalliset että suulliset) kyseisestä aiheesta. Sopimuspuolet ovat itsenäisiä urakoitsijoita, eikä niillä ole valtuuksia sitoa toista eikä velvoittaa muita osapuolia. Kummankin osapuolen epäonnistuminen tämän sopimuksen mukaisten oikeuksien käyttämisestä tai täytäntöönpanosta ei estä tällaisia ​​oikeuksia. Lisenssinantaja hylkää missä tahansa ostotilauksessa tai muussa tilausasiakirjassa olevat ehdot, jotka ovat ristiriidassa tämän Sopimuksen ehtojen kanssa tai niiden lisäksi, ja ne katsotaan mitättömiksi. Tätä sopimusta tulkitaan ja tulkitaan Sveitsin lakien mukaisesti ilman lainvalintasääntöjä. Osapuolet hyväksyvät Zürichissä Sveitsissä sijaitsevan tuomioistuinten yksinomaisen toimivaltansa ja paikkansa ratkaistakseen tämän sopimuksen perusteella syntyneet tai niihin liittyvät riidat. 10. MÄÄRITELMÄT 8220 Arviointi Käyttö 8221 tarkoittaa Ohjelmiston käyttöä ainoastaan ​​arvioimiseen ja kokeiluun uusista käyttötarkoituksiin tarkoitetuista sovelluksista. 8220Production Use8221 tarkoittaa, että ohjelmistoa käytetään vain sisäisiin yrityskäyttöön. Tuotanto Käyttö ei sisällä oikeutta jäljentää ohjelmistoa alilisensointiin, jälleenmyyntiin tai jakeluun, mukaan lukien rajoituksetta, käyttö ohjelmiston jakamiseen tai jakeluun osana ASP-, VAR-, OEM-, jälleenmyyjä - tai jälleenmyyjäjärjestelyä. 8220Software8221 tarkoittaa Licensor8217s-ohjelmistoa ja kaikkia sen lisenssinantajan sisältämiä osia, asiakirjoja ja esimerkkejä. 8220Error8221 tarkoittaa joko (a) tuotteen epäonnistumista asiakirjojen vaatimusten mukaisuudesta, mikä johtaa tuotteen kyvyttömyydestä käyttää tai rajoittaa tuotteen käyttöä, ja (b) ongelma, joka edellyttää uusia menettelytapoja, selvennyksiä , Lisätietojen tai pyyntöjä tuoteparannuksia varten. 8220Muistutus Release 8221 tarkoittaa tuotteen päivityksiä ja päivityksiä, jotka lisätään lisenssinsaajille 5 jaksossa määriteltyjen vakiotoimitusten mukaisesti. 8220Update8221 tarkoittaa joko ohjelmistomuutosta tai lisäystä, joka korjataan virheen tai virheen korjaamiseksi Menettelytapa tai rutiini, joka havaitaan tuotteen tavanomaisessa käytössä, poistaa virheen käytännöllisen kielteisen vaikutuksen luvanhaltijalle. 8220Upgrade8221 tarkoittaa lisenssien julkaisemaa tuotetta sen loppukäyttäjäasiakkaille, jotka yleensä tukipalvelutermin aikana lisäävät uusia tai erilaisia ​​toimintoja tai lisäävät tuotteen kapasiteettia. Päivitys ei sisällä uuden tuotteen vapauttamista tai lisäominaisuuksia, joista voi olla erillinen maksu. Algoritminen kaupankäyntijärjestelmäarkkitehtuuri Aikaisemmin tässä blogissa olen kirjoittanut älykkään algoritmisen kaupankäyntijärjestelmän käsitteellisestä arkkitehtuurista sekä toiminnallisesta ja ei - - tuotannon algoritmisen kauppajärjestelmän toiminnalliset vaatimukset. Siitä lähtien olen suunnitellut järjestelmäarkkitehtuurin, jonka mielestäni voin tyydyttää arkkitehtoniset vaatimukset. Tässä artikkelissa kuvataan arkkitehtuuria noudattamalla ISOIECIEEE 42010 - järjestelmien ja ohjelmistosuunnittelun arkkitehtuurin kuvausstandardin ohjeita. Tämän standardin mukaan arkkitehtuurikuvauksen on oltava: Sisältää useita standardoituja arkkitehtuurinäkymiä (esim. UML: ssä) ja Jäljitettävyys suunnittelupäätösten ja arkkitehtonisten vaatimusten välillä Ohjelmiston arkkitehtuurin määrittely Järjestelmäarkkitehtuurista ei ole vielä yksimielisyyttä. Tässä artikkelissa määritellään infrastruktuuri, jonka sisällä toiminnalliset vaatimukset täyttävät sovelluskomponentit voidaan määritellä, ottaa käyttöön ja toteuttaa. Toiminnalliset vaatimukset ovat järjestelmän ja sen komponenttien odotetut toiminnot. Ei-toiminnalliset vaatimukset ovat toimenpiteitä, joiden avulla voidaan mitata järjestelmän laatua. Järjestelmä, joka täysin täyttää toiminnalliset vaatimukset, ei silti voi täyttää odotuksia, jos toimimattomia vaatimuksia jätetään tyytymättömiin. Tämän konseptin havainnollistamiseksi on otettava huomioon seuraava skenaario: juuri ostettuun algoritmiseen kaupankäyntijärjestelmään tehdään erinomaisia ​​kaupankäyntipäätöksiä, mutta se on täysin toimintakykyinen organisaatioiden riskienhallinta - ja kirjanpitojärjestelmien kanssa. Olisiko tämä järjestelmä vastaamaan odotuksiisi Konseptiarkkitehtuuri Käsitteellinen näkymä kuvaa korkean tason käsitteitä ja mekanismeja, joita järjestelmässä on korkeimmalla tasolla. Tällä tasolla algoritminen kaupankäyntijärjestelmä seuraa tapahtumaketjuista arkkitehtuuria (EDA), joka on hajonnut neljään kerrokseen ja kaksi arkkitehtonista näkökulmaa. Jokaiselle kerrokselle ja puolen viitearkkitehtuureille ja kuville käytetään. Arkkitehtoniset mallit ovat osoittautuneet, yleiset rakenteet erityisten vaatimusten saavuttamiseksi. Arkkitehtoniset näkökohdat ovat monialaisia ​​huolenaiheita, jotka ulottuvat useisiin osioihin. Tapahtumaketjuinen arkkitehtuuri - arkkitehtuuri, joka tuottaa, havaitsee, kuluttaa ja reagoi tapahtumiin. Tapahtumia ovat reaaliaikaiset markkinaliikkeet, monimutkaiset tapahtumat tai trendejä ja kaupankäyntitapahtumat, esim tilauksen tekeminen. Tämä kaavio havainnollistaa algoritmisen kaupankäyntijärjestelmän käsitteellistä arkkitehtuuria Reference Architectures Analogian käyttämiseksi referenssiarkkitehtuuri on samanlainen kuin kantavien seinien piirustukset. Tätä sinistä painetta voidaan käyttää uudelleen useisiin rakennusmalleihin riippumatta siitä, mitä rakennusta rakennetaan, koska se täyttää joukon yleisesti esiintyviä vaatimuksia. Vastaavasti viitearkkitehtuuri määrittelee mallin, joka sisältää geneeriset rakenteet ja mekanismit, joita voidaan käyttää konkreettisen ohjelmistorakenteen rakentamiseen, joka täyttää tietyt vaatimukset. Algoritmisen kaupankäyntijärjestelmän arkkitehtuuri käyttää viitekehyksenä avaruuspohjaista arkkitehtuuria (SBA) ja mallinäkymän ohjainta (MVC). Käytetään myös hyviä toimintatapoja, kuten toimintatietojen tallennus (ODS), ekstraktimuunnos ja kuormitus (ETL) sekä tietovarasto (DW). Mallinäkymäohjain - kuvio, joka erottaa tietojen esityksen käyttäjien vuorovaikutuksesta sen kanssa. Avaruusperustainen arkkitehtuuri - määrittää infrastruktuurin, jossa löyhästi kytketyt käsittelylaitteet toimivat keskenään toisiinsa jaettuun assosiatiiviseen muistiin, jota kutsutaan avaruudeksi (alla). Rakenteellinen näkymä Arkkitehtuurin rakennekuva näyttää algoritmisen kaupankäyntijärjestelmän komponentit ja osa-osat. Se osoittaa myös, miten nämä komponentit asennetaan fyysiseen infrastruktuuriin. Tässä näkymässä käytetyt UML-kaaviot sisältävät komponenttipiirrokset ja käyttöönottokaaviot. Alla on galleriassa yleisen algoritmisen kaupankäyntijärjestelmän ja SBA-viitearkkitehtuurin prosessointiyksiköiden käyttöönottokaaviot sekä niihin liittyvät komponentti-kaaviot jokaiselle kerroksille. Arkkitehtoniset taktiikat Ohjelmistotekniikan instituutin mukaan arkkitehtoninen taktiikka on keino täyttää laatuvaatimus manipuloimalla osa ominaisuusmallin arkkitehtonisen suunnittelupäätöksen avulla. Yksinkertainen esimerkki, jota käytetään algoritmisessa kaupankäyntijärjestelmäarkkitehtuurissa, on manipuloida operatiivista tietovarastoa (ODS) jatkuvalla kyselykomponentilla. Tämä komponentti analysoisi jatkuvasti ODS: ää monimutkaisten tapahtumien tunnistamiseksi ja poistamiseksi. Arkkitehtuurissa käytetään seuraavia taktiikoita: Tapahtuman hajotuskuvio ja tilausjonot Tapahtumien ja tilausjonojen yhteinen muisti ODS: n jatkuva kyselykieli (CQL) Suodatus suodattamalla suodattimen kuvio tulevilla tiedoilla Kaikkien ruuhkautumisen välttelyalgoritmit Saapuvat ja lähtevät yhteydet Aktiivinen jononhallinta (AQM) ja nimenomainen ylikuormituksen ilmoittaminen Hyödyke-laskentaresurssit, joilla on valmius päivittää (skaalattava) Aktiivinen irtisanominen kaikille yksittäisille vikapisteille Indeksointi ja optimoidut pysyvyyden rakenteet ODS-ohjelmassa Aseta säännölliset tietojen varmuuskopiointi - ja puhdistuskoodit ODS-tapahtumatietokannat kaikissa tietokannoissa Tarkastukset kaikista virheiden havaitsemista koskevista tilauksista Merkitse tapahtumia aikaleimoilla ohittaaksesi vanhentuneita tapahtumia Tilaa validointisäännöt esim. suurimmat kaupalliset määrät Automatisoidut kauppiaskomponentit käyttävät muistiin tallennettua tietokantaa analyysiin Kahden vaiheen autentikointi AT: hen kytkeytyvien käyttöliittymien salaukseen Käyttöliittymien salaus ja AT: n yhteydet Observer-suunnittelukuvio MVC: lle käsittelemään näkymiä Edellä oleva luettelo on vain muutamia muotoiluja Arkkitehtuurin suunnittelun aikana tunnistetut päätökset. Se ei ole täydellinen luettelo taktiikoista. Järjestelmän kehittymisen myötä on käytettävä ylimääräisiä taktiikoita useiden eri tasojen rakeisuuden suhteen funktionaalisten ja ei-toiminnallisten vaatimusten täyttämiseksi. Alla on kolme kaaviota, jotka kuvaavat häiriöiden suunnittelumallin, suodattimen suunnittelumallin ja jatkuvan kyselykomponentin. Käyttäytymisnäkymä Tämä arkkitehtuurin näkymä näyttää, miten komponentit ja kerrokset toimivat keskenään. Tämä on hyödyllistä, kun luodaan skenaarioita arkkitehtuurisuunnitelmien testaamiseksi ja järjestelmän ymmärtämiseksi päästä päähän. Tämä näkymä koostuu sekvenssikaaviosta ja toimintokuvista. Seuraavassa esitetään toimintokaaviot, jotka esittävät algoritmisten kaupankäyntijärjestelmien sisäisen prosessin ja miten kauppiaat oletetaan toimivan algoritmisen kaupankäyntijärjestelmän kanssa. Teknologiat ja kehykset Lopullinen askel ohjelmistokehityksen suunnittelussa on tunnistaa mahdolliset teknologiat ja kehykset, joita voitaisiin käyttää arkkitehtuurin toteuttamiseen. Yleisenä periaatteena on parempi hyödyntää nykyisiä tekniikoita edellyttäen, että ne täyttävät riittävästi sekä toiminnalliset että ei-toiminnalliset vaatimukset. Kehys on toteutettu referenssiarkkitehtuuri, esim. JBoss on kehys, joka toteuttaa JEE-referenssiarkkitehtuurin. Seuraavat teknologiat ja kehykset ovat mielenkiintoisia, ja niitä tulisi harkita algoritmisen kaupankäyntijärjestelmän toteuttamisen yhteydessä: CUDA - NVidia on useita tuotteita, jotka tukevat korkean suorituskyvyn laskennallista rahoitusmallinnusta. Voidaan saavuttaa jopa 50x suorituskyvyn parannuksia suoritettaessa Monte Carlo-simulaatioita GPU: ssa prosessorin sijaan. Apache River - River on työkalu, joka kehittää hajautettuja järjestelmiä. Sitä on käytetty kehyksenä rakennushankkeille, jotka perustuvat SBA-malliin Apache Hadoop - siinä tapauksessa, että läpäisevä hakkuus on vaatimus, niin Hadoopin käyttö tarjoaa mielenkiintoisen ratkaisun isoin tietojärjestelmiin. Hadoopia voidaan käyttää CUDA-tekniikoita tukevassa klusteroituneessa ympäristössä. AlgoTrader - avoimen lähdekoodin algoritminen kaupankäyntialusta. AlgoTrader voitaisiin mahdollisesti sijoittaa automaattisten kauppiaskomponenttien sijaan. FIX Engine - itsenäinen sovellus, joka tukee FIX-, FAST - ja FIXatdl-tietojärjestelmiä (FIX). Vaikka tekniikka tai puitteet eivät olekaan, sovellusrajapinnalla (API) on rakennettava komponentteja järjestelmän ja sen komponenttien yhteentoimivuuden parantamiseksi. Päätelmä Ehdotettu arkkitehtuuri on suunniteltu vastaamaan hyvin yleisiä vaatimuksia, jotka on tunnistettu algoritmisille kaupankäyntijärjestelmille. Yleisesti ottaen algoritmiset kaupankäyntijärjestelmät ovat monimutkaisia ​​kolmella tekijällä, jotka vaihtelevat jokaisen toteutuksen suhteen: Ulkoisten yritys - ja vaihtojärjestelmien riippuvuudet Haastavat epäkuntoiset vaatimukset ja arkkitehtuurin rajoitteiden kehittyminen Ehdotettua ohjelmistorakennetta olisi siksi mukautettava tapauskohtaisesti, jotta Täyttämään erityiset organisaatio - ja sääntelyvaatimukset sekä ratkaisemaan alueelliset rajoitteet. Algoritmisen kaupankäyntijärjestelmän arkkitehtuuria tulisi pitää vain viitekehyksenä yksityishenkilöille ja organisaatioille, jotka haluavat suunnitella omia algoritmisia kaupankäyntijärjestelmiään. Jos haluat käyttää täydellistä kopiota ja lähteitä, lataa raportin kopio. Kiitos. Algo Trading - järjestelmässä on tosiasiallisesti vain kolme pääluokkaa. 1. Market Data Handler (esim. FAST-käsittelijä) 2. Strategia-moduuli (esim. CrossOver-strategia) 3. Tilausreitteri (esim. FIX-reititin) voit lisätä riskirajoituksia joko Strategy Module tai Order Router Module tai molemmat. Niin kauan sinun tietosi on oikea, sinun pitäisi olla hyvä mennä. Muista, että suunnittelet ATS: tä vähimmäisviiveeksi, ja lisäämällä kerroksia tai monimutkaisuutta tulee latenssin kustannuksiin. Minimaalinen ATS-arkkitehtuuri Ja jos lisäät kelloja ja pillejä, se näyttäisi seuraavalta: Jos olet kiinnostunut myös edellä mainitun arkkitehtuurin toteutuksesta, kannattaa pitää mielessä seuraavat asiat. Vältä lukkomuutoksia. Jos käytät sitä, yritä korvata ne lukittomilla rakenteilla atomien avulla. Saatavilla on useita kirjastoja lukittomiin tietorakenteisiin (esim. Libcds, concurrency-pakki jne.). C-11 tukee std :: atomia. Ja sinun tulisi myös pyrkiä käyttämään niitä. Vältä mitä QuickFIX: ssä on tehty. Sen kirjoitettu turvallisuusflexibilityreusability objekti (lukitus) luominen ja tuhoaminen tehdään jokaista kutsumusta tahansa viestin reitittimeen. Ei varmasti mitään mahdollisuutta kirjoittaa latenssiherkkiä koodeja. Ei runtime - muistin allokointia. Runtime-reitillä tulisi käyttää räätälöityä ja lukittumatonta muistinhallintaa ennalta varautuvalla muistiväylällä. Kaikki alustus voidaan tehdä konstruktoreissa. Tiukka kytkentä. Threading-malli, IO-malli ja muistinhallinta on suunniteltava yhteistyössä keskenään parhaimman yleisen suorituskyvyn saavuttamiseksi. Tämä on vastoin OOP-konseptia irrallisesta kytkimestä, mutta sen on välttämätöntä dynaamisen polymorfismin ajankäytön kustannusten välttämiseksi. Käytä mallipohjia. Samoin haluaisin myös ehdottaa, että tarkastelet C-mallintamista, jotta koodin joustavuus saavutettaisiin. OSHardware-optimointi: Lopuksi kannattaa työskennellä Linux RT - kernelin ja Solarflare-verkkokortin kanssa OpenOnLoad-ohjaimella, jotta saavutettaisiin vähimmäisviive. Voit edelleen etsiä eristää keskusyksikön ja suorittaa ohjelman kyseisellä ytimellä. Ja lopuksi julkinen sovellusliittymä, jonka sinun olisi osoitettava strategian kehittäjille. Haluaisin, että tämä olisi minimaalinen joukko, joka kattaisi tämän nimenomaisen tiedonvaihdon monimutkaisuuden. class OrderRouter public: virtuaalinen bool sendNewOrd (OrderInfo) 0 virtuaalinen bool sendRplOrd (OrderInfo) 0 virtuaalinen bool sendCxlOrd (OrderInfo) 0 virtualBut Tämä tarkoittaa, että OrderInfo-luokkaan on oltava KAIKKI kaikki kohde-vaihtoehdon edellyttämät tiedot. Yleensä vaihto vaatii samantyyppisiä tietoja, mutta kun menet ja tukenette lisää vaihtoja, huomaat, että lisäät lisää muuttujia tähän luokkaan. Seuraavassa on tärkeitä kysymyksiä, jotka sinun pitäisi kysyä itseltään: 1. Moniprosesiryhmäarkkitehtuuri tai monisäikeinen arkkitehtuuri. Onko rakentaa yksi monoliittinen prosessi useita kierteitä, tai kirjoittaa useita prosesseja. Monen prosessin kustannukset ovat sanoman kulumisen viive, kun taas moninkertaisen kierteitetyn yksittäisen prosessin kustannukset ovat, että jokin vika saattaa tuoda koko järjestelmän. 2. Viesti kulkee: kun valitset lukuisista vaihtoehdoista, rajoitatte viivästyskysymystä. Nopein IPC olisi yhteinen muisti, mutta miten sitten synkronointi viettää aikaa näillä kahdella kysymyksellä, koska ne olisivat rakennusosaa, jolla arkkitehtuuresi on. Muokkaa: FIX ja FAST Suositeltavaa standardiprotokollaa varten FIX lähettää tilauksia ja FAST on markkinoiden tietoja. Sanottiin, että useimmilla pörsseillä on oma natiiviprotokolla, joka on nopeampi kuin FIX, koska FIX on yleensä toteutettu alkuperäisen protokollansa päälle. Mutta he edelleen tukevat FIX lisää käyttöönoton nopeutta. Toisaalta, kun suurin osa pörsseistä käyttää FIXiä, FAST ei ole niin laajaa hyväksyntää. Jos mitään, olisi muutama kourallinen vaihtoa. Useimmat heistä joko lähettävät FIX: n itsensä (alhainen latenssi) tai käyttävät omaa kotimaista binaariprotokollaansa. esim. Intiassa, NSE: ssä, BSE: ssa ja MCXMCXSX: ssa kaikki kolme vaihtoa tarjoavat FIX-protokollan alkuperäisen protokollan lisäksi, mutta vain BSE antaa sinulle FAST-markkinoiden tietoja. Ja se on myös siirtymässä FAST: stä natiiviin EOBI: n käyttöönotolla. Voit ekstrapoloida saman asian muille vaihtoehdoille. 3.9k Näkymät middot View Upsotit middot Ei kopiointia varten Kuten John mainitsi, OMS on minkä tahansa kaupankäynnin alustan ydin ja sinun pitäisi alkaa tutkia sitä. Sinun tarvitsee viettää aikaa määritellä kaupankäynnin elinkaari, tapahtumat ja ominaisuudet, jotka haluat upottaa OMS: ään, ja ne, joita haluat Algo Engine - yrityksesi hoitaa. Metcetera offers an open source OMS, I haven039t used it personally but it039s one of the few in the market. The next thing you should look at is providing an interface to source data in and push it out. This is for a client order entry system to throw in the order details and Algo engine to source it. A lot of Sell Side OMS039s use a combination of proprietary programs written in JavaC using FIX. FIX protocol allows you to communicate realtime across systems in a simplified amp pre-defined message format laid down by the FIX protocol community. Go to The FIX Protocol Organization gt Home page to read more about it. Also looks at Open Source FIX Engine. an open source implementation of the FIX engine. Next comes a Market Data interface to source realtime time security market information, data ranging from HighLowOpenClose to Best BidBest Ask, Total traded volume, Last price, Last volume, Bid quotes, Ask quotes etc. The information you seek really depends upon the type of strategy you wish to implement. I believe Interactive Broker provides a realtime data feed via FIX. Exchange connectivity is next where your Algo interprets the signals, create an order and routes to an Exchange or ECN. Developing it in-house could be tough as you would need to work out Exchange membership, certify your platform and pay a regular membership fee. A cheaper way is to use a broker API (like IB) and route the order through them. Historical data is of essence too as you might want to compare the current market behavior with its historical values. Parameters like average spread, VWAP profiles, average daily volume etc may be required to influence decision making. You can have it on database (preferred) but if speed of the essence then download it on the server cache when you begin your program. Once your peripheral systems are setup, you can start developing your algo program the way you want it to work. This basic infrastructure would allow you to input a parent algo order, read market data, react to the signals but generating child orders and placing it on the exchange order book and historical data to influence decision making. The OMS holds the linkage between the parent amp child order, their realtime statuses and updates by the algo or exchange connectivity platform. What you want to implement inside the Algo is completely up to you. 2.3k Views middot View Upvotes middot Not for ReproductionBest Programming Language for Algorithmic Trading Systems One of the most frequent questions I receive in the QS mailbag is What is the best programming language for algorithmic trading. The short answer is that there is no best language. Strategy parameters, performance, modularity, development, resiliency and cost must all be considered. This article will outline the necessary components of an algorithmic trading system architecture and how decisions regarding implementation affect the choice of language. Firstly, the major components of an algorithmic trading system will be considered, such as the research tools, portfolio optimiser, risk manager and execution engine. Subsequently, different trading strategies will be examined and how they affect the design of the system. In particular the frequency of trading and the likely trading volume will both be discussed. Once the trading strategy has been selected, it is necessary to architect the entire system. This includes choice of hardware, the operating system(s) and system resiliency against rare, potentially catastrophic events. While the architecture is being considered, due regard must be paid to performance - both to the research tools as well as the live execution environment. What Is The Trading System Trying To Do Before deciding on the best language with which to write an automated trading system it is necessary to define the requirements. Is the system going to be purely execution based Will the system require a risk management or portfolio construction module Will the system require a high-performance backtester For most strategies the trading system can be partitioned into two categories: Research and signal generation. Research is concerned with evaluation of a strategy performance over historical data. The process of evaluating a trading strategy over prior market data is known as backtesting . The data size and algorithmic complexity will have a big impact on the computational intensity of the backtester. CPU speed and concurrency are often the limiting factors in optimising research execution speed. Signal generation is concerned with generating a set of trading signals from an algorithm and sending such orders to the market, usually via a brokerage. For certain strategies a high level of performance is required. IO issues such as network bandwidth and latency are often the limiting factor in optimising execution systems. Thus the choice of languages for each component of your entire system may be quite different. Type, Frequency and Volume of Strategy The type of algorithmic strategy employed will have a substantial impact on the design of the system. It will be necessary to consider the markets being traded, the connectivity to external data vendors, the frequency and volume of the strategy, the trade-off between ease of development and performance optimisation, as well as any custom hardware, including co-located custom servers, GPUs or FPGAs that might be necessary. The technology choices for a low-frequency US equities strategy will be vastly different from those of a high-frequency statistical arbitrage strategy trading on the futures market. Prior to the choice of language many data vendors must be evaluated that pertain to a the strategy at hand. It will be necessary to consider connectivity to the vendor, structure of any APIs, timeliness of the data, storage requirements and resiliency in the face of a vendor going offline. It is also wise to possess rapid access to multiple vendors Various instruments all have their own storage quirks, examples of which include multiple ticker symbols for equities and expiration dates for futures (not to mention any specific OTC data). This needs to be factored in to the platform design. Frequency of strategy is likely to be one of the biggest drivers of how the technology stack will be defined. Strategies employing data more frequently than minutely or secondly bars require significant consideration with regards to performance. A strategy exceeding secondly bars (i. e. tick data) leads to a performance driven design as the primary requirement. For high frequency strategies a substantial amount of market data will need to be stored and evaluated. Software such as HDF5 or kdb are commonly used for these roles. In order to process the extensive volumes of data needed for HFT applications, an extensively optimised backtester and execution system must be used. CC (possibly with some assembler) is likely to the strongest language candidate. Ultra-high frequency strategies will almost certainly require custom hardware such as FPGAs, exchange co-location and kernalnetwork interface tuning. Research Systems Research systems typically involve a mixture of interactive development and automated scripting. The former often takes place within an IDE such as Visual Studio, MatLab or R Studio. The latter involves extensive numerical calculations over numerous parameters and data points. This leads to a language choice providing a straightforward environment to test code, but also provides sufficient performance to evaluate strategies over multiple parameter dimensions. Typical IDEs in this space include Microsoft Visual CC, which contains extensive debugging utilities, code completion capabilities (via Intellisense) and straightforward overviews of the entire project stack (via the database ORM, LINQ ) MatLab. which is designed for extensive numerical linear algebra and vectorised operations, but in an interactive console manner R Studio. which wraps the R statistical language console in a fully-fledged IDE Eclipse IDE for Linux Java and C and semi-proprietary IDEs such as Enthought Canopy for Python, which include data analysis libraries such as NumPy. SciPy. scikit-learn and pandas in a single interactive (console) environment. For numerical backtesting, all of the above languages are suitable, although it is not necessary to utilise a GUIIDE as the code will be executed in the background. The prime consideration at this stage is that of execution speed. A compiled language (such as C) is often useful if the backtesting parameter dimensions are large. Remember that it is necessary to be wary of such systems if that is the case Interpreted languages such as Python often make use of high-performance libraries such as NumPypandas for the backtesting step, in order to maintain a reasonable degree of competitiveness with compiled equivalents. Ultimately the language chosen for the backtesting will be determined by specific algorithmic needs as well as the range of libraries available in the language (more on that below). However, the language used for the backtester and research environments can be completely independent of those used in the portfolio construction, risk management and execution components, as will be seen. Portfolio Construction and Risk Management The portfolio construction and risk management components are often overlooked by retail algorithmic traders. This is almost always a mistake. These tools provide the mechanism by which capital will be preserved. They not only attempt to alleviate the number of risky bets, but also minimise churn of the trades themselves, reducing transaction costs. Sophisticated versions of these components can have a significant effect on the quality and consistentcy of profitability. It is straightforward to create a stable of strategies as the portfolio construction mechanism and risk manager can easily be modified to handle multiple systems. Thus they should be considered essential components at the outset of the design of an algorithmic trading system. The job of the portfolio construction system is to take a set of desired trades and produce the set of actual trades that minimise churn, maintain exposures to various factors (such as sectors, asset classes, volatility etc) and optimise the allocation of capital to various strategies in a portfolio. Portfolio construction often reduces to a linear algebra problem (such as a matrix factorisation) and hence performance is highly dependent upon the effectiveness of the numerical linear algebra implementation available. Common libraries include uBLAS. LAPACK and NAG for C. MatLab also possesses extensively optimised matrix operations. Python utilises NumPySciPy for such computations. A frequently rebalanced portfolio will require a compiled (and well optimised) matrix library to carry this step out, so as not to bottleneck the trading system. Risk management is another extremely important part of an algorithmic trading system. Risk can come in many forms: Increased volatility (although this may be seen as desirable for certain strategies), increased correlations between asset classes, counter-party default, server outages, black swan events and undetected bugs in the trading code, to name a few. Risk management components try and anticipate the effects of excessive volatility and correlation between asset classes and their subsequent effect(s) on trading capital. Often this reduces to a set of statistical computations such as Monte Carlo stress tests. This is very similar to the computational needs of a derivatives pricing engine and as such will be CPU-bound. These simulations are highly parallelisable (see below) and, to a certain degree, it is possible to throw hardware at the problem. Execution Systems The job of the execution system is to receive filtered trading signals from the portfolio construction and risk management components and send them on to a brokerage or other means of market access. For the majority of retail algorithmic trading strategies this involves an API or FIX connection to a brokerage such as Interactive Brokers. The primary considerations when deciding upon a language include quality of the API, language-wrapper availability for an API, execution frequency and the anticipated slippage. The quality of the API refers to how well documented it is, what sort of performance it provides, whether it needs standalone software to be accessed or whether a gateway can be established in a headless fashion (i. e. no GUI). In the case of Interactive Brokers, the Trader WorkStation tool needs to be running in a GUI environment in order to access their API. I once had to install a Desktop Ubuntu edition onto an Amazon cloud server to access Interactive Brokers remotely, purely for this reason Most APIs will provide a C andor Java interface. It is usually up to the community to develop language-specific wrappers for C, Python, R, Excel and MatLab. Note that with every additional plugin utilised (especially API wrappers) there is scope for bugs to creep into the system. Always test plugins of this sort and ensure they are actively maintained. A worthwhile gauge is to see how many new updates to a codebase have been made in recent months. Execution frequency is of the utmost importance in the execution algorithm. Note that hundreds of orders may be sent every minute and as such performance is critical. Slippage will be incurred through a badly-performing execution system and this will have a dramatic impact on profitability. Statically-typed languages (see below) such as CJava are generally optimal for execution but there is a trade-off in development time, testing and ease of maintenance. Dynamically-typed languages, such as Python and Perl are now generally fast enough. Always make sure the components are designed in a modular fashion (see below) so that they can be swapped out out as the system scales. Architectural Planning and Development Process The components of a trading system, its frequency and volume requirements have been discussed above, but system infrastructure has yet to be covered. Those acting as a retail trader or working in a small fund will likely be wearing many hats. It will be necessary to be covering the alpha model, risk management and execution parameters, and also the final implementation of the system. Before delving into specific languages the design of an optimal system architecture will be discussed. Separation of Concerns One of the most important decisions that must be made at the outset is how to separate the concerns of a trading system. In software development, this essentially means how to break up the different aspects of the trading system into separate modular components. By exposing interfaces at each of the components it is easy to swap out parts of the system for other versions that aid performance, reliability or maintenance, without modifying any external dependency code. This is the best practice for such systems. For strategies at lower frequencies such practices are advised. For ultra high frequency trading the rulebook might have to be ignored at the expense of tweaking the system for even more performance. A more tightly coupled system may be desirable. Creating a component map of an algorithmic trading system is worth an article in itself. However, an optimal approach is to make sure there are separate components for the historical and real-time market data inputs, data storage, data access API, backtester, strategy parameters, portfolio construction, risk management and automated execution systems. For instance, if the data store being used is currently underperforming, even at significant levels of optimisation, it can be swapped out with minimal rewrites to the data ingestion or data access API. As far the as the backtester and subsequent components are concerned, there is no difference. Another benefit of separated components is that it allows a variety of programming languages to be used in the overall system. There is no need to be restricted to a single language if the communication method of the components is language independent. This will be the case if they are communicating via TCPIP, ZeroMQ or some other language-independent protocol. As a concrete example, consider the case of a backtesting system being written in C for number crunching performance, while the portfolio manager and execution systems are written in Python using SciPy and IBPy . Performance Considerations Performance is a significant consideration for most trading strategies. For higher frequency strategies it is the most important factor. Performance covers a wide range of issues, such as algorithmic execution speed, network latency, bandwidth, data IO, concurrencyparallelism and scaling. Each of these areas are individually covered by large textbooks, so this article will only scratch the surface of each topic. Architecture and language choice will now be discussed in terms of their effects on performance. The prevailing wisdom as stated by Donald Knuth. one of the fathers of Computer Science, is that premature optimisation is the root of all evil. This is almost always the case - except when building a high frequency trading algorithm For those who are interested in lower frequency strategies, a common approach is to build a system in the simplest way possible and only optimise as bottlenecks begin to appear. Profiling tools are used to determine where bottlenecks arise. Profiles can be made for all of the factors listed above, either in a MS Windows or Linux environment. There are many operating system and language tools available to do so, as well as third party utilities. Language choice will now be discussed in the context of performance. C, Java, Python, R and MatLab all contain high-performance libraries (either as part of their standard or externally) for basic data structure and algorithmic work. C ships with the Standard Template Library, while Python contains NumPySciPy. Common mathematical tasks are to be found in these libraries and it is rarely beneficial to write a new implementation. One exception is if highly customised hardware architecture is required and an algorithm is making extensive use of proprietary extensions (such as custom caches). However, often reinvention of the wheel wastes time that could be better spent developing and optimising other parts of the trading infrastructure. Development time is extremely precious especially in the context of sole developers. Latency is often an issue of the execution system as the research tools are usually situated on the same machine. For the former, latency can occur at multiple points along the execution path. Databases must be consulted (disknetwork latency), signals must be generated (operating syste, kernal messaging latency), trade signals sent (NIC latency) and orders processed (exchange systems internal latency). For higher frequency operations it is necessary to become intimately familiar with kernal optimisation as well as optimisation of network transmission. This is a deep area and is significantly beyond the scope of the article but if an UHFT algorithm is desired then be aware of the depth of knowledge required Caching is very useful in the toolkit of a quantitative trading developer. Caching refers to the concept of storing frequently accessed data in a manner which allows higher-performance access, at the expense of potential staleness of the data. A common use case occurs in web development when taking data from a disk-backed relational database and putting it into memory. Any subsequent requests for the data do not have to hit the database and so performance gains can be significant. For trading situations caching can be extremely beneficial. For instance, the current state of a strategy portfolio can be stored in a cache until it is rebalanced, such that the list doesnt need to be regenerated upon each loop of the trading algorithm. Such regeneration is likely to be a high CPU or disk IO operation. However, caching is not without its own issues. Regeneration of cache data all at once, due to the volatilie nature of cache storage, can place significant demand on infrastructure. Another issue is dog-piling . where multiple generations of a new cache copy are carried out under extremely high load, which leads to cascade failure. Dynamic memory allocation is an expensive operation in software execution. Thus it is imperative for higher performance trading applications to be well-aware how memory is being allocated and deallocated during program flow. Newer language standards such as Java, C and Python all perform automatic garbage collection . which refers to deallocation of dynamically allocated memory when objects go out of scope . Garbage collection is extremely useful during development as it reduces errors and aids readability. However, it is often sub-optimal for certain high frequency trading strategies. Custom garbage collection is often desired for these cases. In Java, for instance, by tuning the garbage collector and heap configuration, it is possible to obtain high performance for HFT strategies. C doesnt provide a native garbage collector and so it is necessary to handle all memory allocationdeallocation as part of an objects implementation. While potentially error prone (potentially leading to dangling pointers) it is extremely useful to have fine-grained control of how objects appear on the heap for certain applications. When choosing a language make sure to study how the garbage collector works and whether it can be modified to optimise for a particular use case. Many operations in algorithmic trading systems are amenable to parallelisation . This refers to the concept of carrying out multiple programmatic operations at the same time, i. e in parallel. So-called embarassingly parallel algorithms include steps that can be computed fully independently of other steps. Certain statistical operations, such as Monte Carlo simulations, are a good example of embarassingly parallel algorithms as each random draw and subsequent path operation can be computed without knowledge of other paths. Other algorithms are only partially parallelisable. Fluid dynamics simulations are such an example, where the domain of computation can be subdivided, but ultimately these domains must communicate with each other and thus the operations are partially sequential. Parallelisable algorithms are subject to Amdahls Law. which provides a theoretical upper limit to the performance increase of a parallelised algorithm when subject to N separate processes (e. g. on a CPU core or thread ). Parallelisation has become increasingly important as a means of optimisation since processor clock-speeds have stagnated, as newer processors contain many cores with which to perform parallel calculations. The rise of consumer graphics hardware (predominently for video games) has lead to the development of Graphical Processing Units (GPUs), which contain hundreds of cores for highly concurrent operations. Such GPUs are now very affordable. High-level frameworks, such as Nvidias CUDA have lead to widespread adoption in academia and finance. Such GPU hardware is generally only suitable for the research aspect of quantitative finance, whereas other more specialised hardware (including Field-Programmable Gate Arrays - FPGAs) are used for (U)HFT. Nowadays, most modern langauges support a degree of concurrencymultithreading. Thus it is straightforward to optimise a backtester, since all calculations are generally independent of the others. Scaling in software engineering and operations refers to the ability of the system to handle consistently increasing loads in the form of greater requests, higher processor usage and more memory allocation. In algorithmic trading a strategy is able to scale if it can accept larger quantities of capital and still produce consistent returns. The trading technology stack scales if it can endure larger trade volumes and increased latency, without bottlenecking . While systems must be designed to scale, it is often hard to predict beforehand where a bottleneck will occur. Rigourous logging, testing, profiling and monitoring will aid greatly in allowing a system to scale. Languages themselves are often described as unscalable. This is usually the result of misinformation, rather than hard fact. It is the total technology stack that should be ascertained for scalability, not the language. Clearly certain languages have greater performance than others in particular use cases, but one language is never better than another in every sense. One means of managing scale is to separate concerns, as stated above. In order to further introduce the ability to handle spikes in the system (i. e. sudden volatility which triggers a raft of trades), it is useful to create a message queuing architecture. This simply means placing a message queue system between components so that orders are stacked up if a certain component is unable to process many requests. Rather than requests being lost they are simply kept in a stack until the message is handled. This is particularly useful for sending trades to an execution engine. If the engine is suffering under heavy latency then it will back up trades. A queue between the trade signal generator and the execution API will alleviate this issue at the expense of potential trade slippage. A well-respected open source message queue broker is RabbitMQ . Hardware and Operating Systems The hardware running your strategy can have a significant impact on the profitability of your algorithm. This is not an issue restricted to high frequency traders either. A poor choice in hardware and operating system can lead to a machine crash or reboot at the most inopportune moment. Thus it is necessary to consider where your application will reside. The choice is generally between a personal desktop machine, a remote server, a cloud provider or an exchange co-located server. Desktop machines are simple to install and administer, especially with newer user friendly operating systems such as Windows 78, Mac OSX and Ubuntu. Desktop systems do possess some significant drawbacks, however. The foremost is that the versions of operating systems designed for desktop machines are likely to require rebootspatching (and often at the worst of times). They also use up more computational resources by the virtue of requiring a graphical user interface (GUI). Utilising hardware in a home (or local office) environment can lead to internet connectivity and power uptime problems. The main benefit of a desktop system is that significant computational horsepower can be purchased for the fraction of the cost of a remote dedicated server (or cloud based system) of comparable speed. A dedicated server or cloud-based machine, while often more expensive than a desktop option, allows for more significant redundancy infrastructure, such as automated data backups, the ability to more straightforwardly ensure uptime and remote monitoring. They are harder to administer since they require the ability to use remote login capabilities of the operating system. In Windows this is generally via the GUI Remote Desktop Protocol (RDP). In Unix-based systems the command-line Secure SHell (SSH) is used. Unix-based server infrastructure is almost always command-line based which immediately renders GUI-based programming tools (such as MatLab or Excel) to be unusable. A co-located server, as the phrase is used in the capital markets, is simply a dedicated server that resides within an exchange in order to reduce latency of the trading algorithm. This is absolutely necessary for certain high frequency trading strategies, which rely on low latency in order to generate alpha. The final aspect to hardware choice and the choice of programming language is platform-independence. Is there a need for the code to run across multiple different operating systems Is the code designed to be run on a particular type of processor architecture, such as the Intel x86x64 or will it be possible to execute on RISC processors such as those manufactured by ARM These issues will be highly dependent upon the frequency and type of strategy being implemented. Resilience and Testing One of the best ways to lose a lot of money on algorithmic trading is to create a system with no resiliency . This refers to the durability of the sytem when subject to rare events, such as brokerage bankruptcies, sudden excess volatility, region-wide downtime for a cloud server provider or the accidental deletion of an entire trading database. Years of profits can be eliminated within seconds with a poorly-designed architecture. It is absolutely essential to consider issues such as debuggng, testing, logging, backups, high-availability and monitoring as core components of your system. It is likely that in any reasonably complicated custom quantitative trading application at least 50 of development time will be spent on debugging, testing and maintenance. Nearly all programming languages either ship with an associated debugger or possess well-respected third-party alternatives. In essence, a debugger allows execution of a program with insertion of arbitrary break points in the code path, which temporarily halt execution in order to investigate the state of the system. The main benefit of debugging is that it is possible to investigate the behaviour of code prior to a known crash point . Debugging is an essential component in the toolbox for analysing programming errors. However, they are more widely used in compiled languages such as C or Java, as interpreted languages such as Python are often easier to debug due to fewer LOC and less verbose statements. Despite this tendency Python does ship with the pdb. which is a sophisticated debugging tool. The Microsoft Visual C IDE possesses extensive GUI debugging utilities, while for the command line Linux C programmer, the gdb debugger exists. Testing in software development refers to the process of applying known parameters and results to specific functions, methods and objects within a codebase, in order to simulate behaviour and evaluate multiple code-paths, helping to ensure that a system behaves as it should. A more recent paradigm is known as Test Driven Development (TDD), where test code is developed against a specified interface with no implementation. Prior to the completion of the actual codebase all tests will fail. As code is written to fill in the blanks, the tests will eventually all pass, at which point development should cease. TDD requires extensive upfront specification design as well as a healthy degree of discipline in order to carry out successfully. In C, Boost provides a unit testing framework. In Java, the JUnit library exists to fulfill the same purpose. Python also has the unittest module as part of the standard library. Many other languages possess unit testing frameworks and often there are multiple options. In a production environment, sophisticated logging is absolutely essential. Logging refers to the process of outputting messages, with various degrees of severity, regarding execution behaviour of a system to a flat file or database. Logs are a first line of attack when hunting for unexpected program runtime behaviour. Unfortunately the shortcomings of a logging system tend only to be discovered after the fact As with backups discussed below, a logging system should be given due consideration BEFORE a system is designed. Both Microsoft Windows and Linux come with extensive system logging capability and programming languages tend to ship with standard logging libraries that cover most use cases. It is often wise to centralise logging information in order to analyse it at a later date, since it can often lead to ideas about improving performance or error reduction, which will almost certainly have a positive impact on your trading returns. While logging of a system will provide information about what has transpired in the past, monitoring of an application will provide insight into what is happening right now . All aspects of the system should be considered for monitoring. System level metrics such as disk usage, available memory, network bandwidth and CPU usage provide basic load information. Trading metrics such as abnormal pricesvolume, sudden rapid drawdowns and account exposure for different sectorsmarkets should also be continuously monitored. Further, a threshold system should be instigated that provides notification when certain metrics are breached, elevating the notification method (email, SMS, automated phone call) depending upon the severity of the metric. System monitoring is often the domain of the system administrator or operations manager. However, as a sole trading developer, these metrics must be established as part of the larger design. Many solutions for monitoring exist: proprietary, hosted and open source, which allow extensive customisation of metrics for a particular use case. Backups and high availability should be prime concerns of a trading system. Consider the following two questions: 1) If an entire production database of market data and trading history was deleted (without backups) how would the research and execution algorithm be affected 2) If the trading system suffers an outage for an extended period (with open positions) how would account equity and ongoing profitability be affected The answers to both of these questions are often sobering It is imperative to put in place a system for backing up data and also for testing the restoration of such data. Many individuals do not test a restore strategy. If recovery from a crash has not been tested in a safe environment, what guarantees exist that restoration will be available at the worst possible moment Similarly, high availability needs to be baked in from the start. Redundant infrastructure (even at additional expense) must always be considered, as the cost of downtime is likely to far outweigh the ongoing maintenance cost of such systems. I wont delve too deeply into this topic as it is a large area, but make sure it is one of the first considerations given to your trading system. Choosing a Language Considerable detail has now been provided on the various factors that arise when developing a custom high-performance algorithmic trading system. The next stage is to discuss how programming languages are generally categorised. Type Systems When choosing a language for a trading stack it is necessary to consider the type system . The languages which are of interest for algorithmic trading are either statically - or dynamically-typed . A statically-typed language performs checks of the types (e. g. integers, floats, custom classes etc) during the compilation process. Such languages include C and Java. A dynamically-typed language performs the majority of its type-checking at runtime. Such languages include Python, Perl and JavaScript. For a highly numerical system such as an algorithmic trading engine, type-checking at compile time can be extremely beneficial, as it can eliminate many bugs that would otherwise lead to numerical errors. However, type-checking doesnt catch everything, and this is where exception handling comes in due to the necessity of having to handle unexpected operations. Dynamic languages (i. e. those that are dynamically-typed) can often lead to run-time errors that would otherwise be caught with a compilation-time type-check. For this reason, the concept of TDD (see above) and unit testing arose which, when carried out correctly, often provides more safety than compile-time checking alone. Another benefit of statically-typed languages is that the compiler is able to make many optimisations that are otherwise unavailable to the dynamically - typed language, simply because the type (and thus memory requirements) are known at compile-time. In fact, part of the inefficiency of many dynamically-typed languages stems from the fact that certain objects must be type-inspected at run-time and this carries a performance hit. Libraries for dynamic languages, such as NumPySciPy alleviate this issue due to enforcing a type within arrays. Open Source or Proprietary One of the biggest choices available to an algorithmic trading developer is whether to use proprietary (commercial) or open source technologies. There are advantages and disadvantages to both approaches. It is necessary to consider how well a language is supported, the activity of the community surrounding a language, ease of installation and maintenance, quality of the documentation and any licensingmaintenance costs. The Microsoft stack (including Visual C, Visual C) and MathWorks MatLab are two of the larger proprietary choices for developing custom algorithmic trading software. Both tools have had significant battle testing in the financial space, with the former making up the predominant software stack for investment banking trading infrastructure and the latter being heavily used for quantitative trading research within investment funds. Microsoft and MathWorks both provide extensive high quality documentation for their products. Further, the communities surrounding each tool are very large with active web forums for both. The software allows cohesive integration with multiple languages such as C, C and VB, as well as easy linkage to other Microsoft products such as the SQL Server database via LINQ. MatLab also has many pluginslibraries (some free, some commercial) for nearly any quantitative research domain. There are also drawbacks. With either piece of software the costs are not insignificant for a lone trader (although Microsoft does provide entry-level version of Visual Studio for free). Microsoft tools play well with each other, but integrate less well with external code. Visual Studio must also be executed on Microsoft Windows, which is arguably far less performant than an equivalent Linux server which is optimally tuned. MatLab also lacks a few key plugins such as a good wrapper around the Interactive Brokers API, one of the few brokers amenable to high-performance algorithmic trading. The main issue with proprietary products is the lack of availability of the source code. This means that if ultra performance is truly required, both of these tools will be far less attractive. Open source tools have been industry grade for sometime. Much of the alternative asset space makes extensive use of open-source Linux, MySQLPostgreSQL, Python, R, C and Java in high-performance production roles. However, they are far from restricted to this domain. Python and R, in particular, contain a wealth of extensive numerical libraries for performing nearly any type of data analysis imaginable, often at execution speeds comparable to compiled languages, with certain caveats. The main benefit of using interpreted languages is the speed of development time. Python and R require far fewer lines of code (LOC) to achieve similar functionality, principally due to the extensive libraries. Further, they often allow interactive console based development, rapidly reducing the iterative development process. Given that time as a developer is extremely valuable, and execution speed often less so (unless in the HFT space), it is worth giving extensive consideration to an open source technology stack. Python and R possess significant development communities and are extremely well supported, due to their popularity. Documentation is excellent and bugs (at least for core libraries) remain scarce. Open source tools often suffer from a lack of a dedicated commercial support contract and run optimally on systems with less-forgiving user interfaces. A typical Linux server (such as Ubuntu) will often be fully command-line oriented. In addition, Python and R can be slow for certain execution tasks. There are mechanisms for integrating with C in order to improve execution speeds, but it requires some experience in multi-language programming. While proprietary software is not immune from dependencyversioning issues it is far less common to have to deal with incorrect library versions in such environments. Open source operating systems such as Linux can be trickier to administer. I will venture my personal opinion here and state that I build all of my trading tools with open source technologies. In particular I use: Ubuntu, MySQL, Python, C and R. The maturity, community size, ability to dig deep if problems occur and lower total cost ownership (TCO) far outweigh the simplicity of proprietary GUIs and easier installations. Having said that, Microsoft Visual Studio (especially for C) is a fantastic Integrated Development Environment (IDE) which I would also highly recommend. Batteries Included The header of this section refers to the out of the box capabilities of the language - what libraries does it contain and how good are they This is where mature languages have an advantage over newer variants. C, Java and Python all now possess extensive libraries for network programming, HTTP, operating system interaction, GUIs, regular expressions (regex), iteration and basic algorithms. C is famed for its Standard Template Library (STL) which contains a wealth of high performance data structures and algorithms for free. Python is known for being able to communicate with nearly any other type of systemprotocol (especially the web), mostly through its own standard library. R has a wealth of statistical and econometric tools built in, while MatLab is extremely optimised for any numerical linear algebra code (which can be found in portfolio optimisation and derivatives pricing, for instance). Outside of the standard libraries, C makes use of the Boost library, which fills in the missing parts of the standard library. In fact, many parts of Boost made it into the TR1 standard and subsequently are available in the C11 spec, including native support for lambda expressions and concurrency. Python has the high performance NumPySciPyPandas data analysis library combination, which has gained widespread acceptance for algorithmic trading research. Further, high-performance plugins exist for access to the main relational databases, such as MySQL (MySQLC), JDBC (JavaMatLab), MySQLdb (MySQLPython) and psychopg2 (PostgreSQLPython). Python can even communicate with R via the RPy plugin An often overlooked aspect of a trading system while in the initial research and design stage is the connectivity to a broker API. Most APIs natively support C and Java, but some also support C and Python, either directly or with community-provided wrapper code to the C APIs. In particular, Interactive Brokers can be connected to via the IBPy plugin. If high-performance is required, brokerages will support the FIX protocol . Conclusion As is now evident, the choice of programming language(s) for an algorithmic trading system is not straightforward and requires deep thought. The main considerations are performance, ease of development, resiliency and testing, separation of concerns, familiarity, maintenance, source code availability, licensing costs and maturity of libraries. The benefit of a separated architecture is that it allows languages to be plugged in for different aspects of a trading stack, as and when requirements change. A trading system is an evolving tool and it is likely that any language choices will evolve along with it. Just Getting Started with Quantitative Trading

No comments:

Post a Comment