Wednesday 14 March 2018

자유 신경망 외환 거래


뉴런 네트워크는 이익을 예측합니다. 신경 네트워크는 인간 두뇌의 기능에있어 특정 주요 측면을 모방하는 최첨단의 훈련 가능한 알고리즘입니다. 이 기술은 고유 한 자체 트레이닝 능력, 분류되지 않은 정보를 형식화하는 능력 및 대부분의 기능을 제공합니다 중요한 것은 예측할 수있는 과거 정보를 기반으로 예측을 수행 할 수있는 능력입니다. 신경 네트워크는 예측 및 마케팅 리서치 솔루션을 비롯한 다양한 비즈니스 애플리케이션에서 점점 더 많이 사용되고 있습니다. 사기 탐지 또는 위험 평가와 같은 일부 영역에서는 논쟁의 여지가없는 지도자 신경망이 응용 분야로 사용하는 주요 분야는 재무 운영, 기업 계획, 거래, 비즈니스 분석 및 제품 유지 관리입니다. 신경망은 모든 종류의 상인이 유익하게 적용 할 수 있습니다. 신경망에 도입 된이 기술 분석 방법을 통해 우리를 이끌어 갈 방법을 보여줄 것입니다. 대부분의 사람들은 신경 네트워크에 대해 들어 본 적이 없으며 상인이 아니라면 자신이 무엇인지 알 필요가 없을 것입니다. 그러나 정말로 놀랍습니다. 그러나 많은 사람들이 신경 네트워크 기술로 풍부한 혜택을 누릴 수 있습니다. 심지어 들어 본 적도없고, 높은 과학적 아이디어로 받아들이거나 매끄러운 마케팅 기법으로 생각할 수도 있습니다. 신경 네트워크에 대한 모든 희망을 고정시키고, 긍정적 인면에서 그물을 라이오 네이트하는 사람들도 있습니다 그 (것)들과 가진 경험 및 어떤 종류의 문제든지에은 탄알 해결책으로 그 (것)들에 관하여 그러나 어떤 무역 전략든지 같이 신경 네트워크는 단추 또는 2 개를 눌러 부유 한 그것을 치는 것을 허용 할 빠른 해결책이 아니다. 실제로, 정확한 이해 신경 네트워크의 목적은 그들의 성공적인 적용을 위해 매우 중요합니다. 거래와 관련하여, 신경 네트워크는 사고 방식을 취하는 사람들을위한 새로운 기술적 분석 방법입니다. 자신의 비즈니스에 도움이되며, 이 방법을 사용하기 위해 시간과 노력을 기꺼이 투입 할 수 있습니다. 올바르게 적용하면 신경망이 정기적으로 수익을 창출 할 수 있습니다. 기회를 발견하기 위해 신경망 사용 많은 오해 특정 시장 상황에서 행동하는 방법에 대한 조언을 제공 할 수있는 예측 도구를위한 신경망 신경망은 어떤 예측도하지 않고 대신에 가격 데이터를 분석하고 기회를 발견합니다. 신경 네트워크를 사용하여 철저히 분석 된 데이터, 전통적인 기술 분석 방법을 사용할 때 반드시 필요한 경우는 아님 심각한 생각을 가진 상인의 경우 신경 네트워크는 다른 기술 분석 방법으로는 불가능한 미묘한 비선형 상호 의존성 및 패턴을 감지 할 수있는 잠재력이 큰 차세대 도구입니다 Best Nets 훌륭한 제품이나 기술과 마찬가지로 신경 네트워크는 모든 것을 끌어 들이기 시작했습니다. l 싹 트는 시장을 찾고있는 사람들 차세대 소프트웨어에 대한 급류의 광고는 시장에 넘쳐났습니다. 가장 강력한 모든 신경망 알고리즘을 축하하는 광고 드문 광고 주장이 진실과 비슷할 때조차도, 효율성의 10 증가는 아마도 신경 네트워크에서 얻을 수있는 가장 큰 것입니다. 즉, 기적적인 수익을 내지 않으며 특정 상황에서 얼마나 잘 작동하는지에 관계없이 일부 데이터 세트 및 작업 클래스가있을 것입니다. 이전에 사용 된 알고리즘이 우수한 것으로 남아 있음 트릭을 수행하는 알고리즘이 아니라는 것을 기억하십시오. 타겟 인디케이터에 대한 잘 준비된 입력 정보는 신경망 성공에있어 가장 중요한 구성 요소입니다. 더 빠른 수렴성이 더 낫습니다. 이미 신경 네트워크를 사용하는 많은 사람들 실수로 자신의 넷이 더 빨리 결과를 제공할수록 더 좋다는 것을 믿는다. 그러나 이것은 망상이다. 좋은 네트워크는 결정되지 않았다. b. y 결과를 산출하는 속도와 사용자는 네트워크 열차 속도와 생성 된 결과의 품질 간의 최상의 균형을 찾는 법을 배워야합니다. 신경망의 올바른 적용 많은 거래자는 신경망을 너무 많이 배치하기 때문에 잘못 적용합니다 그들이 제대로 사용하는 방법에 대한 적절한 지침을 제공하지 않고 모두 사용하는 소프트웨어에 대한 신뢰 신경 네트워크를 올바른 방법으로 사용하고 유익하게, 상인은 네트워크 준비주기의 모든 단계에주의를 기울여야합니다. 생각을 발명하고, 아이디어를 형식화하고, 테스트하고 개선하며, 더 이상 유용하지 않을 때 처분 할 적절한 시점을 선택하는 책임을 맡은 그물망이 아니라 상인입니다. 이 중요한 과정을보다 자세히 설명합니다 .1 트레이딩 아이디어 찾기 및 공식화 트레이더는 자신의 신경망이이기는 트레이딩 아이디어 및 개념을 고안하지 않아야 함을 완전히 이해해야합니다. 귀하의 거래 아이디어 또는 개념이 얼마나 효과적인지에 대해 가장 신뢰할 수 있고 정확한 정보를 제공하기위한 것입니다. 그러므로 귀하는 원래의 거래 아이디어를 제시하고 아이디어의 목적을 명확히 정의하고 그것을 사용함으로써 달성하고자하는 것을 명확하게 정의해야합니다. 네트워크 준비주기의 가장 중요한 단계 관련 독서는 Trader 's Diary의 교훈 2 모델의 매개 변수 개선 다음으로 사용되는 데이터 세트를 수정하고 다른 매개 변수를 조정하여 전체 모델 품질을 향상시켜야합니다. 그림 1 최적화 알고리즘 및 특성 지정하기 3 쓸모 없을 때 모델 처분 모든 신경망 기반 모델에는 수명이 있으며 무기한으로 사용할 수 없습니다 모델 수명의 수명은 시장 상황 및 방법에 따라 다릅니다. 오래도록 시장의 상호 의존성이 국지적으로 남아 있습니다. 그러나 조만간 모델이 폐기 될 것입니다. 완전히 새로운 데이터 즉, 사용 된 모든 데이터를 바꾸거나 기존 데이터 세트에 새로운 데이터를 추가하고 모델을 다시 훈련 시키거나 간단하게 모델을 폐기하는 등의 방식으로 모델을 교체하십시오. 대부분의 거래자는 가장 간단한 경로를 따르는 실수를 저지릅니다. 그들은 소프트웨어에 가장 사용자 친화적이고 자동화 된 기능을 제공하는 접근 방법을 많이 사용하고 있습니다. 가장 간단한 방법은 가격을 몇 막대로 예측하고 거래 시스템을이 예측에 기초하는 것입니다. 다른 거래자는 가격 변화 또는 가격 백분율을 예측합니다 변화 이러한 접근법은 가격을 직접 예측하는 것보다 좋은 결과를 거의 얻지 못합니다. 단순한 접근법은 중요한 장기 상호 의존성의 대부분을 밝히지 않고 유용하게 활용하지 못하고 결과적으로 글로벌 추진 동력이 변화함에 따라 모델이 신속하게 쓸모 없게됩니다. 뉴럴 네트워크를 사용하기위한 최적의 전반적인 접근법 성공적인 거래자는 관리에 집중하고 상당한 시간을 할애합니다. 자신의 신경 네트워크에 대한 항목을 입력하고 매개 변수를 조정합니다. 최소한 몇 주 (때로는 최대 몇 개월) 동안 네트워크를 배치해야합니다. 성공적인 상인은 인생 전체의 변화하는 조건에 맞게 네트워크를 조정합니다 span 각 신경 네트워크는 시장의 상대적으로 작은 부분만을 커버 할 수 있기 때문에위원회에서 신경 네트워크도 사용해야합니다. 적절하게 많은 신경 네트워크를 사용하십시오. 한 번에 여러 개를 고용 할 수있는 능력이이 전략의 또 다른 이점입니다. 이러한 다중 네트 각각은 시장의 특정 측면을 담당 할 수 있으므로 보드 전반에 큰 이점을 제공합니다. 그러나 사용하는 넷의 수를 5 ~ 10 범위 내로 유지하는 것이 좋습니다. 마지막으로 신경 네트워크 고전적 접근 방식 중 하나와 결합해야합니다. 이것은 거래 환경 설정에 따라 달성 된 결과를보다 잘 활용할 수있게 해줍니다. 결론 귀하는 당신이 최고의 그물을 찾기를 그만 두었을 때만 신경망으로 진정한 성공을 이끌어 내라. 결국, 신경망으로 성공하는 열쇠는 네트워크 그 자체가 아니라 거래 전략에 달려있다. 그러므로 당신에게 유익한 전략을 찾으려면, 당신은 신경 네트워크의위원회를 만드는 방법에 대한 강력한 아이디어를 개발하고 고전적인 필터와 돈 관리 규칙과 함께 사용하는 방법을 개발해야합니다. 관련 독서, 수익성 신경 트레이닝 생물 학적 키 및 코딩 시스템 Tutorial. Licensed 사용자 센터를 체크 아웃 트레이딩 솔루션은 신경 네트워크 및 유전자 알고리즘을 사용하여 기술 분석과 인공 지능 인공 지능 기술을 결합하여 과거 데이터의 패턴을 학습하고 시스템 매개 변수를 최적화합니다. 이 거래 소프트웨어는 주식, 선물, 통화 외환 및 기타 금융 도구와 함께 작동합니다. 또한 미국 및 국제 시장을위한 시스템을 구축합니다. 가장 인기있는 tec 중 300 개가 넘습니다 입증 된 샘플 및 고객 실적. eSignal Interactive Brokers 등의 업계 선두 데이터 지원. 독점적 인 최적 신호 기술. 무료 기술 지원 .100 무료 시스템 및 사전 구축 된 신경망 모델. Trader68 표준 자동 거래 소프트웨어의 무료 가입. 전세계 66 개국 이상에서 성공적으로 사용되었습니다 .30 일 환불 보증. 라이센스 사용자 센터는 TradingSolutions를 사용하여 인텔리전스를 제공합니다. TradingSolutions는 신경망 및 유전 알고리즘을 사용하여 기술 분석과 인공 지능 인공 지능 기술을 결합하여 과거 데이터의 패턴을 학습하고 최적화합니다. 시스템 매개 변수이 거래 소프트웨어는 주식, 선물, 화폐 FOREX 및 다른 많은 금융 수단과 함께 작동합니다. 또한 미국 및 국제 시장을위한 시스템을 구축 할 수 있습니다. 가장 인기있는 기술 지표 300 개 이상. 입증 된 샘플 및 고객 성과. eSignal 대화 형 중개인 및 더 많은 . 독점적 인 최적의 신호 기술. 무료 기술 지원 .100 무료 시스템 및 사전 구축 된 신경 네트워크 모델. 전세계 66 개국 이상에서 성공적으로 사용되었습니다 .30 일 환불 보장. 하이브리드 신경망 Forex에 대한 중지 및 역전 전략. 마이클 R 브라이언트 (Michael R Bryant). 신경망은 수년간 다양한 수준의 성공을 거두어 거래 시스템에서 사용되어왔다. 그들의 주요 매력은 비선형 구조가 표준 지표 기반 거래 규칙보다 가격 이동의 복잡성을 더 잘 포착 할 수 있다는 것이다. 신경망 기반 거래 전략은 지나치게 적합하고 새로운 데이터에 대해서는 잘 수행하지 못하는 경향이 있습니다. 이 문제에 대한 가능한 해결책은 신경망을 규칙 기반 전략 논리와 결합하여 하이브리드 유형의 전략을 만드는 것입니다. 기사는 이것이 Adaptrade Builder를 사용하여 어떻게 수행 될 수 있는지 보여줄 것입니다. 특히, 이 기사는 트레이드 엔트리에 대한 다음의 신경망과 규칙 기반 논리를 설명 할 것입니다 최종 전략의 유효성을 검증하는 데 사용되는 세 번째 세그먼트 데이터 접근법이 사용됩니다. MetaTrader 4 및 TradeStation의 결과 전략 코드가 표시되며 유효성 검사 결과가 각 플랫폼에 대해 긍정적임을 입증합니다. 수학적으로, 신경망은 하나 이상의 출력 값을 생성하는 하나 이상의 가중치 입력의 비선형 조합입니다. 거래의 경우, 신경망은 일반적으로 미래 가격의 예측으로 두 가지 방법 중 하나로 사용됩니다 이동, 또는 거래를위한 지표 또는 필터로서의 2 여기에서, 지표 또는 거래 필터로서의 그것의 사용이 고려 될 것이다. 지표로서, 신경망은 거래가 진입하기 전에 충족되어야하는 추가적인 조건 또는 필터로서 작용한다 네트워크에 대한 입력은 전형적으로 모멘텀, 스토캐스틱, ADX, 이동 평균 등과 같은 다른 기술적 인 지표와 앞선 가격 및 조합입니다. 입력은 크기가 조정됩니다 신경망은 출력이 -1과 1 사이의 값이되도록 설계됩니다. 하나의 접근법은 출력이 임계 값보다 크거나 같으면 긴 입력을 허용하는 것입니다 (예 : 0 5). 출력은 임계 값의 음수보다 작거나 같습니다. 예 : -0 5이 조건은 기존 입력 조건에 추가됩니다. 예를 들어, 입력 조건이 길면 참이어야하고 신경망 출력은 신경망을 설정할 때 상인은 일반적으로 입력 및 네트워크 토폴로지를 선택하고 최적의 가중치를 결정하는 네트워크를 교육해야합니다. 아래에 나와있는 것처럼, Adaptrade Builder는 소프트웨어가 기반으로하는 진화 적 빌드 프로세스의 일부로 이러한 단계를 자동으로 수행합니다. 신경망을 거래 필터로 사용하면 다른 규칙과 쉽게 결합하여 하이브리드 트라 인을 생성 할 수 있습니다 g 전략, 전통적인 규칙 기반 접근법의 가장 좋은 기능을 신경 네트워크의 장점과 결합하는 간단한 예제 간단한 방법으로 Builder는 이동 평균 크로스 오버 규칙을 신경망과 결합하여 빠른 이동 느린 이동 평균과 신경 네트워크 출력 이상 평균 교차점은 임계 값 이상입니다. 정지 및 역방향 거래 전략. 중지 및 역방향 거래 전략은 항상 길거나 짧은 시장에 항상있는 전략입니다. 엄밀히 말하면 , 정지 및 반전은 중지 주문이 부딪혔을 때 거래를 취소한다는 것을 의미합니다. 그러나 장거리에서 단거리로 반전되는 모든 거래 전략을 간략하게 사용하므로 항상 시장이 정의에 따라 주문이 정지 주문이 될 필요는 없습니다. 시장 또는 제한 주문을 사용하여 입력 및 반전 할 수도 있습니다. 각 측에서 동일한 논리 또는 동일한 주문 유형을 사용할 필요는 없습니다. 예를 들어, 너는 할 수 있었다. stop order에 short와 exit를 입력하고 각각의 entry exit에 대해 다른 규칙과 조건을 사용하여 short를 입력하고 시장 주문에 대해 긴 시간으로 빠져 나오십시오. 이것은 비대칭 stop-and-reverse 전략의 한 예일 것입니다. stop - 및 - 역방향 전략은 항상 시장에 나와 있기 때문에 큰 움직임을 그리워하지 않습니다. 또 다른 이점은 단순함 거래를 시작하고 종료하기위한 별도의 규칙과 조건이있을 때 더 복잡하고 더 많은 것이 잘못 될 수 있습니다. 탈퇴는 더 적은 타이밍 결정이 내려져야한다는 것을 의미하며, 이는 실수를 줄이는 것을 의미한다. 반면에, 탈퇴를위한 최상의 조건은 거래 시작 및 종료와 반대 방향으로 진입하기위한 조건과 거의 동일하지 않다고 주장 될 수있다 본질적으로 분리 된 결정이므로 별도의 규칙과 논리를 사용해야합니다. 시장에 항상 존재한다는 또 다른 잠재적 단점은 전략이 모든 개방 간격을 통해 거래된다는 것입니다. 그 위치에 대한 격차 격차는 전략이 더 선택적으로 들어오고 나가는 전략을 뒤집을 수 있기 전에 큰 손실을 의미 할 수 있습니다. 하루가 끝날 때까지 출구가 공백을 열어주는 영향을 최소화 할 수 있습니다. 목표는 외환 전략을 세우는 것입니다. , MetaTrader 4 MT4는 MetaTrader 4가 주로 외환을 위해 설계되었으며 MetaTrader vs TradeStation A 언어 비교와 같은 시장 거래에 널리 사용되는 거래 플랫폼을위한 확실한 선택입니다. 그러나 최근 몇 년간 TradeStation은 외환 시장은 훨씬 공격적으로 거래량 및 / 또는 계좌 수준에 따라 플랫폼 수수료 나 수수료 지불없이 TradeStation을 통해 외환 시장을 거래하는 것이 가능합니다 주요 외환 쌍에 유동성이 좋으면 스프레드가 타이트하게 보도됩니다 이러한 이유로, 두 플랫폼 모두이 프로젝트를 목표로했습니다. 여러 플랫폼을 동시에 타겟팅 할 때 몇 가지 문제가 발생합니다. 먼저 데이터가 다를 수 있습니다. 시간대, 가격, 사용 가능한 날짜 범위 등의 차이점이있는 다양한 플랫폼에서 실행이 차이점을 완화하기 위해 두 플랫폼 모두에서 데이터를 얻었으며 두 가지 데이터 시리즈에 동시에 전략을 적용했습니다. 따라서 데이터의 차이에도 불구하고 두 데이터 시리즈 모두에서 잘 작동하는 것입니다. 빌더에서 사용 된 데이터 설정은 아래 그림 1에 나와 있습니다. 그림의 마켓 데이터 테이블에서 유추 할 수 있듯이 유로 달러 외환 시장은 EURUSD 막대 크기 4 시간 240 분 다른 바 크기 나 시장도 마찬가지 였을 것입니다. 그림 1 데이터 시리즈 2에 표시된 날짜 범위에 표시된 것처럼 MT4 플랫폼을 통해 많은 데이터를 얻을 수 있었기 때문에 데이터 범위의 TradeStation 데이터 시리즈 1 80에서 동등한 데이터 시리즈를 얻는 데 날짜 범위가 사용되었습니다. 샘플 및 샘플 외부 결합을 위해 데이터를 사용했으며, 유효 기간은 20 6 20 14에서 2 10 15 원본 80의 80을 그림 1과 같이 샘플을 벗어난 20 세트의 샘플 안 함으로 설정했습니다. 입찰가 스프레드는 5 pips로 설정되고 거래 비용은 6 pips 또는 풀 사이즈 당 60 개입니다 로트 당 10 만주가 추정 됨 시장 데이터 표의 왼쪽 열에있는 체크 표시에 따라 두 데이터 시리즈가 모두 빌드에 포함되었습니다. 그림 1 MetaTrader 4 및 TradeStation의 외환 전략을 수립하기위한 마켓 데이터 설정 여러 플랫폼을 대상으로 할 때 발생할 수있는 또 다른 문제점은 지원되는 각 플랫폼이 해당 표시기를 계산하는 방식을 복제하도록 설계 되었기 때문에 선택되는 플랫폼에 따라 표시기 값이 다를 수 있음을 의미합니다. 이러한 불일치의 원인을 피하기 위해 표시기 TradeStation보다 MetaTrader 4에서 다르게 평가해야하는 것은 빌드에서 제거되어야합니다. 이는 다음 지표를 피해야 함을 의미합니다. 두 플랫폼 모두에서 사용할 수있는 다른 모든 지표는 두 플랫폼 모두에서 동일한 방식으로 TradeStation에는 Builder에서 사용할 수있는 모든 지표가 포함되어 있지만 MetaTrader 4는 그렇지 않습니다. 따라서 두 플랫폼 모두에서 사용할 수있는 지표 만 포함하려면 MetaTrader 4 플랫폼을 Builder에서 코드 유형으로 선택해야합니다 MT4에서 사용할 수없는 지표를 빌드 세트에서 자동으로 제거하여 두 플랫폼 모두에서 사용할 수있는 지표를 남겨 둘 것입니다. 또한 각 플랫폼에서 얻은 볼륨 데이터의 차이점을 발견 했으므로 모든 볼륨 종속 지표 빌드 세트에서 마지막으로, 데이터 파일 간의 시간대 차이로 인해 시간 표시기가 제거되었습니다. 아래 그림 2에서 빌드 세트에 사용 된 표시기 목록은 표시기의 표시 여부에 따라 정렬되어 표시됩니다 빌드 프로세스에 의해 고려되었다 고려 열 위에서 논의 된 이유로 고려에서 제외 된 지표는 목록 맨 위에 표시됩니다. 나머지 표시 Simple Mov Ave로 시작하는 ors는 모두 빌드 세트의 일부였습니다. 그림 2 빌드 세트에서 제거 된 지표를 보여주는 Builder의 표시기 선택. 빌드 프로세스에 사용 된 평가 옵션이 그림 3에 나와 있습니다. MetaTrader 4 코드 출력 선택 사항으로 선택되었습니다. Builder에서 전략을 작성한 후에 코드 유형을 포함하여 평가 옵션 탭의 옵션을 변경하고 전략을 재평가 할 수 있으며 선택한 언어로 코드를 재 작성합니다 이 기능은 MetaTrader 4를 위해 전략이 만들어진 후에 최종 전략을위한 TradeStation 코드를 얻는 데 사용되었습니다. EURUSD 외환 전략을 위해 Builder에서 평가 옵션을 제공합니다. 중지 및 후진 전략을 생성하기 위해 모든 이탈 유형이 아래 그림 4와 같이 빌드 세트 시장, 정지 및 제한이라는 세 가지 유형의 모든 주문 주문을 고려 했으므로 빌드 프로세스에서 빌드 프로세스 중에 고려할 수 있습니다. 피구 re 4 정지 및 후진 전략을 생성하기 위해 Builder에서 선택된 순서 유형. Builder 소프트웨어는 진입 및 종료를위한 규칙 기반 논리 조건을 자동으로 생성합니다. 전략에 신경망을 추가하려면 Include 옵션 만 선택하면됩니다 아래 그림 5와 같이 Strategy Options (전략 옵션) 탭의 입력 조건에있는 신경망. 신경망 설정이 기본값으로 유지되었습니다. 정지 및 역 논리의 일부로 Market Sides 옵션이 Long Short로 설정되었으며 새로운 거래를 입력하기 전에 종료를 기다리는 옵션은 선택 취소되었습니다. 후자는 반전시 현재 위치를 나가는 데 필요한 것입니다. 다른 모든 설정은 기본값으로 유지되었습니다. 그림 5를 사용하여 하이브리드 전략을 작성하기 위해 Builder에서 선택된 전략 옵션 룰 기반 및 신경망 조건 모두. 빌더에서 빌드 프로세스의 진화 적 특성은 메트릭 탭에 정의 된 목표 및 조건에서 계산 된 적합성에 따라 유도됩니다. 그림 6에서 아래 그림 8에서와 같이 건설 목표는 순이익에 비해 상대적으로 작은 가중치를 부여하면서 순이익을 극대화하면서 순이익을 극대화하는 단순성을 유지했다. 일반적인 전략에 대한 상관 계수와 중요성을 포함한 건설 조건에 중점을 두었다 품질뿐만 아니라 거래의 평균 막대 및 거래 수를 나타냅니다. 초기에는 거래의 평균 막대 만 빌드 조건으로 포함되었지만 초기 빌드 중 일부에서는 순이익이 무역 기간 동안 선호되었고, 그래서 거래 수 메트릭이 추가되었습니다. 209와 418 사이의 거래 수에 대한 지정된 범위는 빌드 기간의 막대 수를 기준으로 15 ~ 30 바 사이의 평균 거래 길이와 같습니다. 결과적으로이 메트릭 교역 길이 목표에 더욱 중점을 두어 원하는 교역 길이 범위의 인구가 더 많아졌습니다. 그림 6 지표 탭에서 정한 목표와 조건 설정 어떻게 상위 전략을 선택 하는가에 대한 조건은 상위 전략 조건이 유효 기간을 제외한 전체 유효 범위를 통해 평가된다는 점을 제외하고는 구축 조건을 복제합니다. 빌드 조건의 경우입니다. 최상위 전략 조건은 프로그램에 의해 별도 모집단의 모든 조건을 충족시키는 전략을 따로 설정하는 데 사용됩니다. 마지막 설정은 아래 그림 7과 같이 빌드 옵션 탭에서 수행됩니다. 여기서 중요한 옵션은 인구 규모, 세대 수 및 샘플 밖 성과를 기반으로 재설정 할 수있는 옵션입니다. 인구 규모는 인구가 다양하고 인구 밀도가 높으면서 구축하기에 충분히 작은 크기로 선택되었습니다 합리적인 시간 세대의 수는 결과가 수렴하기 시작하기위한 몇 가지 예비 빌드 동안 소요 된 시간을 기준으로했습니다. 그림 7 Build options inc 모집단 크기, 세대 수 및 샘플 밖의 성능을 기반으로 모집단 재설정 옵션을 제공합니다. Out of Sample OOS 성능을 다시 설정하는 옵션은 지정한 수의 세대 이후에 빌드 프로세스를 시작합니다. 조건이 충족되는 경우, 표본 순이익이 20,000 미만인 경우 모집단이 재설정됩니다. 이 값은 예비 테스트를 기준으로 선택되어 충분히 도달 할 수 없을만큼 충분한 값입니다. 결과적으로, 빌드 프로세스가 수동으로 중지 될 때까지 매 30 세대마다 반복되었습니다. 이것은 프로그램이 오랜 기간 동안 최고 전략 조건을 기반으로 전략을 식별하도록하는 방법입니다. 주기적으로 최고 전략 인구를 확인하고 적합한 전략이 완료되면 빌드 프로세스가 취소됩니다 out-of-sample을 따옴표로 표시 한 예외 사항 샘플 밖 기간을 사용하여이 방법으로 모집단을 재설정하면 샘플 밖 기간이 더 이상 유효하지 않습니다. - sample 그 기간이 이제 빌드 프로세스를 안내하는 데 사용되기 때문에 샘플링 기간의 일부분이 효과적으로 유효합니다. 위에서 설명한 것처럼 유효성 검사를 위해 세 번째 세그먼트를 따로 설정하는 것이 좋습니다. 몇 시간 동안 처리 한 후 다수의 자동 재건축을 통해 Top Strategies 인구에서 적합한 전략을 찾았습니다. 닫힌 무역 주식 곡선은 아래 그림 8에 나와 있습니다. 자본 곡선은 적절한 수의 거래가있는 두 데이터 세그먼트에서 일관된 성과를 보여 주며 두 데이터 시리즈. 그림 8 EURUSD 정지 및 반전 전략에 대한 비공개 주식 거래 곡선. 유효 기간에 대한 전략을 확인하려면 Markets 탭의 날짜 컨트롤이 그림 1을 참조하여 데이터 2의 종료 날짜로 변경되었습니다. 11 2015로 변경하고 Builder의 Strategy 메뉴에서 Evaluate 명령을 선택하여 전략을 다시 평가했습니다. 결과는 아래 그림 9에 표시되어 있습니다. 빨간색 상자의 유효성 검사 결과는 전략 그림 9 : 유효 기간을 포함하여 EURUSD stop-and-reverse 전략에 대한 비공개 주식 거래 곡선. 최종 점검은 각 데이터 시리즈에 대해 수행 된 전략이 해당 플랫폼에 대한 코드 출력 옵션 위에서 설명한 바와 같이 코드 유형 및 데이터 시리즈에 따라 결과에 차이가있을 수 있기 때문에 필요합니다. 선택한 설정이 이러한 차이를 최소화했는지 확인해야합니다. MetaTrader 4의 전략, TradeStation의 데이터 시리즈는 Markets (시장) 탭에서 선택 취소되었으며 전략은 재평가되었습니다. 결과는 그림 10에 아래에 표시되어 있으며 그림 10의 하단 곡선과 같습니다. 그림 10 닫힌 무역 주식 곡선 MetaTrader 4에 대한 유효 기간을 포함하여 EURUSD 중지 및 역전 전략에 대해 설명했습니다. 마지막으로 TradeStation의 전략을 테스트하기 위해 TradeStation의 데이터 시리즈가 선택되었으며 MetaTrader 4의 시리즈는 이탈했습니다 Markets 탭에서 코드 결과를 TradeStation으로 변경하고 전략을 재평가했습니다. 결과는 그림 11에 아래에 표시되어 있으며 예상대로 그림 9의 중간 곡선과 매우 유사하게 나타납니다. 그림 11 - TradeStation에 대한 유효 기간을 포함한 EURUSD 중지 및 역전 전략에 대한 무역 자본 곡선. 두 플랫폼에 대한 코드는 아래 그림 12에 제공됩니다. 해당 플랫폼에 대한 코드 파일을 열려면 코드를 클릭하십시오. 코드를 검토하면 규칙 기반 부분은 장단기와 단기간에 다양한 변동성 관련 조건을 사용합니다. 신경망 입력은 요일, 추세 ZLTrend, 일중 최고, 오실레이터 InvFisherCycle, InvFisherRSI, Bollinger bands 등의 다양한 지표로 구성됩니다 , 표준 편차 등이 포함됩니다. 전략의 하이브리드 성은 TradeStation 코드의 코드 구문에서 직접 볼 수 있습니다. EntCondL 및 NNOutput이 5 일이면 EnMark-L 구입 NShares는 시장에서 다음 바를 공유합니다 변수 EntCondL은 규칙 기반 입력 조건을 나타내고 NNOuput은 신경 네트워크의 출력입니다. 두 조건 모두 긴 항목 순서를 적용하려면 true 여야합니다. 짧은 항목 조건은 동일한 방식으로 작동합니다. 그림 12 EURUSD에 대한 거래 전략 코드 stop-and-reverse strategy left, MetaTrader 4 right, TradeStation 그림을 클릭하여 해당 코드 파일을 엽니 다. 이 기사에서 설명하는 설정이 들어있는 Builder 프로젝트 파일을 다운로드하십시오. 이 기사에서는 하이브리드 규칙 기반 신경 구축 프로세스를 살펴 보았습니다. Adaptrade Builder로 시장 접근 방식에서 항상 멈춤 및 후진을 사용하여 EURUSD를위한 네트워크 전략 각 플랫폼에서 동일한 방식으로 작동하는 지표의 공통 하위 집합을 선택하여 여러 플랫폼에서 전략 코드를 생성하는 방법을 보여주었습니다. 길고 짧고 뒤집힌 전략을 생성하는 데 필요한 설정이 기술되었으며 결과적으로 전략은 분명히 한 조에 수행되었다는 것이 입증되었습니다 데이터의 유효성 검사 세그먼트 데이터 및 코드 옵션을 사용하여 각 플랫폼에 대해 유사한 결과를 얻은 것으로 확인되었습니다. 위에서 설명한 것처럼 중지 - 역방향 접근 방식에는 몇 가지 단점이 있으며 모든 사람에게 호소력이 없을 수 있습니다. 그러나 항상 - 시장 접근 방식은 외환 시장이 24 시간 내내 매매하기 때문에 외환 데이터가 더 매력적일 수 있습니다. 결과적으로 세션 개방 갭이 없으며 거래 주문이 항상 활성화되어 시장을 반전 할 수 있습니다 변경 intraday 데이터 4 시간 막대의 사용은 빌드 프로세스에서 사용하기 위해 더 많은 데이터 막대를 제공했지만 전략의 항상 시장 특성은 거래가 밤새도록 수행된다는 점에서 상당히 임의적이었습니다. 빌드 프로세스 비대칭 스톱 앤드 리버스 전략의 결과로 길고 짧은 진입을위한 다양한 조건을 진화시킬 수있었습니다. 이름에도 불구하고, 결과적인 전략은 시장 주문에 대한 장기 및 단기 거래 모두에 진입합니다. et, stop 및 limit 명령은 모두 각 측면에 대해 독립적으로 빌드 프로세스에 의해 고려되었습니다. 실제로 긴 전략에서 짧은 전략으로 전환하는 것은 전략이 현재 길기 때문에 시장에서 두 배의 주식을 판매하는 것을 의미합니다. 예를 들어 현재의 긴 위치 현재 주식 시장이 100,000 주라면 시장에서 200,000 주를 사게 될 것입니다. 단기간에서 장기간으로 반전시키기 위해서는 200,000 주를 사야합니다. 이상적인 것보다 더 짧은 가격 내역이 사용되었습니다. 그럼에도 불구하고 결과는 검증 세그먼트에서 긍정적이었습니다. 전략이 과도하게 맞지 않았 음을 나타냅니다. 이것은 전략을 시장에 지나치게 맞추지 않고도 신경망을 거래 전략에 사용할 수 있다는 아이디어를지지합니다. 여기에 제시된 전략은 실제 거래 및 실시간 추적 또는 거래 테스트를 거치지 않았다 그러나이 기사는 EURUSD 또는 다른 시장에 대한 유사한 전략을 개발하기위한 템플릿으로 사용할 수 있습니다. 방법, 당신이 개발하는 모든 거래 전략은 결과를 검증하고 실시간 거래 전에 전략의 거래 특성을 익히기 위해 실시간 추적 또는 별도의 데이터에서 철저히 테스트해야합니다. 이 기사는 2015 년 2 월호 경험적 또는 시뮬레이션 된 결과는 실제 실적과 다르지 않습니다. 실제 결과가 아니라면 시뮬레이션 결과는 실제 거래를 나타내지 않으며, 실제로 거래가 실행되지 않았기 때문에 결과가 과소 또는 과소 보상 될 수 있습니다 , IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. If you d like to be informed of new developments, news, and special offers from Adaptrade Softw are, please join our email list Thank you. Neural Networks for FOREX Trading. In this article an example of using of our Neural Networks Software to create a complete neural network trading system. This example uses the Cortex built-in scripting language so please read the scripting language guide first. Using Neural Networks to create FOREX Trading Strategy. In this free online tutorial you will find the full cycle of using neural networks Cortex Neural Networks Software for Forex trading or stock market trading the idea is the same. You will learn how to choose inputs for the artificial neural networks and how to decide what to use as the output. You will find an example of a ready to use script that allows to perform neural networks optimization of both the structure of Neural Network number of neurons and the forex trading system stop loss etc. Finally the part that is not present in most tutorials , you will learn what to do next After all, Cortex Neural Networks Software cannot do real t ime trading, you need to use something like Trade Station, MetaQuotes or MetaTrader How to port the FOREX trading system from Cortex to your favorite trading platform Do you have to deal with DLLs, ActiveX controls and low-level programming The answer is NO Cortex Neural Networks Software comes with the easy to use feature that allows you to easily port the resulting trained Neural Network to the scripting language of your trading platform No DLLs, DDE, ActiveX or any other low-level solutions - everything is plain and simple. Important note this is NOT a how to trade tutorial Instead, it tells you how to use Cortex Neural Networks Software but you still need to invent your own trading system The one we use here is barely a starting point, and shouldn t be used as a forex trading strategy as is The idea of this text is to teach you to create NN-based trading systems and to port them to the trading platform of your choice The example is, however, ovesimplified, and can only be used as th e illustration of trading principles Same way, the MACD trading system, that can be found in many tutorials, is not working well anymore as markets have changed , but still is a good example of using indicators for mechanical trading In two words do your own analysis. Another important note the tutorial uses examples, lots of them To make your life easier, I have included them all, not just fragments However it makes the text much longer Also, I am going from the very first, clumsy, forex trading system to more advanced, every time explaining what had been improved and why Be patient, or jump directly to the section you need. Final important note the code is not something carved in stone, it could change while this text was written The final versions of script files are included in Cortex archive. Pitfalls of FOREX BUY SELL Signals What is wrong with simple examples. In the Cortex Neural Networks Software user s guide we used a simple example of an aftifficial Neural Network predicting the price of GENZ stock To find out what is wrong with this approach, let s do the same simple example, using instead of the use 800 records in the learning set, as is a little bit shorter, then. It just wouldn t work Why. The reason will become evident, if you ask yourself What is the reason neural network forecasting of future values can be done on the first place. The answer is it is learning to do what is called neural networks pattern recognition to recognize patterns, and if there is a hidden logic in these patterns, then even a new pattern with the same logic will be recognized. That s a trick - with the same logic There is not even one, but three problems here. First of all, if you look at the Microsoft s stock price, you will notice, that it was going down in the learning part of our data, and sideways - in the testing part So it is possible, that the logic had changed. Second, and even more important - WHAT IS THE PATTERN You see, if we teached the neural network in the range 10 - 100 , and then presented it with something in the 1 to 3 range - they are different patterns 10, 20, 30 and 1, 2, 3 look similar to the human because - BECAUSE - we have this ability to divide by ten, when presented with numbers ending with zero It is what is called a pre-processing of the data, and by default, the NN can not do it. Can we teach it Of course What is it EXACTLY we need to teach it. This is the third, and the most important one We do not need the price prediction We do not care What we need is FOREX buy sell signals. Now, wait a minute We need a to have our input both learning and testing in the same range, and we need b to be able to make trading decisions based on it Isn t it what we call an indicator Bingo. So, that s what we are going to do - we will build an indicator, to feed it to the NN as an input, and we will try to get a prediction of the indicator value, not the worthless stock price. In our first example, we will load stock quotes from the disk, open the Neural Netwo rk file and start the learning - all in an automated mode. Create a new script file or open the one that came with the Cortex Neural Networks Software archive and call it. First of all, we need to download the price values from the file We are going to use the CLV indicator see below , but to calculate it, we need split-adjusted values for High and Low, not just for close Here is how to get them. The first line assigns the path to the strStockPath variable, of course, you will have to edit it, if your data file is located in the different directory. In the second line we specify, that this path is not relative the relative to the location of file. The TABLELOADER receives the path, the empty string for the start line , 1 - to skip the first line column names , part of the file s footer line the last line in does not contain data , it is also instructed to load the column number 0 and call it arrDate , 2 arrHigh , 3 arrLow , 4 arrC and 6 arrClose For a full description of TABLELOADER, see th e SLANG reference guide. Then we calculate split, by dividing the Adjusted Close by Close, and use this value to adjust Low and High. The file contains newest data FIRST, while we want them LAST. Next, we need to create an indicator Let s say, it is going to be a Close Location Value indicator, though in the real life I would probably use more than one indicator as the NN input. The Close Location Value indicator is calculated like. CLV Close - Low - High - Close High - Low , where Close, Low and High are for the interval, not necessarily for a single bar Note, that we want it in the 0 - 1 range, to make it easier to normalize to our NN s range which is, again, 0-1.Next, we need to create a lag file Let s use lags equal to 1, 2 9 For details on file functions, see the SLANG reference guide Note, that the Cortex s NN dialog can produce simple lags automatically you can use a Generate lag button But later in this text, we are going to work with complex lags which means, they are not 1, 2, 3 b ut 1, 3, 64 whatever , so we need to create the code that can handle this task in a more flexible way. Having the lag file, we are ready to create our first neural network This function takes a lot of parameters, so be carefull However, the code is really simple. By the way, most of this code can be removed, if you think you can handle numbers, instead of meaningfull names in your code, however, that would be a very bad coding practice. Now, after we have a neural network and the lagged file with data, we need to teach the network The lag file has 1074 records, so it is reasonable to use 800 as a learning set, and the remaining 274 as a testing set. You can, of course, open a network file and to click the Run button on the Learning tab But as this is an introduction to advanced Cortex Neural Networks Software programming, let s use SLANG builtin scripting language instead. The following code brings up the modal dialog with ann NN settings Note, that if you want to have a privilege of clicki ng the Run button, you need to change the. The bStartLearning can be 0, in which case the dialog will wait for your input, or 1, then the learning will begin aytomatically. The bResumeScript, if equals 1, will resume the script, if you close the dialog by clicking the OK button. The bReset is used to reset the network before the learning begins. Run the script, and wait for the epoch counter to exceed 1000, then click Stop Go to the Apply tab, and click Apply This will run the entire data set both learning and testing through the NN, and create the file, containing both original input-output, and the NN-generated prediction, this way you can easily plot them and compate against each other. Go to the Output tab, select file, click Browse file , Select fields , then select the No in the left list box, and by holding down the CTRL key while selecting with the mouse Clv and NN Clv in the right list box Click Chart to see how good our prediction is Well It is more or less good, from what we can say by looking at it Still, nothing extraordinary. This was just an example of what you can do with SLANG scripting, and how to automate Cortex s routine tasks However, until now, we did nothing you couldn t do by hand Well almost nothing, because if you want to create a custom lag file, with, say, Clv-100, Clv-50, Clv-25 columns, then you will have to use SLANG or Excel , because you cannot do in in Cortex without scripting. FOREX Trading Strategy what to optimize. Here is our next problem Do we need a good-looking prediction, or do we need the one we can use to trade with profit The question seems odd, but just think about it for a moment Let s say we have a VERY good 1-hour prediction 95 accurate Still, how far can the price go in one hour Not too far, I am afraid Compare it to the situation, when you have a rather inaccurate 10-hours prediction Will it be better. To answer this question, we need to actually trade, a simple comparison of the mean errors produced by the two NNs will not help. The second part of the same problem is in the way we define a good prediction Let s say we have a network, that produces the prediction, which is 75 accurate Compare it to the NN, that is producing 100 accurate prediction The last one is better Now, DIVIDE the output prediction of the 100 accurate NN by 10 We will have a VERY inaccurate network, as its signal is nowhere near the signal we used as a desired output And yet, it can be used same way we used 100 accurate NN, all we have to do is to multiply it to 10.See, the NN is created, by tuning the mean quadratic error, and not the correlation, so, at least in theory, a better NN can show poor results, when used for the actual stock Forex trading. To solve this problem, we need to test our NNs using trading, and to use results of this trading profit and drawdowns to decide, if this NN is better than the other one. Let s do it Let s create a program, that can be used to fine-tune NN, and this time, by fine-tuning, we will mean tradin g results. Neural Network Trading Few short notes. First of all, in our example above, the automatic learning will never stop, because we haven t specified any stop criteria In the dialog, or in the CREATENN function, you can provide the min error when the NN reaches it, it stops and, if bResumeScript is set to 1, the dialog will close and the script will resume Also yo can provide the maximum number of epochs, or both I am not using it in the example below, at least not always, because I am planning to watch the learning and to click STOP when I think the NN is ready If you want to do it in fully automatic mode, pay attention to these parameters. Second One of the ways to make a network smaller, faster and more accurate, is to begin with the small network, and increase it s size, neuron by neuron Obwiously, the number of the input neurons is determined by the number of input data columns but we can vary them, too , and the number of output neurons should be equal to the number of output data columns usually one, but not necessarily This means we need to optimize the number of neurons in the hidden layer s. Also, as I have mentioned, we don t really know which data to use Will Clv-15 15 days delayed increase the accuracy of our prediction Do we need Clv-256 Will it be better to use both of them in the same NN, or will adding Clv-256 ruin our performance. Using nested cycles to try different input parameters, you can. Create the NN, same way we did it for the stock data let me repeate, for the NN, there is no difference between stocks and FOREX, it just happened that I have couple of high quality data files for FOREX that I want to process, while writing this text. Try different combinations of lags. Try different number of neurons in the hidden layer. and different combinations of different indicators. However, if you try all possible combinations of all possible parameters, you will NEVER get your results, no matter how fast your computer is Below, we will use couple of tricks to reduce calculations to a bare minimum. By the way, it may seem, that if you start from one hidden neuron, then increase it to 2, 3 and so on, and at some point the error quality of the prediction or the profit if you test the NN by trading using it will begin to go down, then you have your winner Unfortunately, I cannot prove, that after the first performance peak there can be no second one It means, that the error may go like 100, 30, 20, 40, 50 it was just at its minimum, right and then 30, 20, 10, 15 the second minimum We just have to test all reasonable numbers. Third Optimization is a two-edged sword If you over-optimize your code, it may not work outside the data you used to fine-tune it I will do my best to avoid this pitfall If you want to do addition al optimizations to your code or NN, I advise you to do a research in the Internet, to learn more about hidden problems of this approach ALso, I am going to pay some attention to the smoothness of the profit curve The profit that looks like 0, -500, 1000, -100, 10000 may be great, but the profit 0, 100, 200, 300, 400 is better, as it is less risky We may talk about it later. Finally, for this example we are going to use FOREX, rather than stock prices From the point of view of the NN there is no difference, and from my point - Forex is much more fun to trade If you prefer stocks, the code can easily be modified. A FOREX Trading Strategy to play with. First of all, let s create a prototype of our code, one that can easily be optimized in future It is going to be a trading system, that uses a Neural Network to trade and produces a chart profit against trade number It will also calculate drawdown, as a measure of robustness of our trading system. The main difference here is that we use functi ons, instead of placing all the code in the main block of the program This way it is much easier to manage. Second, we have a TestNet function I am using a very simple algorithm of trading The CLV indicator is confined to 0 - 1 interval our version of CLV is , so when the indicator crosses up the dBuyLevel see code above , I am buying, when it is crossing down the dSellLevel, I am selling. Obviously, it is not the best trading strategy, but it will do for our purpose just for now If you want to improve it, here are some pointers First, you may want to have a system, that is not ALWAYS in the market Second, you may want to use more than one indicator as inputs, and maybe, more than one NN, so that the trading decision is made based on few predicted indicators We will add some improvements to the trading algorithm later. We use some standard assumptions of the FOREX trading spread is 5 points, leverade is 100, min lot is 100 mini-FOREX. Let s take a look at our trading system Once again, it is an oversimplified one An important note the TestNn is called last, and it has access to all variables that were created to that point So if you see a variable that I am using, without initializing it, it probably means that it was initialized in NewNn , TeachNn or some other function that was called prior to TestNn. To make things easier, comments are placed in the code. Few words about the drawdown There are few ways of calculating it, and we are using what I consider the most honest The drawdown is a measure of instability of our system What is a chance, that it will loose money Lets say the initial amount is 1000 If the profit goes 100, 200, 300, 400 the drawdown is 0 If it goes 100, 200, 100 then the drawdown is 0 1 10 , as we have just lost an amount, equal to 1 10 of the initial deposit from 1200 to 1100.I would strongly advice against using trading systems with large drawdowns. Also, here I use a drawdown, that is to be used with variable lot size However, in the actual samples, that come with the eBook, you will see another version. As you can see, here we always use 1000 the initial amount to calculate the drawdown The reason is simple we always use the same lot size no money management yet , so there is no difference, how much money we have already accumulated on our account, an average profit should be constant The worse possible scenario in this case looks like this from the very beginning 1000 on account we are loosing money If we use 1000 to calculate the drawdown, we will get the worse drawdown This will help us not to trick ourselves For example, say, we traded for some time, and we have 10,000 on our account Then we loose some money, and we now have 8,000 Then we have recovered, and got 12,000 Good trading system Probably not. Let s repeat the logic again, as it is very important and it will become even more important, when we start doing money management We trade using fixed size lots So, statistically, there is no guarantee, that the maximum loss wi ll not happen at the very beginning, when we only have 1000 And if it happens, we will have -1000 10,000 - 8,000 , so the trading system is probably too risky. When we talk about the money management probably, not in this text , we will have to use different approach to drawdown calculation. Note, that in this trading system, I am using the worse possible scenario I am buying using High and selling, using Low Many testers do not follow these rules, and create trading systems, that work fine on historical data But in the real life, these trading systems have very poor performance Why. Take a look at the price bar It has Open, High, Low and Close Do you know, how the price was moving inside the bar No So, let s say, your trading system generated a buy signal, at the bottom of the price bar if dLow. Note that I am using dLotSize equal 0 1 lot 100 Obviously, in the real trading, you will benefit greatly, if the lot size is calculated depending on the money you have, something like. However, we are doing testing here, not trading And for testing, we need, among other things, to see how smooth the profit curve is This is much easier to do if the lot size is the same in ideal situation, for dLotSize 100 we will get a straight line, with some positive slope, while in case of the adjustable lot size we will get an exponent, that is much harder to analyze. Later in this text, we will apply money management rules to our trading system, but not yet. After we are done with the last part of our testing function, let s walk through the rest of the code. The following function creates a CLV indicator It takes the interval as a parameter, which means that we can call it many times, during the optimization, passing different numbers. Note, that I am using the NN that works in the 0 - 1 interval The data can be normalized, of course, but I chose to divide the indicator by 2 and to add 0 5, so that it is in 0 - 1 range. To make lag file, we can use the CREATELAGFILE function Alternatively, we ca n do it by explicitly providing all the necessary code In this case, we have more control, and we are going to need it, if we begin varying number of lagged columns and so on. The nRemoveFirst parameter is important Many functions, like indicators, moving averages, lag generators, for that matter, do not work well within the first few records of the dataset Let s say we have MA 14 - what will it place in the records 1 - 13 So we choose to simply remove the first few unreliable records. For the NewNn, as well as for all functions of this program, we need to pass as parameters only what can be changed during optimization process For example, there is no need to pass a skip before parameter, as it is always the same. The TeachNn function simply brings up the NN dialog. Finally, we need a charting function It is not mandatory, but it is always a good idea to see what our profit line looks like The following code uses the XML to produce a chart, so it is a good idea to read the tutorial Alterna tively, you can draw the chart, rather than saving it in a file To do it, use one of the samples, that are in the samples scripts directory Finally, you can modify the code, to produce HTML, rather than XML HTML is easier to learn, but the code itself will be a bit less readablepile and Run the script. Well As expected, using 7 hours as an interval for the CLV produced very poor results. FOREX Trading Strategies and Optimization. The reason for the poor results is quite obvious we used the Interval, Stop Loss, buy and sell levels and other parameters, that were purely random - we just picked first that came in mind What if we try few combinations. FOREX Trading Signals What to optimize. First of all, by overoptimizing the buy and sell levels, we can ruin our future performance However we still can tune them, especially, if the performance is close for close values of buy and sell limits For example, if we have -10 profit at buy limit equal 0 3, and 1000 profit when it equals 0 35, then ther e is probably a lucky coincidence, and we should not use 0 35 for our trading system, as in future it will probably not happen again If, instead, we have -10 and 10 instead of 1000 , it may be safer to use. Generally, our trading system should be built for WORSE possible scenario, as if during the real trading the performance will be better, then during the test, we will survive, but not the other way around. We can vary the value for the indicator interval, provided we have enough trades, so that we can be confident, in terms of statistics, in the performance of a system. We certainly can vary the number of neurons, I don t think it can be overoptimized easily. We can vary number of inputs and lags for inputs It is possible to overoptimize this, but it is not very likely to happen. And, of course, we can try different indicators. Accurate FOREX Signals How to optimize. As have already been mentioned, if we start trying all possible combinations, it will take forever So we are going to cheat We will create pre-defined sets of parameters, that we think are reasonable, and pass them to the program. To make as few calculations as possible, note, that Clv-1 and Clv-2 are, probably, important, but what about Clv-128 And - if we already have Clv-128, do we need Clv-129 Probably, not So we are going to have something like Clv-1, Clv-2, Clv-4, Clv-8 Clv-128 with just few variations, which will make our calculation time thousands times shorter. FOREX Professional System Trading Can it work at all. What is it exactly we want to predict Until this point we have used 1 hour chart for EURUSD, and we were predicting the next bar s CLV Will the CLV 2 be better What about CLV 3.Also, especially considering the poor performance of our first trading system, it would be nice to know, that - at least in the ideal world, the goal profitable trading can be achieved. To answer these questions, let s create a simple testing program We assume, that our prediction is 100 accurate, and, based on this as sumption, we will use CLV N, not the NN predicted one That s right - we are going to take data from the future, and to use them instead of the NN prediction This approach wouldn t work in the real life, of course, but at leats, it will give us some ideas of what to expect. When looking at the results, please keep in mind, that we are not using any advanced money management, our lot size is set to a minimum 100 If you use variable lot sizes, results will be dramatically different But even at a lot size set to 0 1 we can see below that getting the information from the future is an ultimate trader s holly graal. You are already familiar with this code, it was used in It handles data loading The only difference is in the part that obtains the list of files in the images directory and deletes all files with the extention The reason for this code is simple during our tests we are going to create many - may be, thousands - image files We don t want them to hung around after we are done So at th e beginning of the script we are deleting images, created by other scripts. Just a few comments We do not want to try all possible values for, for example, CLV interval Instead, we can create an array, that contains only values we want to test Then see below we will walk through this array. Stop losses are important part of any trading strategy, so I have decided to vary them as well It is a dangerous idea, however, as it is easy to overoptimize the system. I am planning to test different values for buy and sell levels, but it will be done in cycle, without using arrays. Unlike in our previous example, we want to have a large XML file, containing many images To do it, I have moved the code, that is forming the XML header and footer outside of the Chart function Read one of the online XML tutorials for details. Note, that I am using 0 as the first lag, which means, that first I am testing the indicator CLV that was not shifted from the future Just to get an idea, how good out trading system would be without NN horrible, is the right word It is loosing all the money. Cortex uses the Internet Explorer control to display XML pages When pages grow large, it takes a lot of memory If your computer cannot handle it, consider creating multiple XML or HTML pages, instead In the case of forexnn02, it should not be a problem, as the page is relatively short Alternatively that is what I am doing in scripts later in this text , create XML file, but do not open it from Cortex Open them using Internet Explorer instead - unlike IE control, the Internet Explorer does not have the memory problem. Now the code that is trying different combinations of parameters. Here, we are using nested cycles In every cycle, we are assidning some variable for example, nInterval for the outer cycle This way the cycle will assign values of all elements of a corresponding array, one in a time Then WITHIN it, the inner cycle is used, and so on, so that all combinations of all array elements are tested. In the inn ermost cycle, I am calling the Test function, to test trade , and Chart to add a new picture to a list of images saved on disk Note, that this Chart does not show any images, until all cycles are completed. The Test and CreateClv functions are almost the same as in the previous example The only real difference is due to the fact that it is called more then once To do it, I am calling ARRAYREMOVE to cleanup arrays. Also, notice, that we are only creating charts for the combinations of parameters, that produce trading system with positive profit Otherwise, we call continue , to skip the Chart function. Finally, we have Take Profit now, so our trading system can be a bit more flexible. The Chart function was broken into two pieces The header and the footer should be written to the XML file only once, so they were moved to the main part of the program. Also, I am using the counter, to save files under the different names The information about parameters is written to the header of an image, so we can easily see which one it is Finally, images are only saved for winning configurations, meaning the balance at the end should be more, then at the beginning. Run the program it will take some time to complete You will end up with a large XML page with images, one for each winning configuration. Some of the results are great, however, as we used data from the future , this system will not work in the real life Actually, if you look at the Test function, you will notice, that the cycle stops before we reach the last element of arrClose. for nBar nRemoveFirst 1 nBar. THIS IS C , just an example. As you can see, the code is really simple Now lets do the same using the SLANG script As in examples before, we will keep the overall structure of the code, so that this example looks familiar The only difference is that instead of using the built-in APPLYNN function, we call the function of our own The code that we do not use such as cycles is commented, but not removed. Note, that the logic behin d it was discussed in Neural Networks and Stock Forex Trading article already Briefly, the output of this script is formated to be compatible with the MQL, MetaTrader s scripting engine MetaTrader is a trading platform we use, if you want something different, like TradeStation, for example, you will have to alter the code to comply to its syntax. Then, in the following chapters, we are going to insert this code in the MetaTrader s indicator, and to use it to trade. Porting script to trading platform. The next step is not really required, but it is something, that may be useful We are going to create a version of a tsc file one above , but this time, we will use SLANG Cortex scripting language to emulate APPLYNN function The reason is, in the next chapter we are going to port it to the scripting language of a MetaTrader trading platform, so it is a good idea to make sure everything works. After we run this function, we discover, that the result it produces is the same, as the forexnn05a pro duced, which means the code works fine. Note, that there is a difference at the beginning of the charts, as our NN does not try to process the data at the beginning where lag is incomplete , while the built-in NN does not know about this problem Of course, it doesn t affect the result, as the beginning of the chart is ignored by using the nRemoveFirst parameter in our script set to 200, which is guaranteed to be larger, then our lag. Using third-party trading platform. We have the NN that more or less can be used We have the script, implementing this NN without calls to the Cortex-specific NN functions Now we are going to port it to the trading platform that can be used for the real trading, which means it can contact brocker, place orders and earn or loose money. As a trading platform, I am going to use MetaTrader. Disclaimer I am not related to MetaQuotes in any way I do not work for them, I am not their affiliate and so on I use MetaTrader, ONLY because I like it. I find this program user - friendly, flexible and powerful, and not a monster Also, it is free compare to other packages of this class. The only minor problem is that it is not always easy to find the dealer using MT in your area Then, when you do a research, you may find couple of brockers, with screenshots on their web sites, that look suspiciously familiar Yes, they use MetaTrader, but they don t call it MetaTrader. I have asked for clarification at the company s forum, and they have told me, that they don t reveal brockers using their services Very strange. One of the brockers that is not hiding the fact they use MT, is Alpari They will allow you to open a Demo account, so that you can trade in a real time, but without risking your money. Warning I am not going to recommeng services of Alpari Once again, I am not being paid for that Try their Demo account, and use your own judgement Or you can start your own research at Internet forums. Finally, if you do not like the MT, you can probably follow the example belo w using TS, MS or some other trading platform This is just an example. Our MT-based trading system will include two files, the indicator and an expert This is the way they call it in MQL scripting language of MT , and I am going to follow this naming convention. The indicator implements the neural network and draws a chart An expert takes these data and does trading As MetaTrader has a strategy tester , we will be able to test our strategy, to see how good it is. I will assume, that you are familiar with MQL programming, it is quite close to SLANG and tutorials can be found both at MetaQuotes and Alpari. Finally, I am using the code structure, that is borrowed from MetaQuotes forum, permission to use it the author of the corresponding posts had granted me permission to use fragments of his code. Also, as some of our MetaTrader code is the same for all experts and indicators, we moved it to a separate library file MetaTrader s libraries are nothing but includable files This library takes car e of synhronization, when two or more expert are trying to run in the same time, as well as of few other things If you use MetaTrader, it will help you to create robust experts, in any case, the MQL language is easy to understand. a helper library. The code should look familiar, all I did was re-writing it, using slightly different language syntax of MQL. This indicator has two buffers, and draws two lines, one for the original NOC, and one for the NN-predicted NOC For trading, you don t have to draw both indicator lines, of course see MQL tutorials to learn how to do it , but I have decided to show them together, so you can compare. Another difference, that you should know about, is the way MT performs testing It may, in some cases, be more accurate, then one we did we did the worse case scenario Of course, you can always to change the SLANG script from the examples above, to implement any logic you want. The result of our testing in MT is a bit better, then in Cortex, due to all these reasons. Keep in mind, that MT calculates the DD in a different way I still think, that my way is better. In should be especially noted, that no additional optimization had been performed using MetaTrader s optimizer We have just plugge d our MTS mechanical trading system in, and it worked as expected. That is it You can now create Cortex Neural Network, optimize it to do trading, and to port it to the trading platform of your choice. Download Cortex Order Cortex View Price List. Visibility is very important for this site If you like it please link to this URL.

No comments:

Post a Comment