옵션 거래 기계 학습
제시 Spalding.
나는 기계 학습과 HFT (고주파 거래)로 어떻게 $ 500k를 벌었 는가?
이 포스트는 내가 대략 한 것을 상세하게 할 것이다. 2009 년부터 2010 년까지 고주파 거래에서 500k를 얻었습니다. 완전히 독립적으로 거래 중이므로 더 이상 내 프로그램을 실행하지 않아서 모두에게 기쁜 마음입니다. 내 거래는 주로 Russel 2000 및 DAX 선물 계약이었습니다.
내 성공의 열쇠는 정교한 재무 방정식에있는 것이 아니라 많은 간단한 구성 요소를 묶어 최대의 수익성을 위해 최적화 된 기계 학습을 사용하는 전체 알고리즘 설계에 있다고 생각합니다. 내 프로그램을 설정할 때 직감에 기반을 두었 기 때문에 정교한 용어를 알아야 할 필요가 없습니다. (Andrew Ng의 놀라운 기계 학습 과정은 아직 제공되지 않았습니다. 링크를 클릭하면 현재 프로젝트 인 CourseTalk, MOOC 검토 사이트)로 이동합니다.
첫째로, 나는 단지 나의 성공이 운의 결과가 아니라는 것을 보여주고 싶다. 내 프로그램은 하루에 1000-4000 건의 거래를했고 (절반은 길고 절반은 짧음) 한 번에 몇 가지 계약보다 많은 자리를 차지하지 못했습니다. 이것은 어떤 특정 거래의 무작위 적 운 평균이 꽤 빠름을 의미했습니다. 그 결과 나는 언젠가는 하루에 2000 달러 이상을 잃지 않았으며 잃는 달도 없었습니다.
(편집 :이 수치는 수수료를 지불 한 후입니다)
여기에 일일 변동에 대한 감각을 줄 수있는 차트가 있습니다. 숫자가 올라가는 것을 멈추었을 때 - 나는 그 (것)들에 들어가기 위하여 나의 동기 부여를 잃었 기 때문에 이것은 마지막 7 달을 제외하고주의하십시오.
자동 거래 프로그램을 설정하기 전에 & ldquo; manual & rdquo;로 2 년의 경험을 쌓았습니다. 하루 상인. 이것은 2001 년이었습니다. 전자 거래의 초기시기 였고 스컬 퍼 & 스쿠터에 대한 기회가있었습니다. 좋은 돈을 벌기 위해. 나는 단지 비디오 게임이나 상상을 초월한 도박과 비슷한 것으로 내가하고있는 것을 설명 할 수있다. 성공한다는 것은 빠르고, 훈련을 받고, 직관적 인 패턴 인식 능력을 갖추는 것을 의미합니다. 약 250,000 달러를 벌고, 학자금 대출을 갚고 돈을 남겨 뒀습니다. 승리!
향후 5 년 동안 저는 두 명의 신생 기업을 발족 시켰습니다. 그 과정에서 프로그래밍 기술을 습득했습니다. 2008 년 말까지 나는 다시 거래를 시작하지 않을 것입니다. 나의 첫번째 시작의 판매에서 낮은 달리기 돈으로, 나는 나의 다음 움직임을 알아내는 동안 약간 빠른 현금의 희망을 제안했다.
2008 년에 저는 수동으로 & rdquo; T4라는 소프트웨어를 사용하여 하루 거래 선물을 얻는다. 몇 가지 맞춤 주문 입력 단축키를 원했기 때문에 T4에 API가 있다는 것을 알게 된 후 C # (API 사용에 필요한 프로그래밍 언어)을 배우는 도전에 착수하여 직접 단축키를 만들었습니다.
내 발을 API에 젖게 한 후에 나는 곧 더 큰 열망을 가지고 있었다. 나는 컴퓨터가 나를 위해 무역하도록 가르치고 싶었다. API는 시장 데이터의 흐름과 교환기로 주문을 보내는 쉬운 방법을 제공했습니다. 중간에 논리를 작성해야만했습니다.
아래는 T4 거래 창 스크린 샷입니다. 차가운 점은 내 프로그램을 작동시킬 때 똑같은 인터페이스로 컴퓨터 거래를 볼 수 있었다는 것입니다. 진짜 주문이 내외부로 들락날락내는 것을 보면서 (그 자체로 내 돈으로) 스릴 만하고 무서웠습니다.
내 알고리즘 설계.
처음부터 나는 살아있는 거래를하기 전에 돈을 버는 것이 합리적이라고 확신 할 수있는 시스템을 설정하는 것이 목표였습니다. 이를 달성하기 위해 가능한 한 정확하게 - 라이브 거래를 시뮬레이션하는 거래 시뮬레이션 프레임 워크를 구축해야했습니다.
실시간 모드에서의 거래가 API를 통해 처리 된 시장 업데이트를 처리하는 동안 시뮬레이션 모드는 데이터 파일에서 시장 업데이트를 읽어야했습니다. 이 데이터를 수집하기 위해 API에 연결하고 타임 스탬프가있는 시장 업데이트를 기록하기 위해 프로그램의 첫 번째 버전을 설치했습니다. 4 주간의 최근 시장 데이터를 사용하여 시스템을 테스트하고 테스트했습니다.
기본 프레임 워크를 통해 나는 여전히 수익성 높은 거래 시스템을 만드는 방법을 알아 내야 만했습니다. 결과적으로 내 알고리즘은 두 가지 별개의 구성 요소로 나뉘어 질 것이고, 차례로 살펴 보겠습니다.
예측 가격 움직임; 그리고 수익성있는 거래 만들기.
가격 변동 예측.
아마도 어떤 거래 시스템의 분명한 구성 요소가 가격이 움직일 지 예측할 수있을 것입니다. 그리고 내 것도 예외는 아니 었습니다. 나는 현재 가격을 내부 입찰가와 내부 제안의 평균으로 정의하고 다음 10 초 안에 가격이 어디인지 예측하는 목표를 세웠다. 내 알고리즘은 거래 일 전반에 걸쳐이 예측을 순간마다 내놓을 필요가 있습니다.
& amp; 최적화 지표.
나는 단기간의 가격 움직임을 예언 할 수있는 의미있는 능력을 가지고 있음을 입증 한 몇 가지 지표를 만들었다. 각 지표는 양수 또는 음수의 숫자를 산출했습니다. 시장이 올라간다는 것이 양수이고 시장이 하락한 것이 음수 였을 때 지표가 유용했다.
필자의 시스템을 통해 어떤 지표가 얼마나 많은 예측 능력을 가지고 있었는지를 신속하게 판단 할 수 있었고, 많은 지표를 실험하여 어떤 것이 효과가 있었는지 확인할 수있었습니다. 많은 지표에서 변수를 생성 한 수식에 변수가 있었으며 다양한 값으로 달성 된 결과를 나란히 비교하여 변수에 대한 최적 값을 찾을 수있었습니다.
가장 유용한 지시자는 모두 비교적 간단했고 내가 거래 한 시장의 최근 사건과 상관 관계가있는 증권 시장을 기반으로했습니다.
정확한 가격 이동 예측.
단순한 위 또는 아래 가격 움직임을 예측하는 지표가 충분하지 않았습니다. 나는 각 지표의 가능한 각 가치에 의해 얼마나 많은 가격 움직임이 예측되었는지 정확하게 알 필요가 있었다. 지표 값을 가격 예측으로 변환하는 수식이 필요했습니다.
이것을 달성하기 위해 지표 값이 떨어진 범위에 의존하는 50 개 버킷으로 예상 가격 움직임을 추적했습니다. 이로 인해 Excel에서 그래프로 그릴 수 있었던 각 버킷에 대한 고유 한 예측이 생성되었습니다. 보시다시피 표시 가격이 올라 갈수록 예상 가격 변동폭이 커집니다.
이와 같은 그래프를 토대로 커브에 맞게 수식을 만들 수있었습니다. 처음에는이 & ldquo; curve fitting & rdquo; 수동으로 작성했지만이 과정을 자동화하는 코드를 작성했습니다.
모든 지표 곡선이 동일한 모양을 갖는 것은 아닙니다. 또한 데이터 포인트를 고르게 분산시키기 위해 버킷을 대수적으로 분산 시켰습니다. 마지막으로 음의 지표 값 (및 그에 상응하는 하락 가격 예측)이 플립되고 양수 값과 결합됨을 유의하십시오. (내 알고리즘을 위아래로 똑같이 처리했습니다.)
단일 예측을위한 지표 결합.
고려해야 할 중요한 사항은 각 지표가 완전히 독립적이지 않다는 점이었습니다. 각 지표가 개별적으로 만든 모든 예측을 단순히 합산 할 수 없었습니다. 핵심은 각 지표가 이미 예측 된 것보다 더 많은 예측 적 가치를 파악하는 것이 었습니다. 구현하기가 힘들었지 만 커브 피팅 (curve fitting)을한다면, 동시에 여러 지표를주의해야했습니다. 하나를 변경하면 다른 하나의 예측에 영향을 미칩니다.
곡선 맞추기 & rdquo; 모든 지표를 동시에 설정하여 옵티마이 저가 각 예측과 함께 새로운 예측 곡선을 향해 30 % 만 진행하도록 설정했습니다. 이 30 %의 점프를 통해 예측 곡선이 몇 번의 패스 내에서 안정화되는 것으로 나타났습니다.
이제 각 지표에서 추가 가격 예측을 제공함으로써 시장을 10 초 내에 예측할 수있는 단일 예측을 생성 할 수 있습니다.
왜 가격을 예측하는 것만으로 충분하지 않습니까?
시장에서의 이러한 우위로 인해 저는 황금이라고 생각할 수도 있습니다. 그러나 시장은 단순한 시장 가격이 아니라 입찰가와 제안으로 구성된다는 점을 명심해야합니다. 고주파 거래 성공은 좋은 가격을 얻는 데서 오는 것이고 쉽지 않습니다.
다음 요소는 수익성있는 시스템을 어렵게 만듭니다.
각 거래마다 나는 중개업자와 교환 원에게 커미션을 지불해야했습니다. 스프레드 (최고 입찰가와 최저 제안의 차이)는 단순히 무작위로 사고 파는 경우 엄청난 돈을 잃을 수 있음을 의미합니다. 시장 규모의 대부분은 통계적으로 우위에 있다고 생각한다면 나에게 무역을 수행할만한 다른 봇이었다. 제안을 보았다고해서 그것을 살 수 있다고 보장하지는 못했습니다. 내 구매 주문이 교환소에 도착할 때까지 그 제안은 취소되었을 가능성이 매우 높습니다. 소규모 시장 플레이어로서 속도만으로 경쟁 할 수있는 방법이 없었습니다.
전체 거래 시뮬레이션 구축.
그래서 지표를 테스트하고 최적화 할 수있는 프레임 워크가있었습니다. 그러나 나는 이것을 넘어야 만했습니다 - 전체 거래 시스템을 테스트하고 최적화 할 수있는 프레임 워크가 필요했습니다. 내가 명령을 내리고 자리에 앉는 곳. 이 경우 전체 P & L과 어느 정도 무역 당 평균 P & L을 최적화 할 수 있습니다.
이것은 까다로울뿐 아니라 어떤면에서는 정확하게 모델링하는 것이 불가능하지만 가능한 한 최선을 다했습니다. 다음은 내가 처리해야하는 몇 가지 문제입니다.
시뮬레이션을 통해 주문을 시장에 보내면 지연 시간을 모델링해야했습니다. 내 시스템에서 제안을 보았다고해서 곧바로 구입할 수있는 것은 아닙니다. 시스템은 주문을 보내고 약 20 밀리 초를 기다렸다가 제안이 아직 남아있는 경우에만 실행 된 거래로 간주됩니다. 실제 지연 시간이 일관성이없고보고되지 않았기 때문에 이는 정확하지 않았습니다. 입찰이나 제안을 할 때 (API가 제공 한) 거래 실행 스트림을보고 내 주문이 실행되었을 때이를 측정해야했습니다. 이 작업을 올바르게 수행하려면 대기열에서 주문의 위치를 추적해야했습니다. (선입 선출 시스템입니다.) 다시 말하지만, 이 작업을 완벽하게 수행 할 수는 없었지만 최선의 결과를 얻었습니다.
주문 실행 시뮬레이션을 개선하기 위해 로그 파일을 실제 거래에서 API를 통해 가져 와서 정확히 같은 기간의 가상 거래로 생성 된 로그 파일과 비교합니다. 필자는 시뮬레이션을 매우 정확하고 모델링이 불가능한 부분에 대해서는 적어도 통계적으로 비슷한 결과를 산출하도록했습니다 (중요하다고 생각되는 메트릭스에서).
수익성있는 거래 만들기.
주문 시뮬레이션 모델을 사용하여 이제 시뮬레이션 모드에서 주문을 보내고 시뮬레이션 된 P & L을 볼 수 있습니다. 그러나 내 시스템은 언제 어디서 사고 팔고 있는지 알고 있습니까?
가격 이동 예측은 출발점 이었지만 전체 이야기는 아닙니다. 내가 한 일은 입찰 및 제공에 대한 5 가지 가격 수준의 점수 체계를 작성하는 것이 었습니다. 내부 입찰가 (구매 주문의 경우)와 내부 가격 (판매 주문의 경우) 한 수준 아래에 포함되었습니다.
어떤 주어진 가격 수준의 점수가 내 시스템이 활성 입찰가 / 제안을 가져야한다는 것을 의미하는 특정 임계 값 이상인 경우 - 임계 값 미만이면 활성 주문을 취소해야합니다. 이것을 바탕으로 내 시스템이 시장에서 입찰을 시작한 다음 즉시 취소한다는 것은 흔한 일이 아닙니다. (필자는 나를 포함하여 인간의 눈으로 화면을 보는 사람에게 도대체 성가시다.
가격 수준 점수는 다음 요소에 따라 계산되었습니다.
가격 이동 예측 (앞서 논의한). 문제의 가격 수준. (내부 수준은 더 큰 가격 이동 예측이 필요하다는 것을 의미했습니다.) 대기열에서 주문 앞에서 계약 수. (적은 것이 더 좋았습니다.) 대기열에서 주문한 계약서의 수. (더 좋아졌다.)
본질적으로 이러한 요소는 안전 & rdquo; 입찰 / 제안 할 장소 가격 이동 예측만으로는 충분하지 않습니다. 왜냐하면 입찰을 할 때 자동으로 채워지지 않았기 때문에 누군가가 저에게 팔았을 때 채워졌습니다. 특정 가격으로 나에게 팔고있는 사람의 단순한 사실만으로도 무역의 통계적 확률이 바뀌었다.
이 단계에서 사용 된 변수는 모두 최적화의 대상이됩니다. 이는 가격 이동 지표에서 최적화 된 변수와 완전히 똑같은 방식으로 수행되었습니다. 이 경우를 제외하고는 최종 수익 P & L에 대해 최적화했습니다.
인간으로 거래 할 때 우리는 종종 강력한 감정과 편견을 가지고있어 최적의 의사 결정에 못 미칠 수 있습니다. 분명히 나는 이러한 편향을 성문화하고 싶지 않았다. 내 시스템이 무시한 몇 가지 요인은 다음과 같습니다.
직책에 들어간 가격 - 거래소에서 장래성있는 결정을 내리는 것처럼 누군가가 길거나 짧은 가격에 관해 대화를 듣는 것은 꽤 흔합니다. 이것이 위험 감소 전략의 일부로서 타당성을 지니고는 있지만, 이는 시장에서의 미래 과정에 실질적으로 아무런 영향을 미치지 않습니다. 따라서 내 프로그램은이 정보를 완전히 무시했습니다. 침몰 비용을 무시하는 것과 같은 개념입니다. 짧은 포지션과 긴 포지션 종료 - 일반적으로 트레이더에게는 다른 포지션을 매도 할 위치와 부족한 포지션을 결정하는 기준이 있습니다. 그러나 내 알고리즘 관점에서 구별 할 이유가 없었습니다. 내 알고리즘이 하향 이동 판매를 기대한다면 그것이 현재 길거나 짧거나 평평한 지에 관계없이 좋은 아이디어였습니다. & doubled up & rdquo; 전략 - 이것은 상인들이 원 거래가 그들에게 불리한 상황에서 더 많은 주식을 살 것입니다. 이로 인해 평균 구매 가격이 낮아지고 주가가 돌아서는 시점 (또는 그럴 경우)을 의미하므로 & 시간이 없어 돈을 다시 돌려받을 수 있습니다. Warren Buffet을 사용하지 않는 한 내 생각에 이것은 정말 끔찍한 전략입니다. 당신은 대부분의 거래가 승자가 될 것이므로 당신이 잘하고 있다고 생각하는 속임수가 듭니다. 문제는 당신이 크게 잃을 때입니다. 다른 효과는 실제로 시장에서 우위를 차지하고 있거나 운이 좋아지면 판단하기 어렵게 만듭니다. 내 프로그램이 사실상 중요한 역할을하는지 모니터링하고 확인하는 것이 중요한 목표였습니다.
내 알고리즘은 어디서 거래에 들어 갔는지에 상관없이 같은 방식으로 의사 결정을 내 렸기 때문에 현재는 길거나 짧다. 때때로 큰 손실 거래 (일부 대형 거래에 더하여)에 앉아있다. 그러나 위험 관리가 없다고 생각하지 않아야합니다.
위험을 관리하기 위해 한 번에 최대 2 개의 계약서 크기를 적용했으며 때로는 대량 주문 일에 부딪 혔습니다. 예상치 못한 시장 상황이나 소프트웨어 버그에 대비하여 최대 일일 손실 한도를 확보했습니다. 이러한 제한은 내 코드 에서뿐만 아니라 내 브로커를 통한 백엔드에서도 적용되었습니다. 일어난대로 나는 중대한 문제를 결코 겪지 않았다.
내 프로그램 작업을 시작한 이래로 수익성에 이르기까지 약 6 개월이 걸렸고 실제로 실행되기 시작했습니다. 공정하기 위해서는 상당한 시간이 새로운 프로그래밍 언어를 배우는 것이 었습니다. 프로그램을 개선하기 위해 노력하면서 다음 4 개월마다 이익이 증가하는 것으로 나타났습니다.
매주 나는 지난 4 주간의 가치있는 데이터를 바탕으로 시스템을 재교육 할 것입니다. 나는 이것이 최근의 시장 행동 경향을 포착하는 것과, 알고리즘에 의미있는 패턴을 확립 할 수있는 충분한 데이터가 있는지를 확인하는 것 사이에서 적절한 균형을 발견했다. 교육이 점점 더 많이 시작되면서 아마존 EC2를 사용하는 8 대의 가상 머신에서 수행 할 수 있도록 나눠 보았습니다. 그 결과는 내 로컬 컴퓨터에서 병합되었습니다.
제 거래의 가장 중요한 포인트는 2009 년 10 월 제가 거의 100k를 만들 때였습니다. 그 후 나는 매월 감소한 이익에도 불구하고 내 프로그램을 개선하려고 노력하는 다음 4 개월을 계속 보냈습니다. 불행히도이 시점까지는 내가 시도한 모든 것이별로 도움이되지 않았기 때문에 최선의 아이디어를 모두 구현했다고 생각합니다.
개선 할 수없고 성장 감이 없다는 좌절로 새로운 방향에 대해 생각하기 시작했습니다. 6 가지 고주파 거래 회사를 통해 내 소프트웨어를 구입하고 나를 고용하여 일하는 것에 관심이 있는지 알아 보았습니다. 아무도 대답했다. 나는 일을하고 싶었던 몇 가지 새로운 시작 아이디어를 가지고 있었기 때문에 나는 결코 따라하지 않았다.
업데이트 - 나는 이것을 Hacker News에 올렸고 주목을 많이 받았다. 나는 지금 이런 일을하려고하는 사람을 옹호하지 않는다고 말하고 싶다. 경쟁의 희망을 가지려면 다양한 경험을 가진 정말로 현명한 사람들로 구성된 팀이 필요합니다. 내가 이것을하고있을 때조차도 개인이 성공을 거두는 것은 매우 드뭅니다.
페이지 맨 위에 "조작 된 통계"를 언급하고 나를 & ldquo; retail investor & rdquo;로 언급하는 주석이 있습니다. 그 퀴즈는 즐겁게 & & rdquo; 이것은 실제로 현실에 기반하지 않는 불행한 말입니다. 그 외에 흥미로운 의견을 설정하는 경우 news. ycombinator / item? id = 4748624.
업데이트 # 2 - 이 게시물에 대해 상인으로부터받은 몇 가지 일반적인 질문에 대한 답변을 제공하는 후속 FAQ를 게시했습니다.
delhideviant가 이것을 좋아했습니다.
안녕하세요, 전 Thinker의 창립자 인 제시입니다. 저는 샌프란시스코에서 살고 있습니다. 너는 내 집을 웹에서 찾았다 .. 환영합니다!
금융 해커.
알고리즘 거래에 대한 새로운 시각.
알고리즘 옵션 거래 3.
이 기사에서는 고객을 위해 작성한 전략과 같은 진정한 옵션 거래 전략에 대해 살펴 보겠습니다. 그러나 이것은 거래 도서의 시스템을 기반으로합니다. 앞서 언급했듯이 옵션 거래 서적에는 종종 실제로 작동하는 시스템이 포함되어 있습니다. 하루 거래 또는 외환 거래 도서에 대해서는 말할 수 없습니다. 여기서 검토 할 시스템은 실제로 이익을 창출 할 수 있습니다. 극단적 인 이익조차도, 분명히 결코 잃어 버리지 않기 때문에. 그러나 저자가 그것을 결코 뒷받침하지 않았다는 것도 또한 명백합니다. 계속 읽고 & # 8220; 알고리즘 옵션 거래 3 & # 8221;
HFT 시스템 해킹.
기존 트레이딩 전략의 기계 학습 또는 신호 처리 알고리즘과 비교하여 고주파 트레이딩 시스템은 놀라 울 정도로 간단합니다. 미래의 가격을 예측할 필요가 없습니다. 그들은 미래 가격을 이미 알고 있습니다. 또는 오히려 그들은 다른 느린 시장 참여자에게 미래에 놓일 가격을 알고 있습니다. 최근에 우리는 잠재적 이익과 최대 대기 시간을 결정하기 위해 HFT 시스템을 시뮬레이션하기위한 계약을 체결했습니다. 이 기사는 해커가 HFT 시스템을 테스트하는 방법에 대해 설명합니다. 계속해서 & nbsp; HFT 시스템 해킹 & # 8221;
알고리즘 옵션 거래, 2 부.
알고리즘 옵션 거래 시리즈의 두 번째 부분에서는 옵션 수익에 대해 자세히 살펴볼 것입니다. 특히 사용자 맞춤 수익 및 위험 곡선을 얻기위한 다양한 옵션 유형 결합 옵션 거래자는 & # 8220; Iron Condor & # 8221;와 같은 재미있는 이름의 조합을 알고 있습니다. 또는 & # 8220; Butterfly & # 8221;하지만 당신은 그들에게 국한되지 않습니다. 일부 트릭을 사용하면 원하는 재산의 인공 금융 상품을 만들 수 있습니다. & # 8211; & # 8220; 바이너리 옵션 & # 8221; 지불금 비율은 100 % 이상입니다. 계속 읽고 & # 8220; 알고리즘 옵션 거래, 파트 2 & # 8221;
바이 야후, 모든 물고기에 감사드립니다.
아주 최근의 사건에 비추어서 단지 빠른 게시. R, MatLab, Python 또는 Zorro의 재무 기능을 사용하는 사용자는 마지막 날에 놀랍습니다. 과거 가격 데이터를 기반으로 한 스크립트 및 프로그램이 갑자기 더 이상 작동하지 않았습니다. 그리고 우리가 선호하는 무료 역사 가격 데이터 제공 업체 인 Yahoo는 이제 이러한 방식으로 API에 대한 모든 액세스에 응답합니다.
알고리즘 옵션 거래, Part 1.
옵션의 많은 흥미로운 특징에도 불구하고, 개인 거래자는 거의 그것을 이용하지 않습니다 (물론 저는 바이너리 옵션이 아닌 진지한 옵션에 대해 말하고 있습니다). 어쩌면 옵션은 복잡하다는 평판 때문에 인기가 없을 수도 있습니다. 또는 대부분의 거래 소프트웨어 도구에 의한 지원 부족 때문입니다. 또는 알고리즘 트레이딩에 필요한 과거 데이터 및이를 지원하는 몇 가지 도구의 가격 태그가 있기 때문입니다. 뭐든간에 & # 8211; 우리는 최근 옵션 거래 시스템에 대한 몇 가지 프로그래밍 계약을 맺었으며 간단한 시스템조차도 비교적 일관성있는 이익을 창출 한 것으로 보았습니다. 특히 판매 옵션은 기존 거래보다 유리합니다. 악기. 이 기사는 알고리즘 옵션 거래로 돈 벌기에 관한 미니 시리즈 중 첫 번째 기사입니다. 계속 읽고 & # 8220; 알고리즘 옵션 거래, 파트 1 & # 8221;
더 나은 전략 5 : 단기 기계 학습 시스템.
Build Better Strategies 시리즈의 5 번째이자 마지막 부분입니다. 3 부에서는 모델 기반 시스템의 개발 프로세스에 대해 논의 했으므로 결과적으로 데이터 마이닝 시스템을 개발하여 시리즈를 마무리 할 것입니다. 데이터 마이닝과 기계 학습의 원리는 파트 4의 주제였습니다. 단기 트레이딩 예제에서 우리는 깊은 자동 학습 알고리즘 인 쌓인 자동 코드를 사용합니다. 그러나 다른 많은 머신과 동일한 방식으로 작동합니다 학습 알고리즘. 오늘날의 소프트웨어 도구를 사용하면 기계 학습 전략을 위해 약 20 줄의 코드 만 필요합니다. 나는 모든 단계를 자세히 설명하려고 노력할 것이다. 계속해서 더 나은 전략 5 : 단기 기계 학습 시스템 & # 8221;을 읽으십시오.
천천히 부자가 되라.
대부분의 거래 시스템은 부자가 빠른 유형입니다. 그들은 일시적인 시장 비 효율성을 이용하고 100 % 지역에서 연간 수익을 목표로합니다. 그들은 정기적 인 감독과 시장 조건의 적응을 필요로하며, 여전히 제한된 수명을 가지고 있습니다. 그들의 만료는 종종 큰 손실을 동반합니다. 그러나 그럼에도 불구하고 당신이 잘 생긴 이익을 얻었습니까? 이제는 더 안전한 피난처에 주차시키고 싶습니까? 베개 밑에 돈 줄까? 은행에 가지고 가니? 헤지 펀드에 줘? 분명히 알 고어 상인의 명예 강령에 반하는 모든 것. 여기에 대한 대안이 있습니다. 계속 읽고 & # 8220; 천천히 리치즈하세요 & # 8221;
이진 옵션 : 사기 또는 기회?
최근 바이너리 옵션 전략 코딩에 대한 계약이 점점 더 많아지고 있습니다. 이 옵션은 순진한 상인과 돈을 분리하는 계획으로 널리 이해되기 때문에 약간 나쁜 양심을 갖게됩니다. 그리고 그들의 중개인은 첫눈에 참으로 좋은 인상을주지 않습니다. 일부는 위조 된 주소로 사이프러스에서 규제되고, 일부는 전혀 규제되지 않습니다. 그들은 거대한 이익에 관한 조작 된 이야기를 로봇이나 EA로 퍼뜨렸다. 그들은 당신을 이기지 못하게하여 가격 곡선을 조작한다고합니다. 그리고 아직도하는 경우, 일부는 지불을 거부하고 결국 추적없이 (그러나 당신의 돈으로) 사라집니다. 바이너리 옵션 브로커에 관한 이야기입니다. 이진 옵션은 사기 이외에는없는가요? 또는 브로커들조차도 잘 모르는 숨겨진 기회를 제공합니까? & # 8220; 이진 옵션 : 사기 또는 기회? & # 8221;
더 나은 전략을 수립하십시오! 4 부 : 기계 학습.
Deep Blue는 체스 세계 선수권에서 우승 한 최초의 컴퓨터였습니다. 그것은 1996 년이었고 다른 프로그램 인 AlphaGo가 최고의 인간형 Go Player를 이길 수있을 때까지 20 년이 걸렸습니다. Deep Blue는 고정 배선 된 체스 규칙이 적용된 모델 기반 시스템이었습니다. AlphaGo는 수천 개의 Go 게임으로 훈련 된 심층 신경 네트워크 인 데이터 마이닝 시스템입니다. 향상된 하드웨어는 아니지만 소프트웨어에서의 획기적인 발전은 최고의 체스 선수를 물리 치고 톱 Go 선수를이기는 단계에 필수적이었습니다.
미니 시리즈의이 4 번째 부분에서는 거래 전략 개발을위한 데이터 마이닝 접근 방식에 대해 살펴 보겠습니다. 이 방법은 시장 메커니즘에 대해 신경 쓰지 않습니다. 예측 패턴에 대한 가격 곡선 또는 기타 데이터 소스를 검색합니다. 기계 학습 또는 인공 지능 & # 8221; 항상 데이터 마이닝 전략에 관여하지는 않습니다. 사실 가장 인기있는 & # 8211; 놀라 울 정도로 수익성 높은 & # 8211; 데이터 마이닝 방법은 멋진 신경망이나 벡터 머신을 사용하지 않고도 작동합니다. 계속 읽고 더 나은 전략을 수립하십시오! 4 부 : 기계 학습 & # 8221;
더 나은 전략을 수립하십시오! 3 부 : 개발 프로세스.
이것은 더 나은 전략 수립 시리즈의 세 번째 부분입니다. 이전 부분에서는 10 가지의 가장 악용 된 시장 비효율에 대해 논의하고 거래 전략의 몇 가지 예를 제시했습니다. 이 부분에서는 모델 기반 거래 시스템을 개발하는 일반적인 프로세스를 분석 할 것입니다. 거의 무엇이든, 당신은 (적어도) 두 가지 다른 방법으로 거래 전략을 할 수 있습니다 : 이상적인 방법, 그리고 진짜 방법이 있습니다. 우리는 10 단계로 세분화 된 이상적인 개발 프로세스로 시작합니다. 계속 읽고 더 나은 전략을 수립하십시오! 3 부 : 개발 프로세스 & # 8221;
친애하는 중개인 & # 8230;
자동화 된 거래를 위해 우리가 사용하는 소프트웨어가 무엇이든간에 : 알고리즘 가격표를 받고 거래를하기 위해 브로커 연결이 필요합니다. 겉보기에 간단한 작업. 거의 모든 브로커는 FIX와 같은 프로토콜을 통해, MT4 ™와 같은 자동화 된 플랫폼을 통해 또는 특정 브로커 API를 통해이를 지원합니다. 그러나 거래 소프트웨어를 브로커 API에 신속하게 연결할 수 있다고 생각되면 불만을 토로합니다. 브로커님께. & # 8211; 이 게시물을 읽고 해커 및 코더의 수명을 조금 더 쉽게 만드십시오! 계속해서 & nbsp; 친애하는 중개인 & # 8230; & # 8221;
더 나은 전략을 수립하십시오! 2 부 : 모델 기반 시스템.
거래 시스템에는 모델 기반과 데이터 마이닝의 두 가지가 있습니다. 이 기사에서는 모델 기반 전략을 다룹니다. 기본 알고리즘이 복잡하지 않더라도 적절하게 개발하는 데는 어려움과 함정이 있습니다 (그렇지 않으면 누구나 할 수 있습니다). 중요한 시장 비 효율성은 시스템에 상대적으로 작은 부분만을 제공합니다. 작은 실수는 승리 전략을 잃어버린 전략으로 바꿀 수 있습니다. 그리고 당신은 반드시 백 테스트에서 이것을 알아 채지 못할 것입니다. 계속 읽고 더 나은 전략을 수립하십시오! 2 부 : 모델 기반 시스템 & # 8221;
오버 샘플링으로 더 나은 테스트.
전략을 테스트하거나 훈련하는 데 사용하는 데이터가 많을수록 편향이 적어지면 테스트 결과에 더 많은 영향을 미치며 더 정확한 교육이됩니다. 문제는 가격 데이터가 항상 부족하다는 것입니다. out-of-sample 테스트를 위해 약간의 시간을 줄여야하는 경우조차도 더 짧습니다. 과거로 테스트 또는 교육 기간을 연장하는 것이 항상 해결책은 아닙니다. 1990 년대 또는 1980 년대의 시장은 오늘날과 매우 다르기 때문에 가격 데이터가 오도 된 결과를 초래할 수 있습니다.
이 기사에서는 같은 양의 가격 데이터에서 테스트, 교육 및 최적화를 위해 더 많은 거래를 생성하는 간단한 방법을 설명합니다. 이 방법은 데이터 마이닝 가격 패턴을 기반으로 한 가격 결정 시스템으로 테스트됩니다. 오버 샘플링으로 & # 8220; 더 나은 테스트 계속하기 & # 8221;
더 나은 전략을 수립하십시오!
트레이딩 시스템을 적절하게 최적화하고 테스트하는 방법에 대한 충분한 블로그 게시물, 논문 및 서적을 제공합니다. 그러나 처음에는 이러한 시스템에 접근하는 방법에 대한 정보가 거의 없습니다. 설명 된 전략은 종종 희박한 것처럼 보였습니다. 거래 시스템에 일종의 주현이 필요합니까? 아니면 그것을 개발하기위한 체계적인 접근법이 있습니까?
이 게시물은 무역 전략을 수립하기위한 체계적인 방법을 시도 할 작은 시리즈의 첫 번째 글입니다. 첫 번째 부분은 시장 가설과 스위스 프랑 사례 연구를 통해 전략 개발의 두 가지 주요 방법을 다룹니다. 계속해서 더 나은 전략을 수립하십시오! & # 8221;
냉혈 지수.
새로운 거래 시스템을 개발했습니다. 모든 테스트 결과가 인상적이었습니다. 그래서 당신은 그것을 시작했습니다. 그리고 2 개월 후 $ 2000까지 하락했습니다. 아니면 2 년 동안 일했던 전략을 가지고 있지만 끝이없는 무조건 삭감에 들어갔을 것입니다. 상황은 모든 상인에게 너무 친숙합니다. 지금 뭐야? 차가운 피로 운반하거나 공황 상태에서 브레이크를 당기시겠습니까?
몇 가지 이유 때문에 전략이 처음부터 돈을 잃을 수 있습니다. 시장의 비효율이 사라지면서 이미 만료 될 수 있습니다. 또는 시스템은 쓸데없고 테스트는 모든 현실 확인에서 살아남은 편견에 의해 위조됩니다. 또는 당신이 앉아 있어야만하는 정상적인 삭감입니다. 이 기사에서는 이러한 상황에서 시스템을 폐기할지 여부를 매우 일찍 결정하는 알고리즘을 제안합니다. 계속 읽고 & # 8220; The Cold Blood Index & # 8221;
나는 계약 코더를 고용했다.
알고리즘 방법을 사용하려는 야망이있는 상인입니다. 이미 알고리즘으로 변환 할 생각이 있습니다. 문제 : 코드를 읽거나 쓰는 것을 모릅니다. 그래서 당신은 계약 코더를 고용합니다. MT4, Ninja, TradeStation 또는 Zorro 플랫폼에서 삭제할 수있는 스크립트를 제공하는 데 돈을 지불 한 사람입니다. 축하합니다. 알고리즘 거래자가되었습니다. 스크립트를 시작하고 돈이 들어가기를 기다리십시오. & # 8211; 이게 정말 효과가 있니? 답변 : 그것은 달려 있습니다. & # 8220; Contract Coder를 고용했습니다 & # 8221;
& # 8220; 스컬 핑 & # 8221; 불합리한가?
고객은 종종 매우 짧은 기간 동안 거래하는 전략을 요구합니다. 일부는 아마도 5 분 만에 2000 달러를 벌었다고 생각합니다. & # 8221; 상인 포럼에 관한 이야기. 다른 사람들은 고주파 거래에 대해 들어 봤습니다 : 주파수가 높을수록 거래가 더 잘되어야합니다! Zorro 개발자는 마침내 진드기 이력과 밀리 초 시간 프레임을 구현할 때까지 수 년 동안 끊임없이 발전해 왔습니다. 전혀 쓸모없는 기능? 아니면 단기간에 알 고어 거래가 실제로 몇 가지 가능한 이점을 가지고 있습니까? 그 문제를 조사한 실험은 놀랄만 한 결과를 낳았습니다. 계속 읽고 & # 8220; 스컬 핑 & # 8221; 불합리한가? & # 8221;
해커의 도구.
우리의 금융 해킹 실험을 수행하고 (우리 노동의 재정적 성과를 얻으려면) 연구, 테스트, 교육 및 실시간 거래 금융 알고리즘을위한 소프트웨어 기계가 필요합니다. 기존의 소프트웨어 플랫폼은 오늘날 모든 작업에 달려 있습니다. 따라서 다른 소프트웨어 패키지에서 시스템을 구성 할 수 밖에 없습니다. 다행히도 일반적으로 2 개로 충분합니다. 나는이 블로그의 대부분의 기사에 Zorro와 R을 사용 하겠지만 때로는 다른 도구를 살펴볼 것입니다. 계속해서 & nbsp; Hacker & # 8217; Tools & # 8221;
MMI로 전략 강조하기.
이제 우리는 900 개의 추세 거래 전략을 사용하여 실험을 반복하겠습니다. 이번에는 Market Meanness Index로 필터링 된 거래로 이번을 반복합니다. 첫 번째 실험에서 수익성이 높은 전략도 많이 발견되었지만 일부는 White & # 823; Reality Check를 통과했습니다. 그래서 그들은 모두 백 트레이스트에서 큰 성과를 얻었음에도 불구하고 실제 거래에서 실패 할 것입니다. 이번에는 비 트렌드 시장 상황에서 거래를 필터링하여 MMI가 대부분의 시스템을 개선하기를 바랍니다. 계속해서 & # 8220; MMI로 전략 강조하기 & # 8221;
시장 Meanness 색인.
이 표시기는 & # 8211; 때때로 두 배로 & # 8211; 경향 추종 시스템의 수익 예상치. 시장 미 만 인덱스 (Market Meanness Index)는 현재 시장이 '동향'(trending & # 8221; 제도. 이렇게하면 추세 지표의 잘못된 신호로 인한 손실을 방지 할 수 있습니다. 순전히 통계 알고리즘이며 가격 곡선의 변동성, 추세 또는주기를 기반으로하지 않습니다. 계속 읽고 & # 8220; The Market Meanness Index & # 8221;
내가 이해하지 못하는 17 가지의 무역 방법.
기술 거래로 시작했을 때, 나는 중세의 연금술사에 들어설 것 같은 느낌을 받았다. 기괴한 무역 방법과 기술 지표 및 행운의 촛불 패턴 수백의 무리는 금융 자산의 경우에만 미래를 엿볼 것을 약속했다. 나는 궁금해했다. & # 8211; 그들 중 단 한명이 정말로 일한다면, 왜 나머지는 모두 필요하겠습니까? And how can you foretell tomorrow’s price by drawing circles, angles, bats or butterflies on a chart? Continue reading “Seventeen Trade Methods That I Don’t Really Understand”
White’s Reality Check.
This is the third part of the Trend Experiment article series. We now want to evaluate if the positive results from the 900 tested trend following strategies are for real, or just caused by Data Mining Bias . But what is Data Mining Bias, after all? And what is this ominous White’s Reality Check ? Continue reading “White’s Reality Check”
The Trend Experiment.
This is the second part of the trend experiment article series, involving 900 systems and 10 different “smoothing” or “low-lag” indicators for finding out if trend really exists and can be exploited by a simple algorithmic system . When you do such an experiment, you have normally some expectations about the outcome, such as: Continue reading “The Trend Experiment”
경향 지표.
The most common trade method is dubbed ‘ going with the trend ‘. While it’s not completely clear how one can go with the trend without knowing it beforehand, most traders believe that ‘trend’ exists and can be exploited. ‘Trend’ is supposed to manifest itself in price curves as a sort of momentum or inertia that continues a price movement once it started. This inertia effect does not appear in random walk curves. Continue reading “Trend Indicators”
Money and How to Get It.
Contrary to popular belief, money is no material good. It is created out of nothing by banks lending it. Therefore, for each newly created lot of money there’s the same amount of debt . You’re destroying the money by repaying your credits. Since this requires a higher sum due to interest and compound interest, and since money is also permanently withdrawn from circulation by hoarding, the entire money supply must constantly grow. It must never shrink. If it still does, as in the 1930 economic crisis, loan defaults, bank crashes and bankruptcies are the result. The monetary system is therefore a classic Ponzi scheme . Continue reading “Money and How to Get It”
Machine Learning for Trading.
Offered at Georgia Tech as CS 7646.
Nanodegree Program.
Machine Learning Engineer.
Make Predictive Models.
Accelerate your career with the credential that fast-tracks you to job success.
About this Course.
This course introduces students to the real world challenges of implementing machine learning based trading strategies including the algorithmic steps from information gathering to market orders. The focus is on how to apply probabilistic machine learning approaches to trading decisions. We consider statistical approaches like linear regression, KNN and regression trees and how to apply them to actual stock trading situations.
Course Cost.
Approx. 4 months.
Skill Level.
Included in Course.
Rich Learning Content.
Taught by Industry Pros.
Student Support Community.
Join the Path to Greatness.
This free course is your first step towards a new career with the Machine Learning Engineer Nanodegree Program.
Free Course.
Machine Learning for Trading.
Enhance your skill set and boost your hirability through innovative, independent learning.
Nanodegree Program.
Machine Learning Engineer.
Accelerate your career with the credential that fast-tracks you to job success.
Course Leads.
Tucker Balch.
Arpan Chakraborty.
What You Will Learn.
This course is composed of three mini-courses :
Mini-course 1: Manipulating Financial Data in Python Mini-course 2: Computational Investing Mini-course 3: Machine Learning Algorithms for Trading.
Each mini-course consists of about 7-10 short lessons. Assignments and projects are interleaved.
Fall 2015 OMS students : There will be two tests - one midterm after mini-course 2, and one final exam.
Prerequisites and Requirements.
Students should have strong coding skills and some familiarity with equity markets. No finance or machine learning experience is assumed.
Note that this course serves students focusing on computer science, as well as students in other majors such as industrial systems engineering, management, or math who have different experiences. All types of students are welcome!
The ML topics might be "review" for CS students, while finance parts will be review for finance students. However, even if you have experience in these topics, you will find that we consider them in a different way than you might have seen before, in particular with an eye towards implementation for trading.
Programming will primarily be in Python. We will make heavy use of numerical computing libraries like NumPy and Pandas.
Why Take This Course.
By the end of this course, you should be able to:
Understand data structures used for algorithmic trading. Know how to construct software to access live equity data, assess it, and make trading decisions. Understand 3 popular machine learning algorithms and how to apply them to trading problems. Understand how to assess a machine learning algorithm's performance for time series data (stock price data). Know how and why data mining (machine learning) techniques fail. Construct a stock trading software system that uses current daily data.
Some limitations/constraints:
We use daily data. This is not an HFT course, but many of the concepts here are relevant. We don't interact (trade) directly with the market, but we will generate equity allocations that you could trade if you wanted to.
What do I get?
Instructor videos Learn by doing exercises Taught by industry professionals.
관련 코스.
Machine Learning: Unsupervised Learning.
Knowledge-Based AI: Cognitive Systems.
Health Informatics in the Cloud.
Big Data Analytics in Healthcare.
Deploying a Hadoop Cluster.
Segmentation and Clustering.
인기 코스.
Digital Marketing Fundamentals.
VR Software Development.
Artificial Intelligence - Natural Language Processing.
Featured Programs.
Only At Udacity.
Programs.
사업.
"Nanodegree" is a registered trademark of Udacity. &부; 2011–2017 Udacity, Inc.
Udacity is not an accredited university and we don't confer degrees.
Options trading machine learning
It could have easily been called "how i lost 500k with machine learning". Like gambling, it's easy to manipulate statistics to show that you did well in some period of time.
I worked for a large investment bank about 10 years ago, writing trading programs for quant traders who were market makers. The quants called guys like him "retail" investors and they gleefully picked off all those trades. It's how they made all their money.
So, everyone else, beware of making this a case study in how to make lots of money really fast. You are more likely to lose money.
I cannot emphasize how important it is to understand that people who trade using price action (en. wikipedia. org/wiki/Price_action_trading ) are just speculating based on where they expect the price to move. It's no different than people who play Texas Hold'em online and speculate what cards others have based on betting patterns. If you get good at spotting the patterns (like this guy did) you can go on a winning streak, but when the game changes (as it did for this individual after 2009) then you either go home or go broke.
This guy found one edge in 2009. It won him 500k. 환상적. More than any edge ever won me. But, the market has changed so much since then, with HFT becoming so prevalent (theverge/2012/8/7/3226187/high-frequency-trad. ) that please be careful before you follow this course. His code is unlikely to be worth much today unmodified, and when you modify it you'll realize, as I have, that when the other players have access to the order books and can jump the line you have no chance in the game in 2012.
One last nit: Please, please post recent data when you talk about projects like this. 2009-2010 is 3 years ago. Since then there was significant turmoil in the US, Asia, and the EU. How are these returns relevant for today?
To start with, there's simple probability: knowing the odds of making you hand vs. the payoff in the pot, or the chance of winning with various starting hands. This is pretty basic but a lot of low-stakes players screw it up. If you get it right, their mistakes are your gain.
At a more advanced level, game theory comes into play, using bluffs and so on. The game is complex enough that it's not completely solved, and it's an active area of research. The University of Alberta is doing a lot of working developing poker bots using game theory. By playing a good strategy, you can prevent other players from exploiting your patterns.
Only after you've got a good grasp on all that should you really think much about exploiting a particular player's weaknesses. The Alberta guys are doing work on that part too. Exploitative play can improve your profit but also makes you more vulnerable.
For a good overview of this stuff, the book Mathematics of Poker by Ankenman and Chen is a good place to start.
I agree though that HFT is awfully competitive these days. If I had to choose between the two I'd play poker.
So true, and frustrating. But, the legalization of online play could bring back another boom at least for a couple of years.
Poker is "a game of skill with an element of luck" and should not be confused with say, gambling on roulette or the outcome of a coin toss.
But the HFT game changes and you have to keep up. Just as a poker player from 10 years ago would not survive in the game today without adapting his style of play.
I develop algorithmic strategies for a living, and my first reaction to reading your post was skepticism. I'm skeptical for two reasons. (1) because your methods are so unconventional in an industry where convention rules, and (2) because of the time frame of your success, which happened to be one of the more impressive market recoveries in history.
I can't tell you how many people I've worked with who fail to isolate the source of their pnl (myself included at times). This is key. It's important to benchmark your strategy against other stupid ones that you know don't have edge. When someone shows me strategies that worked in 2009 and 2010, I immediately make them prove their strategy was not the equivalent of being long equities.
Doing this will truly help isolate whether or not luck is involved. When you say that the number and size of your trades justifies the strategy's validity, that's just wrong. You could do 1000 trades in a day: buy 10 RUT futures at the beginning of the day, sell 10 at the end, and just scratch 1 lots for the other 998 trades. In a bull market like 09-10, that would have made 400k, and would have nothing to do with Machine Learning or its applications to HFT.
I make all traders benchmark their work against a series of other strategies that I know have no edge, even though they, at times, can appear to have edge.
Now, I'm not saying you didn't have legitimate edge, but you do your readers a disservice by omitting relevant stats and discussions like that.
I was also in this business, and there's nothing unconventional about his methods. It would, in fact, closely describe the methods of more than one shop I'm familiar with. (Except they WERE able to overcome the declines). And the 3-6 month indicator lifetime looks eerily familiar.
And these places are anything but "convention rules" - it's "creativity rules, before our competitors get creative enough".
> When someone shows me strategies that worked in 2009 and 2010, I immediately make them prove their strategy was not the equivalent of being long equities.
Assuming the OP is telling the truth, there is no equivalent "long equities" strategy that would make 1500% profit over 6 months (%3000 annualized), with a max drawdown of 20% ($2000 on $10000 - but his max drawdown was probably closer to 5% than to 20%). You are welcome to demonstrate that there is.
Sounds to me like you are doing low frequency strategies; it's a completely different ballgame than HFT. He's done 400,000 trades, half of them long, half of them short. It might have been luck, and he might have been riding something underlying the equities, but this is NOT equivalent to being long equities. He might have found a way to get non-linear leverage (rather than prediction). But that's also worth a lot of money in the right hands.
> buy 10 RUT futures at the beginning of the day, sell 10 at the end, and just scratch 1 lots for the other 998 trades. In a bull market like 09-10, that would have made 400k, and would have nothing to do with Machine Learning or its applications to HFT.
That may be (I wasn't trading in 2009-2010, and don't remember the movements or the required margins), but that would have had much higher volatility (and days with much more than $2000 loss) than the OP had. (Assuming, of course, he is telling the truth)
2009-10 was more than just a huge rally, it was also a period where vol and skew were massively mispriced. I know this is high frequency, but like I alluded to, you need to make sure that what you're doing isn't replicating the pnl profile of low frequency strategies.
So, how did you perform relative to vol sellers? From the market bottom to the end of 2010, the max daily loss for a vol seller was about 3x average daily pnl, and >80% winners. So your returns do sound better, but not incredibly.
But, even if you failed to perform as well as vol selling did over the same period, that doesn't negate the strategy's validity. If returns were not correlated, then it's safe to say that you weren't just inadvertently shorting vol.
So, start there, work out a regression comparing your daily returns to someone selling vol. Do the same with moving average strategies. Mocking up a simple market making back test versus an ES beta is hard, but that too would be a something to test against. I don't expect you to do any of this, and I'm not going to bother to either. I'm just saying that a complete discussion of this subject would include that information.
At best HFT is a near zero sum game. It isn't creating value for customers. It isn't making the world a better place.
It is an unfortunate flaw of our economic system that so many smart people put so much effort into playing zero sum games with each other.
I know a very good engineer, who used to design innovative chips for 4G/LTE mobile telephony. These chips contributed to the market position of one of today's leading mobile phone manufacturers.
Today, this engineer is designing ASICs for high frequency trading (basically a specialised Ethernet switch, with all extra logic stripped out, so packets go through a few nanoseconds faster).
HFT isn't a zero sum game. It's sucking resources away from productive disciplines into an unproductive discipline, so making a net negative contribution.
Note: by spreads I mean the difference between buy and sell prices. I don't know if there is a special word for it in this context.
Each futures pit used to have hundreds of traders, who required several assistants/support and commanded a huge salary. Many firms needed multiple traders in a pit, just to be able to make sure they could provide liquidity to all possible market participants. Today, a couple strategists with a small team of programmers can cover dozens of futures markets at once.
The same principle holds across bond, FX, equity and options markets alike. HFT has supplanted a terribly inefficient market with a better one. Is it perfect or even good? Probably not, but it's magnitudes better than the traditional method.
With a deep understanding of markets and trading I fail to see why you see 'luck' as an explanatory variable is inversely correlated with the frequency of your trades (notwithstanding the effect of trading expenses)?
From what I have gleaned the following seems to be true: 1. Your algorithms worked (made money) 2. Then your algorithms did not work, but you could not figure out why.
If you do not know why something stopped working it seems unlikely that you had a full understanding of why it was working in the first place. Without understanding the nature of the predictive value of the algorithm while it was working, its success seems to be good fortune.
Your algorithm could have shown a systematic correlation to any number of factors that could have created strong performance over several months. Performance would then be attributed to accidentally 'timing' a favorable market.
I know you feel differently, what am I missing?
And either way - kudos on the $500k.
I'm currently building a semi-high frequency trading solution and the problem I run into is the sheer breadth of expertise you need to get it all happening. Modern chip design, low-latency, lock-free concurrent messaging, fault-tolerant system design, adaptive learning algorithms, k-means clustering and broker APIs are just a smattering of the ideas I'm trying to get across to make progress. For me, algorithm creation comes more easily than reading about and implementing a broker interface.
There is certainly armies of PhDs out there backed by big money but they exist behind heavily guarded intellectual property walls. An open source HFT/Algo/Automated trading platform that brings a hacker sensibility to this problem domain would be seriously competitive.
Perhaps posting the source code would not be a good idea, but posting more details would be welcome so that people interested could follow their own path to automated trading.
You are not wrong, but what you wrote here is applicable to any success story posted on HN.
Caveat lector. Always.
When you think Facebook/Instagram, you think "Damn, those guys got lucky as hell". When you think automated trading, you think, "Hey, it can't be that hard", and start firing up your IDE and rolling out code to talk to an easily provisioned API.
Sure, it may take months to lose your shirt selling a photo service to Face/Goog/Apple. You can lose everything overnight with automated trading.
My father used to trade commodities for a living in the pit at the CME many moons ago, and when I was growing up I would be his technical side when he was trading out of our suburban Chicago home (setting up FM receiver/satellite dish/etc for real time quote data, staying up late nights with him running through trading scenarios in Tradestation on Win3.1 with data downloaded in bulk from Knight Ridder, and so forth).
Something very important I learned from him was: "The market can stay irrational longer than you can stay solvent." With a startup, you can hit bottom. In the right market, bottom is much further down than you can ever see.
I'll take it ad absurdum: You can lose everything in a second by not looking left and right while crossing the road. Or even by looking left and right while crossing the road, when someone else is driving recklessly.
It is possible to attempt HFT with not much more risk than stating a new InstaFaceGoogApple service. Put $10,000 in your margin account, and use a broker that practices proper margin checking. Tada! You're not going to lose more than $15,000 over that. (Yes, you can lose more than you put in your margin account, but not by much).
While that's more, upfront, than InstaFaceGoogApple, it is comparable to the 4 months of salary that you're going to forfeit while building the InstaFace service. And unlike most InstaFace apps, you have immediate market feedback, which can only be a good thing.
Note: Instagram did have immediate feedback from the public at large, forcing them to scale much earlier than they expected - but they did not have a feedback as to the financial value of their proposition. In fact, it wouldn't take much for instagram worth to be zero. Read, e. g. jamesaltucher/2011/02/my-name-is-james-a-and-. - a $100M acquisition back then is like a $300M acquisition in today's valuations; not Instagram but definitely nothing to ignore.
> With a startup, you can hit bottom. In the right market, bottom is much further down than you can ever see.
That's true. But you still have to remember that 90% of startups fail, and of those that succeed, many are just moderately successful. And yet no one keeps yelling "but most startups lose money!" at every HN story.
> When you think automated trading, you think, "Hey, it can't be that hard", and start firing up your IDE and rolling out code to talk to an easily provisioned API.
Which is what we should address, and these "it's a gamble" warning do not. When you see Suzanne Vega singing, you might think "Hey, it can't be that hard to sing". Many people do. And yet, they grow out of it, usually without trying to publish an album (and failing). This should be no different.
The point is you are lured into crossing the road, when you absolutely didn't have to.
In order to open an account with the neccessary infrastructure to engage in HFT one must be an accredited investor (typically means having a net worth of 1 million dollars or more) and the cheapest brokers typically require a minimum deposit of $500,000.
Not to mention the overall costs including hardware, co-location, market data and other vendor costs are on the order of 45-50k a month.
With $10,000 you can't even open up a normal day trading account as the law required a minimum deposit of 25k.
As long as we're quoting Keynes, let's also remember this gem from a letter he wrote to the regents of King's College about the performance of their endowment's portfolio (which Keynes managed).
"The management of stock exchange investments of any kind is a low pursuit, having very little social value and partaking (at its best) of the nature of a game of skill, from which it is a good thing for most members of our Society to be free; whereas the justification of Worlaby and Elsham lies in its being a constructive and socially beneficial enterprise, where we exercise a genuine entrepreneurial function, in which many of our body can be reasonably and usefully interested. I welcome the fact that the Estates Committee-to judge from their poker faces and imperturbable demeanour-do not take either gains or losses from the Stock Exchange too gravely-they are much more depressed or elated (as the case may be) by farming results. But it may be useful and wise nevertheless, to analyse from time to time what is being done and the principles of our policy."
Edit: Worlaby and Elsham was a farm that the endowment owned.
Didn't your father teach you about "Stop orders"
You can't have your algorithm cranking away without supervision. And to be extra sure, lots of testing and LIMITS.
Limit the amount and value of orders.
With stocks, worst case: you lose the face value of stocks in your portfolio.
Derivatives: you can lose more, even 'infinite liability' (still, it's constrained by the stock market inertia)
So I guess they have a role in limiting losses (which had they not been there would be much bigger)
What pains me is just this year I've heard in 3 separate occasions for 3 separate startup businesses people propose "Let's do the Instagram strategy." It may be obvious to you and me how absurd that sounds, but there are a non-trivial number of people who blindly follow headlines.
Edit: I agree with toomuchtodo. It's just too easy to risk with HFT that the warning is needed here more than elsewhere.
The only argument in your comment that isn't your own unfounded opinion is that market makers make money from people who execute trades. But this is true by definition.
The traders who "gleefully picked off all those trades" weren't outsmarting anyone, they were simply profiting from the difference in the asking and offering price in the market. This is the role of a market maker, and actually makes it cheaper for people like OP to execute a large number of trades. So even though this comment sounds like a sensible rebuttal of the linked article, it doesn't really say anything at all.
Again, sorry for creating a negative reply and contributing to a bad tone, but I really the right thing is to call out these kinds of replies. They discourage honest sharing and discussion.
yajoe's comment is an example of how to criticize a post like this in a useful way. news. ycombinator/item? id=4748989.
Given that he might convince other people to engage in high tech gambling in a less-favorable market than the one he operated in, strong words are called for in this case.
(And indeed, living is gambling. It's all just a matter of the risk/reward portfolie).
But jspauld has apparently made $2/trade after fees on 250,000 trading, with a very small standard deviation (I would guess less than $2/trade) - which makes it one of the best businesses one could ever have.
You can't live without gambling - by e. g. going to be a salaried employee for Yahoo rather than Google or that weird newfangled "TheFacebook" thingy back in 2004, was a gamble.
jspauld, statistically speaking, has made less of a gamble there than almost anyone else posting on HN.
> So, everyone else, beware of making this a case study in how to make lots of money really fast. You are more likely to lose money.
참된. But that's true for every single success story posted on HN, reddit, or USAToday.
Because there's a commission on trades, and because you pay taxes on net gains but your minimum tax is zero, high frequency trading by its very nature must a loss for most players.
I was not aware that this is what defines gambling. And "no service produced" is certainly wrong by accepted economic theory - arbitrageurs provide a price discovery service for everyone; they get rewarded for exposing the inefficient prices, even though it is done through market mechanics rather than a specific customer.
OP appears to be a statistical arbitrageur - which is the same concept, except that it includes a shift in time or space (and incurs risk). You might not be interested in this price discovery service, but other people are paying for it with their wallet. (And it's mostly the market makers who pay for this with reduced profits)
> one trader's gain being another trader's loss (relative to market returns).
That's not true in investing in general - when shares have time to appreciate or depreciate, it is definitely not a zero sum game. Everyone can win, or everyone can lose, or anything in between (it all depends on your time range, and your measure of loss or profit. The "non-zero-sum" element arrives partly from companies using operating profit to buy back their own shares).
> Because there's a commission on trades, and because you pay taxes on net gains but your minimum tax is zero, high frequency trading by its very nature must a loss for most players.
That's only true if all players are hf players. If there is sufficient non-HF activity, then the zero-sum argument does not hold.
(I'm not saying that it's not a good approximation - in most time scales, in most scenarios, it is - but it is not the mathematical truth you imply it is)
Again, it's a great approximation most of time and over most time periods and asset classes, but it is NOT axiomatic in the way most people believe it is.
Remember: as long as there is a way to inject or withdraw more capital into the system (through whatever asset class, as they are all interconnected), the sum is not identically zero.
Just assume one of the stocks is a gold mining company that works efficiently. The share value rises, and the shares are redeemable for the gold, without anyone having to lose anything (except mother earth)
It sounds like you are making the argument that this is zero-sum game, but whether something is zero-sum depends on your utility function. If the players are risk averse, then a transaction like buying insurance can yield positive utility for both participants.
Many trading strategies are performing a service in similar (but more complicated) ways.
Most people don't understand that, when you're able to recognize patterns, playing millions of hands while never exposing more than 1% of your bankroll on any deal is not "gambling" but "printing money" (a tiny amount of money in my case compared to consulting but that is not the point).
At the same time the very fact that obviously (seen most of the posts here) most people don't understand basic bankroll management, risk management, standard deviation, expected value, variance, etc. means there are probably quite some opportunities out there to make money for those who do understand that ; )
If I tried to kludge together a definition, I might come up with something like:
>Risking the loss of something of value in exchange for the possibility of gaining something of greater value in a situation where the determining factor of losing value or gaining value is random chance.
The problem with a definition like this is that, as others have pointed out, it applies to vast realms of human endeavor, from founding a company to playing the lottery. It also includes no distinction between risks with a positive expected value and risks with a negative expected value.
If a lottery has ten $1 tickets for sale and each ticket has an equal chance of winning, there is an obvious difference between the prize being $11 and $9, but buying a ticket at either price is just as much "gambling" in the common parlance.
What we really need is a word that only refers to gambling in situations with an expected value less than or equal to zero.
>If a lottery has a total of ten $1 tickets for sale and each ticket has an equal chance of winning, there is an obvious difference between the prize being $11 and $9, but buying a ticket at either price is just as much "gambling" in the common parlance.
I believe we call that gambling.
A UChicago economist and graduate student are walking across campus. The student says . hey . there is a hundred dollar bill on the ground! The economist scoffs and says no there isn't . if there was one, someone must have picked it up already.
Sometimes I catch myself thinking this way. I have to remind myself that (a) markets aren't perfect, and (b) the real world has huge asymmetries in information, ideas, and perhaps willpower (by this, I mean while 100 people might think of a great idea, not all will attempt to implement it; even then, people will differ in execution).
That said, you're likely right. This trading strategy will likely lose money today :-p.
In early 2000s I wrote a machine learning algorithm that beat the S&P 100 with over 1 trillion to 1 odds against it being luck. It predicted a full trading day in advance. But that was all on paper at trading firms' puny costs; unlike you I couldn't beat retail costs. It's amazing that you could do that. For that reason alone I think it's highly likely that you were a skilled monkey.
Also like you, nobody in the industry was interested in my code, even after an industry magazine watched it for 3 months and found it gave "stellar" performance. The few people I was able to discuss it with told me point blank that it was impossible to do it skillfully (efficient market theory), so they assumed it was a hoax or the algorithm was just lucky.
$0.005/share, but that says nothing about overcoming bid/ask. Looks like the OP did that by throwing a bit of market making into the mix.
If your net exposure is small, but that's only because you're offsetting various positions then you're probably picking up nickels in front of the volatility steamroller & if you stay in the market long enough you'll get squashed at some point.
Having said that I can agree that my case is pretty unusual and that everyone should beware of attempting to do something like this. Even for myself I couldn't do it now. (There is a reason I turned my program off.)
How much did you spend before you "tuned" it? How much did you spend afterwards? What were the tax consequences of your trades? Did you make exactly 500k? Have you traded at all since then?
You mentioned that you occasionally "sat in" and took some large losing positions. Were these on purpose? Bugs? Was your exposure actually much higher than you thought? Was limiting contract size enough risk management?
With regard to tuning I may have lost $1000 or so but as I wrote in the article I was able to build a backtesting model that accurately simulated live trading. So once I had that I could basically use it to verify I had sufficient edge to make a profit after covering my commissions.
My risk exposure was very low. When I said large losing positions this meant like $600. But the bottom line is I had a daily stop loss of $3000 enforced at my broker. The most I ever lost was around $2000.
Anyway, there is not really some hidden thing that I am not telling people. It does bug me a bit that your comment is at the top given that it says I'm manipulating statistics and was actually one of the guys that the quants gleefully picked off. I think it's unlikely I traded much with other HFT systems but if I did they certainly lost money.
With a bit of luck and a good partner, this guy could have built a sustainable business.
I think that if someone is a good programmer and has some mathematical chops and has that kind of experience daytrading, taking a shot at automated trading is probably a reasonable thing for them to do. Without all of that background, you're right, they're almost certain to lose money.
Except two things:
1) He didn't lose money, he made 500k.
2) If this worked reliably, you would be out of a job.
Would you dare to "predict" the direction of this FX rate movement in the next month? Then it's a matter of calculating potential profit/loss factor and adjusting your trade value. And yes, as with any high risk investment, putting all your eggs in one bucket is not a brilliant idea. Just like taking all your savings to Vegas.
If you've really worked in that field than it's very surprising you've never heard about what professional poker players call bankroll management (and they "stole" the concept from professional traders).
The whole point is that you can --either if you gain an edge or get lucky-- win big. Very big. But you're never exposing a large part of your funds in the process.
Maybe OP had an overall "stop loss" at, say, $10K. Had he had five minus $2K days in a row at the start, he'd be out. He wouldn't be broke. He wouldn't be without a car and without a bank account. He just would have lost $10K.
But there's no upper limit as to how much you can win.
All you need is discipline and sound bankroll management.
And, yes, I've won a five-digits figure (hence not anywhere near what OP did) real $$$ at online poker. Starting from $0.01/$0.02 small blind/big blind tables and then working my way up using bankroll management.
It's assymetric. You're foolish if you think that succesful traders who won $x were as likely to lose $x. This is simply not how it works and it's very well explained in OP's article. He's detailing what his maximal daily exposure was and it was tiny compared to what he made.
Risk management is probably the single most important thing to understand in trading. Unfortunately, it's something that lots of people learn late, if ever.
Folks get caught up in the romantic notion of betting it all and winning big, but end up losers. Meanwhile, the consistent winners they aspire to be are exposing perhaps 0.2% of their roll at a time.
Though, one thing I think is a bit unique to trading is prevalence of folks who preach without practicing. Just about anyone with a brokerage account can rattle off the same short list of critical do's and don'ts, but very few actually follow them.
With my program I didn't really have bad streaks because my P&L was averaged out over thousands of trades per day.
I played HUSNGs for a living for several years, and I could play three tables at a time (about 9 games per hour) with a 60% winrate. That's incredibly low variance--my graph over the long-term was better than a 45 degree incline.
This is really cool, any way you cut it.
With a quick bit of R code, we can simulate his PnL over 120 days multiple times, assuming he has no skill, and see what the probability of him being up 4k/day is. I'll use a t-distribution with 3 degrees of freedom, which allows big up and down swings (again, accentuating the effect of luck).
That is, there's a zero percent chance that he would have made those returns if he had no skill. And remember that this simulation is overestimating the effect of luck.
I'm thinking back to Garry Kasparov's piece in the NY Book Review a couple years back: nybooks/articles/archives/2010/feb/11/the-che.
He talks about a chess tournament in which it was "anything goes". competitors could be human, computers, or humans with computers. The expected outcome was that a grandmaster using a Deep Blue-like computer would win, but the winners ended up being a couple of amateurs with three computers:
> The surprise came at the conclusion of the event. The winner was revealed to be not a grandmaster with a state-of-the-art PC but a pair of amateur American chess players using three computers at the same time. Their skill at manipulating and “coaching” their computers to look very deeply into positions effectively counteracted the superior chess understanding of their grandmaster opponents and the greater computational power of other participants. Weak human + machine + better process was superior to a strong computer alone and, more remarkably, superior to a strong human + machine + inferior process.
So in HFT, how much room is there for an amateur to profit over professionals by having a sophisticated process?
HF traders are just as much hackers as anyone on HN (and there are plenty of HF traders on HN). So 'theoretically', they've already done what is being suggested here. If someone comes along and develops a winning strategy, it really shouldn't be considered as having anything to do with 'professional strategy vs novice strategies'. It would just be about one person either getting really lucky or coming up with something that is genius in its own right.
If there are 'professionals' and then other 'professionals' whose strategy depends on information about how other 'professionals' trade (and there is), you end up with strategies at all valid points in the sample space of possible strategies and counter strategies. Theoretically, there should be no other possible strategies. Inevitably someone will come up with one though, and the 'sample space' will grow. But its extremely unlikely that additional unique strategies are successful just because they 'counter' the strategies in the sample space. But then again, this is real life and these things aren't impossible.
I developed a fully-automated low-frequency stat arb system that I ran in 2007 based on a perhaps even simpler algorithm. It traded various equities equally to the long and short side regardless of market conditions so widespread rally or collapse was irrelevant. I logged about 20-30 trades/day - much slower.
The results, using no leverage, were +90% in a year with a worst drawdown of 2% and a Sharpe ratio of 2. Total trades were 5000+. Month-to-month the results were very consistent until the uptick rule was nixed in July 2007. August 2007 was a record winner for me, but Sept-Dec 2007 fell flat, not losing, but with greatly diminished profits and the same variation and more frequently getting slammed all-long or all-short instead of a mix that was often near-neutral. Also getting fills better than my orders then completely disappeared, as this was the beginning of the HFT middlemen - including your own brokerage. I shut it down at the start of 2008, keeping the profits intact and moving on to other priorities.
I continued to monitor the theoretical results for a couple of years but the conditions didn't return so I eventually cancelled my data feed.
I consider HFT to be any strategy where speed itself is the what gives the edge. Colocation is usually a prerequisite, though not sufficient. It's a shame HFT gets all the attention, when it's really a tiny portion of trading activity. Algo-trading in general is 70%+ of market activity in the US.
Also limiting trades isn't really adequate risk management. The tech exists to very accurately model your exposures. This is something I see underdeveloped a lot, and what separates the top trading firms from the rest.
Still I commend you creating a model, working out how to test and execute it automatically and actually trading your own money.
I really think more hackers should be actively managing their money, (in general, not like in the article). We have these amazing liquid markets, all time low spreads/commissions, products like ETFs/derivatives to accurately and cheaply execute a given strategy, and a huge increase in tech to model risk, but personal personal investing is the same as the 60s.
In Europe, HFT is mostly what OP describes, because they have reasonable control (e. g., you have to have one execution per 10 orders or pay a fine; in US exchanges, you can sometime finds 10,000 orders submitted in 3 seconds, hundreds of thousands per hour, with 10-20 executions).
> Also limiting trades isn't really adequate risk management. The tech exists to very accurately model your exposures.
That's basically what AIG did with copulas. Unfortunately, the assumptions in these models tend to break during crisis, when correlations go to one. And AIG went bankrupt.
Limiting trades, done correctly (mathematically AND legally) is the ONLY way to do risk management properly. With more assumptions, you can have "more efficient" risk management in terms of leverage (e. g., you can net S&P and RUSSELL exposure by assuming their correlation structure) - but as AIG has shown, that does not mean you are doing a better job of managing your risk.
silly example, 100 small positions could be less risky than 1 large position or, 1 long, and 1 short trade will cancel each other out and create a riskless portfolio (with 0 return).
You need to have a risk budget, account for each trade, and work out the risk for the composite portfolio. Obviously this is not fool proof, but it's a way better approximation of the real world.
예. And assumptions about this are bound to break at the most inopportune moment, see e. g. AIG, which I already referred to. Read about the "copula model" disaster, as your statement indicates you are unaware of its details. en. wikipedia. org/wiki/David_X._Li#CDOs_and_Gaussian_.
> 1 long, and 1 short trade will cancel each other out and create a riskless portfolio (with 0 return)
This is true if and only if the long and short are in the same exchange, AND exchange rules allow netting long vs. short deterministically. Otherwise, you have counterparty risk. E. g., you can be long SPY and short SP contract (in equal underlying), which would theoretically mean your only exposure is interest rate changes (and sometimes not even that!)
However, since this is in different exchanges, it might happen that during a flash crash, your SPY position will be liquidated for insufficient margin at a low price, but then the price bounces back, and you've lost money on a perfectly hedged position.
OP's model (limiting exposure and assuming the worst, if I understand correctly) is not statistically efficient use of margin, but it's way better at actually managing risk than any statistical model.
very interesting, a spike in sept-dec 2009 that roughly follows his PNL.
But, every time I've tried to actually get started, I've always found the amount of research required before being able to begin is just staggering.
It seems like the logical course of single-programmer HFT trading being:
- Find sample data.
- Build your trading program using sample data.
- When you're happy: connect to live API and set your trading program loose.
However, the first step and the third step seem like the ones which require the most research.
Is there somewhere which has a straightforward dump of timestamped market data available to download (free or not), in order to actually develop a working program?
Likewise, figuring out what to actually trade with, and which service to use is also pretty taxing.
If the easy part was building a working model either you got incredibly lucky or the model is wrong.
Symbols change, stocks split, dividends are announced etc.
The one interesting point that he glossed over is what his indicators were. He wrote, "The indicators that were most useful were all relatively simple and were based on recent events in the market I was trading as well as the markets of correlated securities."
Which doesn't really tell you much.
But for anyone coming to HFT from a coding background instead of a trading background, an explanation of one of your indicators would have been fascinating.
Worst case he runs out of capital over a period of weeks.
He can't blow up in the way that you think - but he can have large drawdowns over a period of weeks.
Markets are eventually consistent scalable systems - and that is why we prefer them over central planning. In the medium term they prices things correctly, cheaply and efficiently (decade+).
In the short term however (sub-decade) - they can't price jack.
Markets are inefficient period - if they weren't, well then P=NP and you could just put your NP-hard problems into a market and get back cheap, quick, accurate results. Oh - wait - protein folding is actually harder than that.
There are 2 major ways to make money in the markets. Value-Growth and statistical arb (often high frequency). The former (Buffett) is highly concentrated bets on the future of business (I'm value - long TSLA/GOOG/Samsung). The latter is looking for thousands of small diversified statistically significant correlations above 50% (random guesses) and trading costs between securities/price movements over short time intervals (aka statistical ghosts in the data - RenTech/Shaw).
Both work. Both work well. And will continue to do so as long as markets exist.
Making $500K on $100K over 6 months is good business.
예 : if you made 10% when overall market was up 15% for the year, you have negative alpha. [As someone could have bought index and held it through year to generate better return]
If you made 20% when market was up 10%, you have positive alpha.
That is why everyone in the investment community is 'seeking alpha'.
So the fees will be $3950 - $15,800 per day.
$15,800 - $79,000 per week.
And he surely wasn't paying retail prices - you can go down to around $0.50/future if you know what you are doing.
(In general, futures have 1:5 to 1:20 leverage)
$500 - 2,000 per day.
$2,500 - 10,000 per week.
$130,000 - $520,000 per year.
That's just the fees. He must make that much just to break even. If you can make that much starting with $30K, you're a supermotherfucking genius.
One "tick" (minimal movement) is worth 12.5 EUR. At volume you pay 0.5 EUR, IIRC, but let's assume you pay 1 EUR in fees, everything included.
If you bought and sold at the same price, you lost 1 EUR/trade. This is the cost of business.
If you bought, and sold after a favorable 1 tick movement, (e. g. bought at 4013.0 and sold at 4013.5), you're 10.5 EUR richer - 12.5 on the difference, minus 1 for each trade (one buy, one sell).
If you bought and sold after an unfavorable one tick movement (e. g. bought at 4013.5 and sold at 4013.0), you're 14.5 EUR poorer - 12.5 on the difference, and 1 for each trade (one buy one sell).
OP averaged $2/trade over 200,000 trades; that means he had 2/3 right calls, and 1/3 wrong calls or so if he only traded dax and only had 1 tick moves.
He was very smart, but you're looking at it wrong - the fees are the cost of doing business, much like salaries are the cost of producing software. In finance, you rarely care about revenue or "notional" (which can easily run into the trillions per year for a small trader - for.
1 eur, you get 75,000 eur in notional value on the dax).
You just roll the fees up-front into your choices when thinking about it, and it all makes much more sense.
(Not trying to take away from OPs very commendable achievement - just trying to give the common perspective on how to view this)
The biggest issue is the confusion that you can apply machine learning to HF trading. HF trading sub 15min mark is more about playing the deal flow, and only the institutions have an edge on this. This is why goldman had to separate the buy and sell sides in the early 2000's. Above 15mins you are able to find an edge using time series analyses since the market is scaling invariant according to Benoit Mandelbrot and this does not apply to dealflow. Also having access to dealflow allows you to predict volatilty seconds ahead which allows you decrease your risk and increase you reward as well as handle your costs since the volatility will impact your transaction costs even if transaction costs themselves stay the same. There is just so much stuff to cover that a comment will not do justice in explaining what is wrong with this guys logic.
Survivorship bias would mean I simply got lucky. If you're going to say that you're at least going to need to look at my P&L charts and say how I could possibly achieve that much success with luck alone.
Finally, machine learning has everything to do with my success. There were hundreds of variables in my algorithm that were ALL optimized using ML. If you read the article you would know that I built an accurate model for backtesting that I used to optimize variables as well as confirm that I was going to make money before I even started live trading.
I'm pretty confident that whatever you were doing in 2004 has nothing to do with what I was doing.
Why doesn't every hacker do this to make extra money? Is it within the grasp of anybody who can program to automate trading like this?
EDIT: Sounds like it's not really for everybody. You have to own or rent a server with access to direct lines to the exchanges, or else your lag will be such that profiting from HFT is impossible. How much do these cost?
A profitable predictor is a much, much harder problem.
At a place like Goldman Sachs, a quant with a working predictor gets paid 5 times as much as the IT guy who makes that predictor talk to the market quickly enough.
Because, as your question implies, it is (relatively) easy to do the IT work or hire someone to do it. Not so for the predictors.
Once you have the assets and capacity to actively manipulate the price of any stock at will, the market is a VERY different animal and no longer need to be understood at all. You simply force its hand.
I wondered the same thing and tried to answer it for myself not that long ago.
In short, it's hard, time-consuming, stressful and costly.
1) Your code has to work going forward. Coming up with something that works in backtesting is easy, doing it moving forward while staying within your risk envelope and considering all the associated costs is hard.
2) Closely related to #1. Whatever you put together is surely going to need plenty adaptation and oversight. It's a very fluid problem, you're just one player among countless others. How much time do you have in the day? Where is your capital coming from? For most people, the source of capital is a job that they probably can't ignore while fiddling with a trading program that would have to be remarkably successful to replace that income.
3) Everything costs money. You need a certain amount of capital to start with and there are all sorts of running costs. From the basic costs of execution, to market data and eventually co-location if you get that far. The fact that the OP kicked off with an amount that's essentially the barest minimum for any kind active trading is exceptional.
4) Can you maintain discipline and continue executing on all of the above while losing money? How many people struggle to simply get up on time, control their desire to check a particular website or to get over and move on from some frustration? Even if there's automation involved, trading will test your mental fortitude.
I have flirted with HFT in a hobby-like manner and it isn't the programming that will get you the money, it is the domain specific knowledge coupled with the programming. On top of that, there are quite a few risks and potential to lose a lot of money.
2.)Finding a good predictor. Predicting up or down is easy on paper. Finding a predictor that a.)beats the spread, b.)factors in lag time to execution, and c.)factors in commission, is hard.
3.)Market regime changes. What works a few months ago isn't guaranteed to work now.
"I was making a lot of money but now I've stopped" is the same thing as "I was lucky until I wasn't". Making a living by gambling pretty much sucks, which is why most hackers don't do it.
(You'd think that something as complex as markets would attract hackers trying to "figure it out". The problem is that due to the changing nature of the other participants, all hacks are temporary. Makes for great blog posts, but not a long term strategy.)
If you are relying on a broker-supplied pricefeed over the internet you are far outside the real of what is traditionally understood as "High Frequency Trading".
You talked about programming hotkeys (and then automating the hotkeys) so I assumed this was running on your desktop.
Would be even more awesome if you could share some code on github.
(former TT employee)
What does it depend on?
If he posts the code, you're a long way from running it.
If the tools work, sell them. If they don't, tweak them, try it again, and sell them until they do.
This is risk management.
It is a software implementation of the Viable System Model (VSM), a model for autonomous systems developed by Stafford Beer. It provides structure, communications, auditing and alerting for autonomous systems.
Part of it is base code for dealing with stocks and options, treating securities positions as autonomous systems that have the scaffolding for running simulations on themselves. It's in Smalltalk and runs under Squeak and Pharo. It can be found at:
I won't try to advertise it as a complete solution, but it might be the start of one.
Automated trading is more on strategy, while HFT has more to do with volume and speed. With automated trading, you predict price movements. HFT involves being a liquidity provider. You don't use market technical indicators in HFT, you wait for some really huge orders.
HFT firms won't bother him. Those are dealing with an entirely different set of algorithms. He should have contacted brokers instead.
even though its over 10 years old, is real HFT. moving correlations, windowed FFT (of bid and transaction events), microscopic operators, negative first-order autocorrelation of returns.
it is NOT about supplying liquidity or being a market maker. that's just market makers trying to say they are in on the latest trend.
Seriously though, there are some existing frameworks and products that you could check out. I haven't used this myself, it's just in my bookmarks:
And a low level library for data analysis: pandas. pydata. org.
Oh, I forgot about another backtesting framework for python. It has a built in IDE as well.
Zipline was unveiled at PyData NYC, and the presentation materials are here: app. quantopian/posts/hello-from-pydata.
Were you compounding the data always, or telling it to forget what was going on several months ago? Or somewhere in between?
(I'm pretty unfamiliar with machine learning, apologies if this is obvious or something)
zero. The article doesn't seem to expound on that unless I missed something.
Is this a result of bots on the other side adapting in some way to what you were doing? I would have thought you would be too small a player for them to notice.
We cannot even tell if $500k is a good risk adjusted return - we have no information on volatility, nature of the exposure or most importantly how much money he started with?
Not exactly shocked Jim Simons didn't return his . But completely shocking that he walked away from a successful automated trading strategy. the only thing rarer than a free lunch is a man willing to walk away from one. suspect.
2. Author has stated elsewhere than he began with $10k in seed capital.
3. The "bullish" market you cite increased only about %70 in that timeframe while the author's returns were multiples of that number.
4. Author walked away from a _previously successful_ strategy that no longer produced profits. His montlhy returns went to nearly zero so he stopped.
Edited to fix numbers.
It is of course possible that once you made "real" money with your algorithm it was spotted by the other algorithms which then started working against it. (Aka exploiting it) Having talked with people in that space (hft) I was left with the impression that an insane amount of analysis was done on those trades.
Other than sheer luck, the most plausible explanation for your diminishing returns is that you found a strategy that worked _at that point in time_, other people copied it (starting with your broking firm), and as that strategy became more common your ability to make money disappeared.
I work in the industry, this happens all the time. Trading strategies have a shorter half life than you may think.
A lot of people in the business would pay e. g. $5,000 for exclusive rights for something that worked this well in 2009 (with proof that it worked in 2009, e. g. verifiable broker statements), and a smaller amount (say, $5,00) for non exclusive rights.
If he claimed it still works but he wants to sell it, it is a completely different game -- because when these things work, they are cash cows.
If you want to go back to trading, you'll probably have to actively try to get a job -- at the very least, let someone who's still in the business know that you are looking. In my experience in this field, word of mouth and friends-of-friends are infinitely more successful hiring strategies, for both sides.
(Re:releasing the source - I would like to have a look at the strategy, but I would recommend against releasing anything that is even close to being useful, unless you want to spend the next year screening "where can I get a good XTAPI broker" and "I've got XTrader_PRO set up, but I'm getting error 10013, what gives?" s).
the Nuclear Phynance message board is probably a better place to look for business offers.
I traded stocks and Forex for years and my experience says, it is not for everyone. What ever indicators, discipline or model you follow it is going to work only if you have the right intuition or luck!
Could you explain this part, specifically what do you mean by "bucket"?
"To accomplish this I tracked predicted price moves in 50 buckets that depended on the range that the indicator value fell in. This produced unique predictions for each bucket that I was then able to graph in Excel. As you can see the expected price change increases as the indicator value increases."
Could you explain this part, specifically what do you mean by "bucket".
"To accomplish this I tracked predicted price moves in 50 buckets that depended on the range that the indicator value fell in. This produced unique predictions for each bucket that I was then able to graph in Excel. As you can see the expected price change increases as the indicator value increases."
If the market dives and you quickly get into a big long position, and then it dives some more - what do you do? You can either close out your losing trade and take the loss, or hope that the market comes back up, all the while holding on to the risk of further losses.
Also, there's no guarantee that trades in the middle of a flash crash will remain valid after the crash. The exchange could nullify all trades in a certain period of time, which would completely wipe out your upside potential.
This is the most important thing: In every single "flash crash", the exchanges have retroactively canceled trades, in a rather arbitrary manner (e. g., "every trade between 16:30 and 16:38 is null and void"). There is some underlying justification, but it is also arbitrary (e. g., "anything below 3% of the price when the flash crash started", with no specific justification for the 3% number, or a well defined methodology for the time of the crash).
That could easily turn a +$100K profit into a -$500K profit, depending on circumstance.
In the Flash Crash as well as the Knight Capital incident "up/down 30% from the Previous Close" was the price collar (anything outside that was busted and anything inside stood).
Of course there is no guarantee that the same criteria will be used the next time around so caveat emptor.
edit: I found what I was looking for in the comments.
PS: no sarcasm intended, it truly is an excellent advert.
1. when you have a good system (even one you cannot "improve" further), you don't talk about it. 2. You don't just stop using it.
Comments
Post a Comment