Monday 7 August 2017

Membangun otomatis trading systems java


Sebagai seorang ilmuwan komputer sejati, Anda berada pada posisi sempurna untuk memulai trading algoritmik. Ini adalah sesuatu yang saya saksikan langsung di Quantiacs1. Dimana para ilmuwan dan insinyur dapat terjun langsung ke perdagangan otomatis tanpa pengalaman sebelumnya. Dengan kata lain, pemrograman daging merupakan bahan utama yang dibutuhkan untuk memulai. Untuk mendapatkan pemahaman umum tentang tantangan apa yang menanti Anda setelah membuat sistem perdagangan algoritmik, lihat pos Quora ini. Membangun sistem perdagangan dari bawah ke atas akan memerlukan beberapa pengetahuan latar belakang, platform perdagangan, data pasar, dan akses pasar. Meskipun bukan keharusan, memilih platform perdagangan tunggal yang menyediakan sebagian besar sumber daya ini akan membantu Anda mempercepat kecepatan. Yang sedang berkata, keterampilan yang Anda kembangkan akan dapat dialihkan ke bahasa pemrograman dan hampir semua platform. Percaya atau tidak, membangun strategi trading otomatis tidak didasarkan pada menjadi ahli pasar. Meskipun demikian, belajar mekanika pasar dasar akan membantu Anda menemukan strategi perdagangan yang menguntungkan. Pilihan, Futures, dan Derivat Lainnya oleh John C. Hull - Buku pertama yang bagus untuk memasuki keuangan kuantitatif, dan mendekati dari sisi matematika. Quantitative Trading oleh Ernie Chan - Ernie Chan memberikan buku pengantar terbaik untuk perdagangan kuantitatif dan menuntun Anda melalui proses pembuatan algoritma perdagangan di MATLAB dan Excel. Trading Algoritma Futures via Machine Learning - Rincian 5 halaman untuk menerapkan model pembelajaran mesin sederhana ke indikator analisis teknis yang umum digunakan. Heres sebuah daftar bacaan gabungan PDF dengan rincian lengkap dari buku, video, kursus, dan forum perdagangan. Cara terbaik untuk belajar adalah dengan melakukan, dan dalam kasus perdagangan otomatis yang turun ke charting dan coding. Titik awal yang baik adalah contoh sistem perdagangan yang ada dan teknik analisis teknik pameran yang ada. Selain itu, seorang ilmuwan komputer terampil memiliki keunggulan tambahan untuk dapat menerapkan pembelajaran mesin ke perdagangan algoritmik. Berikut adalah beberapa sumber daya tersebut: TradingView - Platform grafik visual yang fantastis dengan sendirinya, TradingView adalah taman bermain yang bagus untuk merasa nyaman dengan analisis teknis. Ini memiliki manfaat tambahan untuk memungkinkan Anda membuat strategi perdagangan naskah dan melihat gagasan perdagangan orang lain. Forum Perdagangan Otomatis - Komunitas online yang hebat untuk mengeposkan pertanyaan pemula dan menemukan jawaban atas masalah ku yang umum saat memulai. Forum kuota adalah tempat yang tepat untuk direndam dalam strategi, alat, dan teknik. Seminar YouTube tentang ide trading dengan contoh kode kerja di Github. Pembelajaran Mesin: Presentasi lebih banyak tentang perdagangan otomatis dapat ditemukan di Quantiacs Quant Club. Kebanyakan orang dari latar belakang ilmiah (entah itu ilmu komputer atau teknik) telah terpapar Python atau MATLAB, yang merupakan bahasa populer untuk keuangan kuantitatif. Quantiacs telah menciptakan kotak peralatan open source yang menyediakan backtesting dan 15 tahun data pasar historis secara gratis. Bagian yang terbaik adalah semuanya dibangun di atas kedua Python dan MATLAB yang memberi Anda pilihan untuk mengembangkan sistem Anda. Heres contoh tren-mengikuti strategi trading di MATLAB. Ini semua adalah kode yang dibutuhkan untuk menjalankan sistem perdagangan otomatis, yang menampilkan kekuatan MATLAB dan Quantiacs Toolbox. Quantiacs memungkinkan Anda menukar 44 futures dan semua saham dari SampP 500. Selain itu, berbagai perpustakaan tambahan seperti TensorFlow didukung. (Penafian: Saya bekerja di Quantiacs) Setelah Anda siap menghasilkan uang secara kuantitatif, Anda dapat mengikuti kontes perdagangan otomatis Quantiacs terbaru, dengan total 2.250.000 investasi tersedia: Dapatkah Anda bersaing dengan quants terbaik 28.4k Views middot View Upvotes Middot Tidak untuk Reproduksi Jawaban ini telah sepenuhnya ditulis ulang Berikut adalah 6 basis pengetahuan utama untuk membangun sistem perdagangan algoritmik. Anda harus berkenalan dengan mereka semua untuk membangun sistem perdagangan yang efektif. Beberapa istilah yang digunakan mungkin sedikit teknis, namun Anda harus bisa memahaminya dengan Googling. Catatan: (Sebagian besar) ini tidak berlaku jika Anda ingin melakukan Perdagangan Frekuensi Tinggi 1. Teori Pasar Anda perlu memahami bagaimana pasar bekerja. Lebih khusus lagi, Anda harus memahami inefisiensi pasar, hubungan antara aset yang berbeda dengan produk dan perilaku harga. Gagasan perdagangan berasal dari inefisiensi pasar. Anda perlu mengetahui bagaimana mengevaluasi inefisiensi pasar yang memberi Anda keunggulan trading dibandingkan dengan yang tidak. Merancang robot yang efektif memerlukan pemahaman bagaimana sistem perdagangan otomatis bekerja. Intinya, strategi perdagangan algoritmik terdiri dari 3 komponen inti: 1) Entri, 2) Keluar dan 3) Ukuran Posisi. Anda perlu merancang 3 komponen ini dalam kaitannya dengan inefisiensi pasar yang Anda potret (dan tidak, ini bukan proses yang mudah). Anda tidak perlu tahu matematika tingkat lanjut (meskipun akan membantu jika Anda bertujuan untuk membangun strategi yang lebih kompleks). Kemampuan berpikir kritis yang baik dan pemahaman statistik yang bagus akan membawa Anda jauh. Desain melibatkan backtesting (pengujian untuk trading edge and robustness) dan optimasi (memaksimalkan kinerja dengan pemasangan kurva minimal). Anda harus tahu bagaimana mengelola portofolio strategi perdagangan algoritmik juga. Strategi dapat saling melengkapi atau bertentangan ini dapat menyebabkan kenaikan eksposur risiko yang tidak terencana atau hedging yang tidak diinginkan. Alokasi modal penting juga apakah Anda membagi modal secara setara selama interval reguler atau memberi penghargaan kepada para pemenang dengan modal lebih Jika Anda tahu produk apa yang ingin Anda jual, temukan platform perdagangan yang sesuai untuk produk ini. Kemudian pelajari bahasa pemrograman API dari platform ini. Jika Anda memulai, saya akan merekomendasikan Quantopian (hanya saham), Quantconnect (saham dan FX) atau Metatrader 4 (FX dan CFD mengenai indeks ekuitas, saham dan komoditas). Bahasa pemrograman yang digunakan adalah Python, C dan MQL4 masing-masing. 4. Pengelolaan Data Sampah di tempat sampah. Data yang tidak akurat menyebabkan hasil tes tidak akurat. Kami membutuhkan data yang cukup bersih untuk pengujian yang akurat. Membersihkan data adalah trade-off antara biaya dan akurasi. Jika menginginkan data yang lebih akurat, Anda perlu meluangkan lebih banyak waktu (waktu uang) untuk membersihkannya. Beberapa masalah yang menyebabkan data kotor termasuk data yang hilang, duplikat data, data salah (bad ticks). Masalah lain yang menyebabkan data yang menyesatkan mencakup dividen, pemecahan saham dan futures rollover dll. 5. Manajemen Resiko Ada 2 jenis risiko utama: Risiko pasar dan risiko operasional. Risiko pasar melibatkan risiko yang terkait dengan strategi trading Anda. Apakah itu mempertimbangkan skenario kasus terburuk Bagaimana jika sebuah acara angsa hitam seperti Perang Dunia 3 terjadi Apakah Anda melakukan lindung nilai atas risiko yang tidak diinginkan Apakah posisi Anda terlalu tinggi Selain mengelola risiko pasar, Anda perlu melihat risiko operasional. Sistem crash, kehilangan koneksi internet, algoritma eksekusi yang buruk (yang mengarah ke harga eksekusi yang buruk, atau perdagangan yang tidak terjawab karena ketidakmampuan menangani selisih permintaan) dan pencurian oleh hacker adalah masalah yang sangat nyata. 6. Live Execution Backtesting dan live trading sangat berbeda. Anda harus memilih broker yang tepat (MM vs STP vs ECN). Berita Pasar Forex dengan Forum Forex Trading amp Forex Brokers Reviews adalah teman terbaik Anda, baca review broker di sana. Anda memerlukan infrastruktur yang tepat (VPN aman dan penanganan downtime dll) dan prosedur evaluasi (monitor kinerja robot Anda dan analisis mereka dalam kaitannya dengan optimasi inefficiencybacktests pasar) untuk mengelola robot Anda sepanjang masa. Anda perlu tahu kapan harus melakukan intervensi (memodifikasi startup pada robot Anda) dan kapan tidak melakukannya. Evaluasi dan Optimalisasi Strategi Perdagangan Pardo (Wawasan yang bagus tentang metode dalam membangun dan menguji strategi perdagangan) Mempromosikan jalan Anda menuju Kebebasan Finansial Van K Tharp (judul umpan yang konyol-klik di samping, buku ini adalah ikhtisar yang bagus untuk sistem perdagangan mekanis) Quantitative Trading Ernest Chan (Pengantar untuk perdagangan algo di tingkat eceran) Perdagangan dan Bursa: Mikrostruktur Pasar untuk Praktisi Larry Harris (Struktur mikro pasar adalah ilmu tentang bagaimana pertukaran berfungsi dan apa yang sebenarnya terjadi ketika sebuah perdagangan ditempatkan. Penting untuk mengetahui informasi ini Meskipun Anda baru memulai) Algorithmic Trading amp DMA Barry Johnson (Mengecam algoritma eksekusi bank. Hal ini tidak berlaku secara langsung untuk perdagangan algo Anda tapi ada baiknya untuk diketahui) The Quants Scott Patterson (Kisah Perang dari beberapa kuasi teratas. Sebagai waktu tidur baca) Quantopian (Kode, penelitian, dan diskusikan gagasan dengan masyarakat. Menggunakan Python) Dasar-dasar Algo Trading Algo Trading101 (Penafian: Saya memiliki sitemap ini. Pelajari teori desain robot, teori pasar dan coding. Menggunakan MQL4) - Bergabunglah dengan tantangan (Pelajari konsep-konsep trading dan teori backtesting Mereka baru-baru ini mengembangkan backtesting dan platform trading mereka sendiri, jadi bagian ini masih baru bagi saya, namun pengetahuan mereka berdasarkan konsep trading itu bagus.) BlogsForums yang Direkomendasikan (ini termasuk keuangan , Forum perdagangan dan perdagangan algo): Bahasa Pemrograman yang Direkomendasikan: Jika Anda tahu produk apa yang ingin Anda jual, temukan platform trading yang sesuai untuk produk ini. Kemudian pelajari bahasa pemrograman API dari platform ini. Jika Anda memulai, saya akan merekomendasikan Quantopian (hanya saham), Quantconnect (saham dan FX) atau Metatrader 4 (FX dan CFD mengenai indeks ekuitas, saham dan komoditas). Bahasa pemrograman yang digunakan adalah Python, C dan MQL4 masing-masing. 16.8k Views middot Lihat Upvotes middot Bukan untuk Reproduksi Saya memiliki latar belakang sebagai programmer dan menyiapkan tim agilescrum sebelum saya mulai melihat perdagangan algoritmik. Dunia perdagangan algoritmik sangat mempesonakan saya, namun hal itu bisa sedikit berlebihan. Saya mulai mendapatkan beberapa perspektif dengan terjun ke platform Quantopian, menonton rangkaian ceramah kuantitatif dan menjalankan sistem perdagangan algo berbasis masyarakat dan adaptasi berbasis di lingkungan mereka. Seperti yang di bawah ini: Saya kemudian menyadari untuk masuk lebih dalam lebih cepat, saya harus bertemu orang-orang yang suka menciptakan strategi perdagangan, namun tidak dapat memprogram - untuk mencocokkan diri saya sebagai manajer tim dan programmer agile sistem perdagangan. Jadi saya menulis sebuah buku tentang cara membuat tim untuk menerapkan algoritma trading Anda. Membangun Sistem Perdagangan Cara Agile: Cara Membangun Sistem Perdagangan Algoritma yang Menang sebagai Tim. Di komunitas Quantopian, saya melihat orang-orang cerdas keuangan mencari orang untuk menerapkan strategi trading mereka, namun di mana takut meminta pemrogram untuk menerapkan gagasan mereka. Karena mereka berpotensi bisa mulai menjalankan ide trading mereka tanpa mereka. Saya membahas masalah ini di buku saya. Untuk menghindari pemrogram melarikan diri dengan ide Anda: buatlah spesifikasi untuk ide trading Anda yang menggunakan kerangka pengkodean yang disesuaikan dengan jenis strategi yang ingin Anda kembangkan. Ini mungkin kedengarannya sulit, tapi bila Anda tahu semua langkah bayi dan bagaimana cara mereka menyesuaikan diri, sangat mudah dan menyenangkan untuk dikelola. Jika Anda menyukai jawaban ini, silakan pilih dan ikuti. 2.7k Views middot Lihat Upvotes middot Bukan untuk Reproduksi Meskipun ini adalah topik yang sangat luas dengan referensi untuk membangun algoritma, pengaturan infrastruktur, alokasi aset dan manajemen risiko namun saya hanya akan fokus pada bagian pertama bagaimana seharusnya bekerja untuk membangun algoritma kita sendiri. , Dan melakukan hal yang benar. 1. Membangun Strategi. Beberapa poin penting yang perlu diperhatikan di sini adalah: Catch Big Trends - Strategi yang bagus harus dalam semua kasus, menghasilkan uang saat pasar sedang tren. Pasar berjalan dengan tren bagus yang hanya bertahan 15-20 kali, tapi inilah saat semua kucing dan anjing (pedagang dari semua kerangka waktu, intraday, harian, mingguan, jangka panjang) sedang berbelanja dan mereka semua Memiliki satu tema yang umum. Banyak pedagang juga membangun strategi pengembalian rata-rata di mana mereka mencoba menilai kondisi ketika harga telah bergerak jauh dari rata-rata, dan melakukan perdagangan melawan tren namun harus dibangun bila Anda berhasil membangun dan menukar beberapa tren yang baik mengikuti sistem. . Kemungkinan menumpuk - Orang sering bekerja untuk mencoba membangun sistem yang memiliki rasio winloss yang sangat baik tapi bukan pendekatan yang tepat. Misalnya seorang algo dengan pemenang 70 dengan rata-rata keuntungan 100 per perdagangan dan rata-rata kerugian 200 per perdagangan hanya akan menghasilkan 100 per 10 perdagangan (10trade net). Tapi algo dengan pemenang 30 dengan rata-rata keuntungan 500 per perdagangan dan kerugian 100 per perdagangan akan menghasilkan keuntungan bersih sebesar 800 untuk 10 perdagangan (80trade). Jadi tidak perlu rasio winloss itu bagus, bukan kemungkinan menumpuk yang seharusnya lebih baik. Ini berjalan dengan mengatakan kerugian quotKeep kecil, tapi biarkan pemenang Anda runquot. QuotIn investasi, apa yang nyaman jarang menguntungkan. quot - Robert Arnott Drawdown - Drawdown tidak dapat dihindari, jika Anda mengikuti jenis strategi apa pun. Jadi saat merancang algo don039t mencoba mengurangi penarikan atau melakukan beberapa kondisi khusus khusus untuk mengurus penarikan tersebut. Kondisi spesifik ini di masa depan dapat bertindak sebagai penghambat jalan dalam menangkap tren besar dan algo Anda mungkin berkinerja buruk. Manajemen Risiko - Saat membangun strategi, Anda harus selalu memiliki pintu keluar, apa pun yang dipilih pasar. Pasar adalah tempat peluang dan Anda harus merancang algo untuk mengeluarkan Anda dari perdagangan sesegera mungkin jika tidak sesuai dengan selera risiko Anda. Biasanya dikatakan bahwa Anda harus mengambil risiko 1-2 dari modal di setiap perdagangan, dan optimal dalam banyak cara, walaupun Anda bisa mendapatkan 10 transaksi palsu berturut-turut sehingga modal Anda akan turun hanya 20. Tapi ini bukan Kasus dalam skenario pasar aktual. Beberapa perdagangan rugi akan terjadi antara 0-1, sementara beberapa mungkin akan mencapai 3-4, jadi lebih baik untuk mendefinisikan modal kerugian rata-rata per perdagangan dan modal maksimum yang dapat Anda kendalikan dalam perdagangan, karena pasar benar-benar acak dan tidak dapat dinilai. . Sekali-sekali, pasar melakukan sesuatu yang sangat bodoh sehingga membuat Anda tersesat. quot - Jim Cramer 2. Menguji dan mengoptimalkan Slippage Strategi. Ketika kita menguji strategi data historis, kita berada di bawah asumsi bahwa perintah akan dieksekusi pada harga yang telah ditentukan tiba oleh algo. Tapi ini tidak akan menjadi masalah, karena kita harus berurusan dengan pembuat pasar dan HFT algo039s sekarang. Pesanan Anda di dunia sekarang ini tidak akan pernah dieksekusi dengan harga yang diinginkan, dan akan ada selip. Ini harus disertakan dalam pengujian. Dampak Pasar: Volume yang diperdagangkan oleh algo merupakan faktor utama yang harus dipertimbangkan saat melakukan pengujian balik dan mengumpulkan hasil historis. Seiring meningkatnya volume pesanan yang dilakukan oleh algo akan memiliki dampak pasar yang cukup besar dan harga rata-rata pesanan terisi akan jauh berbeda. Algo Anda mungkin menghasilkan hasil yang berbeda dalam kondisi pasar yang sebenarnya, jika Anda tidak mempelajari dinamika volume yang dimiliki algo Anda. Optimalisasi: Sebagian besar pedagang menyarankan Anda untuk tidak melakukan penyesuaian kurva dan pengoptimalan dan mereka benar karena pasar adalah fungsi dari variabel acak dan tidak ada dua situasi yang akan sama. Jadi mengoptimalkan parameter untuk situasi tertentu adalah ide yang buruk. Saya akan menyarankan Anda untuk mencari Zonal Optimization. Ini adalah teknik yang saya ikuti, membeli zona identifikasi yang memiliki karakteristik serupa dalam hal volatilitas dan volume. Optimalkan area ini secara terpisah, daripada mengoptimalkan keseluruhan periode. Berikut adalah beberapa langkah paling dasar dan paling penting yang saya ikuti, saat mengubah pemikiran dasar menjadi sebuah algoritma dan memastikan validitasnya. Semua orang memiliki kekuatan otak untuk mengikuti pasar saham. Jika Anda berhasil melewati kelas lima, Anda bisa melakukannya. QuotPeter Lynch 17.2k Views middot Lihat Upvotes middot Not for Reproduction Jawaban singkat: Belajar matematika diterapkan pada perdagangan, struktur pasar dan secara opsional menjadi pemrogram sistem terdistribusi atas jaringan. Ada tiga jalur yang berpotensi paralel yang dapat diambil untuk mempelajari perdagangan algoritmik dari nol bergantung pada tujuan akhir mengapa Anda ingin mempelajarinya. Di sini mereka semakin meningkatkan tingkat kesulitan yang juga berkorelasi dengan berapa banyak bagian Anda yang menjadi penghidupan Anda. Yang sebelumnya akan membuka peluang bagi yang berikut. Anda bisa berhenti pada tahap apapun sepanjang perjalanan begitu Anda cukup belajar atau mendapat pekerjaan untuk melakukannya. Jika Anda ingin menjadi seorang quant, kebanyakan menggunakan perangkat lunak matematika dan tidak benar-benar menjadi programmer sistem algo, maka jawaban singkatnya adalah mendapatkan gelar PhD di bidang Matematika, Fisika atau beberapa topik teknik terkait matematika. Cobalah untuk mendapatkan magang di hedge fund atas, toko barang atau bank investasi. Jika Anda bisa dipekerjakan oleh perusahaan yang sukses maka Anda akan diajar di sana jika tidak, itu pasti tidak akan terjadi. Tapi bagaimanapun, Anda masih harus menyelesaikan bagian 039Self Study039 di bawah ini untuk memastikan Anda benar-benar ingin melalui upaya mendapatkan gelar PhD. Kecuali Anda seorang jenius, jika Anda tidak memiliki gelar PhD, Anda tidak akan dapat bersaing dengan mereka yang melakukannya kecuali Anda mengkhususkan diri dalam pemrograman sistem perdagangan. Jika Anda ingin lebih di sisi pemrograman, cobalah melamar pekerjaan setelah setiap langkah, tapi tidak sering dari setahun sekali per perusahaan. Self Study Langkah pertama adalah memahami apa sebenarnya trading algoritmik dan sistem apa yang dibutuhkan untuk mendukungnya. Sebaiknya baca dengan seksama melalui kuarsa Trading amp DMAquot (Johnson, 2010), sesuatu yang saya lakukan dan rekomendasikan secara pribadi. Itu akan membuat Anda mengerti pada tingkat dasar. Selanjutnya Anda harus memprogram buku pesanan Anda sendiri, simulator data pasar sederhana dan satu implementasi algoritma pada Anda di dengan Java atau CC. Untuk mendapatkan kredit ekstra yang akan membantu mendapatkan pekerjaan, Anda harus menulis lapisan komunikasi jaringan Anda sendiri dari nol juga. Pada titik ini Anda mungkin bisa menyelesaikan menjawab pertanyaan Anda sendiri. Tapi untuk kelengkapan dan keingintahuan, merasa bebas untuk melanjutkan: Buku berikutnya yang harus ditangani adalah kutipan Bursa Efek: Mikrostruktur Pasar untuk Praktisiquot (Harris, 2003). Ini akan masuk ke rincian yang lebih baik tentang bagaimana pasar bekerja. Ini adalah buku lain yang telah saya baca, namun tidak sepenuhnya dipelajari karena saya adalah seorang pemrogram sistem dan bukan seorang quant atau manajer di sisi bisnis. Akhirnya, jika Anda ingin mulai belajar matematika tentang bagaimana pasar bekerja, kerjakan teks dan masalah dalam kuotasi, Futures, dan Derivatifquot Lainnya (Hull, 2003). Saya berhasil melewati sekitar setengah dari buku teks itu sebagai persiapan atau sebagai bagian dari pelatihan internal di salah satu mantan atasan saya. Saya yakin pada awalnya saya mengetahui tentang buku itu karena ini merupakan saran atau pembacaan yang diperlukan untuk salah satu program MS Financial Mathematics yang terkenal. Untuk mendapatkan kesempatan yang lebih baik dalam pekerjaan melalui program penggajian kelas baru, lengkapi program MS Financial Mathematics jika Anda ingin menjadi seorang programmer untuk platform trading atau tim quants. Jika Anda ingin menjadi orang yang merancang algos, Anda perlu mengambil rute PhD yang dijelaskan sebelumnya. Jika Anda masih belum selesai kuliah, maka dengan segala cara, cobalah untuk mendapatkan magang di tempat yang sama. Pekerjaan Tidak peduli seberapa banyak Anda belajar di buku dan sekolah, tidak ada yang akan dibandingkan dengan sedikit rincian yang Anda pelajari saat bekerja untuk perusahaan. Jika Anda tidak tahu semua kasus tepi dan tahu kapan model Anda berhenti bekerja, Anda akan kehilangan uang. Saya berharap bahwa menjawab pertanyaan Anda dan bahwa di sepanjang jalan belajar Anda temukan jika Anda benar-benar ingin beralih dari studi ke pekerjaan sehari-hari yang sebenarnya. 18.5k Views middot Lihat Upvotes middot Bukan untuk Reproduksi Interactive Brokers Interactive Brokers memiliki platform investasi yang sangat unggul dan harga yang layak. Ini jelas alat yang hebat, jadi Anda mungkin bisa mendapatkan alternatif yang lebih murah dari broker diskon seperti Etrade dan Scottrade, tapi jika Anda serius dengan perdagangan algoritmik, IB adalah tempat di mana ia berada. InvestFly Success adalah semua tentang latihan dan pengujian hipotesis dan algoritma Anda. Uji balik, uji pasar dan bandingkan dengan yang lain. Saya lebih suka Investfly - Bursa Saham Virtual, Strategi Pasar Saham amp Strategi Perdagangan. Tapi ada satu ton program bagus di luar sana. Idea Generation Don039t mulai dari nol - Saya suka mendapatkan ide dari Motif Investing (Broker Online, Gagasan Investasi, Perdagangan Saham) dan Mencari Alfa, tapi selalu melihat gambaran besar dan pikirkan bagaimana hal-hal ini berlaku untuk hipotesis Anda sendiri dan Formula. Ceria dan semoga beruntung 4.5k Views middot Lihat Upvotes middot Bukan untuk Reproduksi Jika investasi adalah sebuah proses, maka kesimpulan logisnya adalah otomatisasi. Algoritma tidak lain adalah formalisasi ekstrem dari filsafat yang mendasarinya. Ini adalah ekspresi visual dari sisi trading Trading edge Win Avg Win - Rugi Rugi Rugi Ini mengubah hidup saya dan cara saya mendekati pasar. Visualisasikan distribusi Anda selalu. Ini akan membantu Anda mengklarifikasi konsep Anda, menjelaskan kekurangan logis Anda, tapi pertama-tama mari mulai dengan filsafat dan keyakinan. 1. Mengapa penting untuk mengklarifikasi keyakinan Anda Kami memperdagangkan keyakinan kami. Lebih penting lagi, kita memperdagangkan keyakinan bawah sadar kita. Jika Anda tidak tahu siapa Anda, pasar adalah tempat yang mahal untuk mencari tahu, Adam Smith Banyak orang tidak meluangkan waktu untuk mendapatkan kepercayaan mereka dan menjalankan kepercayaan yang dipinjam. Pertanyaan yang tidak terjawab dan logika yang salah adalah alasan mengapa beberapa pedagang sistematis men-tweak sistem mereka di sekitar setiap penarikan. Aku dulu seperti itu selama bertahun-tahun. Latihan eletitasi keyakinan: Karya oleh Byron Katie. Setelah saya menyelesaikan 2 keyakinan sehari tantangan selama 100 hari, saya bisa menjelaskan gaya saya kepada seorang nenek 5 mengapa. Tanyakan pada diri Anda pertanyaan mengapa dan menyelam lebih dalam. Mindset: ekspansif dan subtraktif atau smoothie Vs band-aid Ada dua jenis pola pikir, dan kita memerlukan keduanya pada waktu yang berbeda: Ekspansif untuk mengeksplorasi konsep, gagasan, trik, dll. Menarik: untuk menyederhanakan dan mengklarifikasi konsep Pedagang sistematis yang gagal menjadi orang yang substraktif. Sebuah pendekatan smoothie Mereka membuang segala macam barang ke dalam strategi mereka dan kemudian memadukannya dengan pengoptimal. Langkah buruk: kompleksitas adalah bentuk kemalasan Pedagang sistematis yang terlalu subtraktif memiliki mentalitas band aid. Mereka kode keras semuanya dan kemudian semoga berhasil menambal trader quotEssentialist yang mengerti bahwa ini adalah tarian antara periode eksplorasi dan masa penyederhanaan inti keras. Sederhana tidak mudah Sudah sampai 3.873 jam, dan saya menerimanya mungkin memakan waktu lama2. Keluar: mulailah dengan akhir dalam pikiran Kebenaran kontra-intuitif Satu-satunya saat ketika Anda tahu jika sebuah perdagangan menguntungkan adalah setelah keluar, benar Jadi, fokus pada logika keluar terlebih dahulu. Menurut pendapat saya, alasan utama mengapa orang gagal mengotomatisasi strategi mereka adalah mereka terlalu fokus pada masuk dan tidak cukup saat keluar. Kualitas keluaran Anda membentuk distribusi PampL Anda, lihat bagan di atas Luangkan waktu yang sangat lama untuk berhenti karena hal itu mempengaruhi 4 komponen sistem perdagangan Anda: Menang, Rugi, Rugi Rugi, frekuensi perdagangan Kualitas sistem Anda akan ditentukan oleh kualitas Stop loss Anda, 3. Uang dibuat di modul pengelolaan uang Berat yang sama adalah bentuk kemalasan. Ukuran taruhan Anda akan menentukan bentuk pengembalian Anda. Pahami kapan strategi Anda tidak bekerja dan kurangi ukuran. Sebaliknya, tingkatkan ukuran saat bekerja. Saya akan menulis lebih banyak tentang ukuran posisi di situs web saya, namun ada banyak sumber daya di internet. 3. Terakhir dan paling tidak, Masuk Setelah Anda menyaksikan musim penuh para ibu rumah tangga dengan harga murah atau mengutip barang palsu, minta beberapa coklat, mengantarkan anjing, memberi makan Ikan itu, memanggil ibumu, maka sekarang saatnya memikirkan masuk. Baca rumus di atas, pemetik stok bukanlah komponen utama. Orang mungkin berpendapat bahwa pemetikan stok yang tepat dapat meningkatkan kemenangan. Mungkin, tapi tidak ada gunanya jika tidak ada kebijakan keluar yang tepat, atau pengelolaan uang. Dalam istilah probabilistik, setelah Anda tetap keluar, masuk menjadi probabilitas skala geser 4. Apa yang harus dipusatkan saat menguji Tidak ada rata-rata pergerakan magis, nilai indikator. Saat menguji sistem Anda, fokus pada tiga hal: Halal yang salah: mereka mengikis kinerja. Temukan cara sederhana (elegan) untuk menguranginya, kerjakan periode logika saat strategi tidak berjalan: tidak ada strategi yang bekerja setiap saat. Bersiaplah untuk itu dan siapkan rencana kontingensi terlebih dahulu. Tweaking sistem selama penarikan seperti belajar berenang dalam badai Membeli kekuatan dan pengelolaan uang: ini adalah fakta kontra-intuitif lainnya. Sistem Anda mungkin menghasilkan ide tapi Anda tidak memiliki daya beli untuk dieksekusi. Tolong, lihatlah bagan di atas saya membangun semua strategi saya dari sisi pendek dulu. Uji ketahanan terbaik untuk sebuah strategi adalah sisi pendeknya: Volume tipis siklus siklus volatil yang lebih cepat dan mudah menguap Saya memulai dengan pengembang WealthLab. Ini memiliki ukuran spektakuler ukuran perpustakaan. Ini adalah satu-satunya platform yang memungkinkan pengeditan lebar dan pengoptimalan portofolio. Saya menguji semua konsep saya di WLD. Sangat disarankan. Ini memiliki satu kekurangan, ia tidak menghubungkan posisi sizer dengan live trading sejati. Amibroker juga bagus. Ini memiliki API yang terhubung ke broker Interaktif dan sizer poisition yang layak. Kami memprogram di Metatrader untuk Forex. Sayangnya, Metatrader telah menurunkan kompleksitas lubang kelinci. Ada komunitas yang bersemangat di luar sana. MatLab, senjata pilihan bagi para insinyur. Tidak ada komentar. Tradisi Perry Kaufman menulis beberapa buku bagus tentang TS. Ada komunitas yang bersemangat di luar sana. Ini lebih mudah daripada kebanyakan platform lainnya Saran akhir Jika Anda ingin belajar berenang, Anda harus melompat ke dalam air. Banyak pemula ingin mengirimkan ide miliar dolar mereka kepada beberapa programmer murah di suatu tempat. Tidak bekerja seperti itu. Anda perlu belajar bahasa, logika. Penjepit untuk perjalanan jauh 14.7k Views middot Lihat Upvotes middot Not for Reproduction Lihat TradeLink (C) atau ActiveQuant (Java). Kode TradeLink0s lebih elegan. Saya mengetik ini di ponsel, jadi tolong permisi singkatnya. Pada dasarnya, lihatlah apa yang ada di vs apa yang keluar sebagai cara awal untuk membingkai masalah. Di. Data pasar, peristiwa exhangemarket (eksekusi untuk perdagangan yang dilakukan oleh sistem Anda, acks, reject, notifikasi trading-stopted, dll). Di luar. Pesanan, modifikasi ordes. QuotBuy 100 15.5, IOCquot, misalnya. IOC segera atau batalkan. Diantara. Keputusan strategi berdasarkan informasi yang dikumpulkan dari data real-time, bersamaan dengan data historis dan masukan lainnya (perintah trader dari GUI-nya untuk perdagangan secara tidak bermoral agresif, dll). Hal-hal seperti. Tempatkan pesanan, ubah pesanan yang ada, dll. Sekarang Anda bisa mulai menangani arsitektur teknis dari sistem semacam itu. Yang penting adalah kemampuan untuk mengekspresikan strategi dengan mudah, elegan, terlepas dari kompleksitas pemrosesan acara yang terlibat (ada beberapa kondisi balapan yang menarik yang dapat membingungkan sistem Anda berkaitan dengan keadaan pasar pesanan Anda, misalnya). Dulu saya melakukan ini untuk mencari nafkah dan mungkin bisa terus tanpa henti Tapi mengetik di ponsel adalah alat jera. Semoga Anda menemukan ini berguna. Hubungi saya jika Anda membutuhkan panduan lebih lanjut. 21.2k Tampilan middot Lihat Upvotes middot Not for Reproduction Diperbarui 100w yang lalu middot Upvoted oleh Patrick J Rooney. 5 tahun berdagang secara profesional Saya mengkhususkan diri dalam lanjutan o Untuk memulai dengan dasar-dasar, dapatkan pegangan Amibroker (AmiBroker - Download). Amibroker memiliki bahasa yang mudah dipelajari dan mesin backtest yang kuat dimana Anda bisa mengemas ide Anda. Juga dapatkan buku Howard Quantity Trading Systems Kuantitatif. Buku ini adalah pengenalan yang sangat bagus untuk konsep pengembangan kuantum. Anda juga setidaknya memerlukan pengetahuan dasar tentang statistik. Ada banyak kursus MOOC yang bagus untuk ini gratis. Seperti yang satu ini Statistik Satu - Universitas Princeton Coursera It0 juga layak diikuti The Whole Street. Yang merupakan mashup dari semua blog quant, banyak di antaranya mempublikasikan kode Amibroker dengan ide mereka. Dari situlah, layak dipelajari belajar Python (pelajari python - Google Search), dan juga mengerjakan kursus Belajar Mesin Universitas Andrew Ng039 yang bagus, yang berjalan gratis di Coursera. Jika kemudian Anda ingin menerapkan algoritma Anda sendiri, situs yang bagus untuk Quantconnect atau Quantopian. Akhirnya, orang ini memiliki beberapa saran bagus untuk mengubahnya menjadi quantstart karir Anda Semoga berhasil dengan perjalanan Sebagian diambil dari jawaban Alan Clement kepada Bagaimana pengembang perangkat lunak di bidang keuangan menjadi pengembang kuantum 16.2k Views middot View Upvotes middot Not for ReproductionBest Programming Language Untuk Algorithmic Trading Systems Salah satu pertanyaan paling sering saya dapatkan di tas surat QS adalah bahasa pemrograman terbaik untuk perdagangan algoritmik. Jawaban singkatnya adalah tidak ada bahasa yang terbaik. Parameter strategi, kinerja, modularitas, pengembangan, ketahanan dan biaya harus dipertimbangkan. Artikel ini akan menjelaskan komponen penting dari arsitektur sistem perdagangan algoritmik dan bagaimana keputusan mengenai implementasi mempengaruhi pilihan bahasa. Pertama, komponen utama dari sistem perdagangan algoritmik akan dipertimbangkan, seperti alat penelitian, optimizer portofolio, manajer risiko dan mesin eksekusi. Selanjutnya, strategi perdagangan yang berbeda akan diperiksa dan bagaimana pengaruhnya terhadap disain sistem. Khususnya frekuensi perdagangan dan volume perdagangan kemungkinan akan dibahas. Begitu strategi trading telah dipilih, maka perlu arsitek seluruh sistem. Ini termasuk pilihan perangkat keras, sistem operasi dan ketahanan sistem terhadap kejadian langka dan berpotensi bencana. Sementara arsitektur sedang dipertimbangkan, mengingat harus dibayar terhadap kinerja - baik ke alat penelitian maupun lingkungan eksekusi langsung. Apa itu Sistem Perdagangan yang Mencoba Untuk Dilakukan Sebelum menentukan bahasa terbaik untuk menulis sistem perdagangan otomatis, penting untuk menentukan persyaratannya. Apakah sistem akan dijalankan secara murni Apakah sistem memerlukan manajemen risiko atau modul konstruksi portofolio Apakah sistem memerlukan backtester kinerja tinggi Untuk sebagian besar strategi sistem perdagangan dapat dipartisi menjadi dua kategori: Penelitian dan pembangkitan sinyal. Penelitian berkaitan dengan evaluasi kinerja strategi terhadap data historis. Proses evaluasi strategi perdagangan terhadap data pasar sebelumnya dikenal dengan backtesting. Ukuran data dan kompleksitas algoritmik akan memiliki dampak besar pada intensitas komputasi backtester. Kecepatan CPU dan konkurensi sering menjadi faktor pembatas dalam mengoptimalkan kecepatan eksekusi penelitian. Generasi sinyal berkaitan dengan menghasilkan satu set sinyal perdagangan dari sebuah algoritma dan mengirim pesanan semacam itu ke pasar, biasanya melalui broker. Untuk strategi tertentu diperlukan tingkat kinerja yang tinggi. Masalah IO seperti bandwidth jaringan dan latency sering menjadi faktor pembatas dalam mengoptimalkan sistem eksekusi. Jadi pilihan bahasa untuk setiap komponen dari keseluruhan sistem Anda mungkin sangat berbeda. 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 TradingIt Doesnt Seem Possible. Tapi Itu Dengan Strategi Perdagangan Algoritma Kita Sepertinya tidak mungkin. Salah satu sistem perdagangan algoritmik dengan begitu banyak identifikasi tren, analisis siklus, aliran volume sisi buquell, strategi perdagangan ganda, entry dinamis, harga target dan stop, dan teknologi sinyal ultra cepat. Tapi memang begitu. Sebenarnya, platform sistem perdagangan algoritma AlgoTrades adalah satu-satunya dari jenisnya. Tidak ada lagi pencarian untuk saham panas, sektor, komoditas, indeks, atau opini pasar membaca. Algotrades melakukan semua pencarian, timing dan trading untuk Anda dengan menggunakan sistem perdagangan algoritmik. Strategi yang terbukti AlgoTrades dapat diikuti secara manual dengan menerima email dan alert teks SMS, atau bisa jadi 100 perdagangan bebas tangan, terserah Anda Anda dapat mengaktifkan perdagangan otomatis onoff kapan saja sehingga Anda selalu mengendalikan takdir Anda. Sistem Perdagangan Otomatis untuk Investor yang Cerdas Copyright 2017 - ALGOTRADES - Sistem Perdagangan Algoritma Otomatis ATURAN CFTC 4.41 - HASIL KINERJA HIPOTHETIK ATAU SIMULASI MEMILIKI BATASAN TERTENTU. MELIHAT KINERJA KINERJA SEBENARNYA, HASIL YANG SIMULASI JANGAN MENYATAKAN PERDAGANGAN YANG BENAR. JUGA, SEJAK TRADES BELUM DIPERLUKAN, HASIL YANG DAPAT MEMILIKI BAWAH ATAU BAHAN YANG DIPERLUKAN UNTUK DAMPAKNYA, JIKA ADA, FAKTOR PASAR TERTENTU, SEPERTI KURANGNYA LIKUIDITAS. PROGRAM PERDAGANGAN SIMULASI DALAM UMUM JUGA TERTARIK FAKTA BAHWA MEREKA DITANDATANGANI DENGAN MANFAAT HINDSIGHT. TIDAK ADA REPRESENTASI YANG DIBUAT BAHWA SETIAP AKUN AKAN ATAU CUKUP UNTUK MENCAPAI KEUNTUNGAN ATAU KERUGIAN YANG SESUAI DENGAN MEREKA YANG DIMILIKI. Tidak ada representasi yang dibuat atau tersirat bahwa penggunaan sistem perdagangan algoritmik akan menghasilkan pendapatan atau menjamin keuntungan. Ada risiko kerugian yang besar terkait dengan perdagangan berjangka dan dana perdagangan yang diperdagangkan. Perdagangan berjangka dan pertukaran perdagangan yang diperdagangkan melibatkan risiko kerugian yang besar dan tidak sesuai untuk semua orang. Hasil ini didasarkan pada hasil kinerja simulasi atau hipotetis yang memiliki keterbatasan inheren tertentu. Tidak seperti hasil yang ditunjukkan dalam catatan kinerja aktual, hasil ini tidak mewakili perdagangan aktual. Juga, karena perdagangan ini belum benar-benar dijalankan, hasil ini mungkin kurang atau terlalu diimbangi dampaknya, jika ada, faktor pasar tertentu, seperti kurangnya likuiditas. Simulasi atau hipotetis program perdagangan pada umumnya juga tunduk pada kenyataan bahwa mereka dirancang dengan manfaat dari belakang. Tidak ada perwakilan yang dibuat bahwa setiap akun akan atau mungkin akan mencapai keuntungan atau kerugian yang serupa dengan yang ditunjukkan. Informasi di situs ini telah disiapkan tanpa memperhatikan tujuan investasi, situasi keuangan dan kebutuhan investor tertentu dan selanjutnya menyarankan pelanggan untuk tidak melakukan tindakan apapun tanpa mendapatkan saran khusus dari penasihat keuangan mereka untuk tidak mengandalkan informasi dari situs web sebagai dasar utama. Untuk keputusan investasi mereka dan untuk mempertimbangkan profil risiko mereka sendiri, toleransi risiko, dan stop loss mereka sendiri. - didukung oleh Enfold WordPress Theme

No comments:

Post a Comment