OPENQUANT-SMARTQUANT-面向機構的頂尖量化交易解決方案_第1頁
OPENQUANT-SMARTQUANT-面向機構的頂尖量化交易解決方案_第2頁
OPENQUANT-SMARTQUANT-面向機構的頂尖量化交易解決方案_第3頁
OPENQUANT-SMARTQUANT-面向機構的頂尖量化交易解決方案_第4頁
OPENQUANT-SMARTQUANT-面向機構的頂尖量化交易解決方案_第5頁
已閱讀5頁,還剩158頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

凱文詹姆森翻譯:伍侃、張毅111 1 1 22InstallingtheLicenseFile安裝證書文件 3 4 43.1.1TheFileMenu文件菜單 53.1.2TheEditMenu編輯菜單 63.1.3TheViewMenu視圖菜單 73.1.4TheSolutionMenu解決方案菜單 3.1.5TheDataMenu數據菜單 3.1.6TheToolsMenu工具菜單 解決內存溢出的錯誤 3.1.8TheHelpMenu幫助菜單 3.2.1TheFileToolbar文件工 3.2.2TheEditToolbar編輯工具條 3.2.3TheInstrumentToolbar合約工具條 3.2.4TheSolutionToolbar解決方案工具條 3.2.5TheTradingModeToolbar交易模式工具條 3.2.6TheChartToolbar圖表工具條 3.2.7TheSolutionViewToolbar解決方案視圖工具條 3.2.8TheWindowPaneToolbar面板工具條 3.3WorkingwithDockableWindowPanes使用可??棵姘?3.3.1TheInstrumentWindowPane合約面板 3.3.2TheProvidersWindowPane提供商面板 3.3.3TheIndicatorsWindowPane指標面板 3.3.4TheOutputWindowPane輸出面板 3.3.5TheProviderErrorsWindowPane提供商錯誤面板 23.3.6ThePropertiesWindowPane屬性面板 3.3.7TheSolutionExplorerWindowPane解決方案資源管理器面板 29 3.4.1TheStartPageTab開始頁選項卡 3.4.2TheQuoteMonitorTab報價監(jiān)視器選項卡 3.4.3TheInstrumentChartTab合約圖表選項卡 3.4.4TheInstrumentDataSeriesTab合約數據序列選項卡 3.5WorkingwithStrategyViews使用策略視圖 3.5.2TheStrategyPortfolioView策略投資組合視圖 3.5.3TheStrategyPerformanceView策略績效視圖 3.5.4TheStrategyResultsView策略結果視圖 3.5.5TheStrategyMarketScannerView策略市場掃描器視圖 4AcquiringMarketData獲取市場數據 4.1TypesofMarketData市場數據類型 4.2ImportingMarketData市場數據導入 4.3ViewingaDataSeries查看數據序列 4.4EditingStoredData編輯存儲的數據 4.5AnalyzingDatawithIndicators通過指標分析數據 5RunningaPreconfiguredTradingStrategy運行預置的交易策略 5.1RunningYourFirstStrategy運行你的第一個策略 6CreatingNewSolutions,Projects,andStrategies新建解決方案、項目和策略 6.1Solutions,Strategies,andProjects解決方案、策略和項目 6.2CreatingaNewSol 6.3AddingaNewStrategytoaSolution新加策略到解決方案 6.5ChoosingaMarketDataType選擇市場數據類型 6.6ViewingYourStrategyCode查看策略代碼 6.7CorrectingCodeErrors更正代碼錯誤 6.8CodeEditorCapabilities代碼編輯器功能 3 6.10SetingInitialSimulationValues設置模擬初始化參數 6.11MakingResultsMoreRealistic使結果更逼真 7ConfiguringaStrategyforPaperorLiveTrading配置仿真或實盤 7.1ConfigureTradingModeOptions配置交易模式 7.2ChooseaTradingMode選擇交易模式 7.3CheckProviderConnections檢查提供商連接 7.5CheckDataFlowwiththeQuoteMonitor使用行情監(jiān)視器檢查數據流 7.6CheckLiveExecutionProviderFunctions檢查實盤交易提供商功能 8.2TheScenarioDemoSolutionFile場景演示解決方案 8.3ScenarioFileAlgorithmPossibilities場景文件實現算法的可能性 8.3.1ConfigureaSolutionObj 8.3.2DoBatchBackTests批量回測 8.3.3DoWalkForwardBackTests移動窗格檢驗 8.3.4DoMonteCarloBackTests蒙特卡羅回測 8.3.5DoContinuous(Additive)BackTests連續(xù)回測 8.3.6RunBackTesttoLoadIndicatorsthenSwitchtoLiveTrading回測時加載指標,然后切換到實盤 8.3.7DoCustomOptimizationofStrategies自優(yōu)化 8.3.8ProduceCustomReportOutputs產生自定的報告輸出 8.4ScenarioFileCodeExamples場景文件代碼示例 8.4.1SelectandLoadLiquidInstruments選擇和加載大流動性合約 8.4.2ABruteForceOptimizationLoop窮舉優(yōu)化循環(huán) 8.4.3RunSimulationonHistoricalDataandSwitchtoLive從模擬切換到實盤 411RevisionNotes修改說明………………851OpenQuantisanIDE(integrateddevelopmentenvironment)applicationfordesigningandexecutingcomputerizedquantitativetradingstrategiesoneitherhistoricalorlivemarketdata.OpenQuantisasimpler,moremodern,andlessexpensiveversionoftheoriginalprofessionalQuantDeveloperIDE.OpenQuant是一個利用歷史或實時數據進行設計和執(zhí)行量化交易的IDE(集成開發(fā)環(huán)境),它比面向專家的QuantDeveloper的更加簡單、現代和便宜的產品。Inparticular,theOpenQuantIDEhasamodernlookandfeel,abetterwindowdockingsystem,betterdraganddropcapabilities,asimplerprogrammingAPI,andaneasywayofswitchingbetweenSimulationTrading,PaperTrading,andLiveTradingmodes.特別的是,這個IDE有一個現代的外觀和風格,一個更好的窗口??肯到y,更方便的拖拽功能,更簡單的編程API和在模擬、仿真和實盤之間轉換的簡易方式。HereisalistofotherSmartQuantdocumentsthatmightbeofinteresttoOpenQuantusers.Theseotherdocumentsdiscussgeneraltradingandstrategydevelopmenttopics.Youmightwanttoreadthedocumentsinthefollowingordertomaximizeyourlearningspeed.以下是一些SmartQuant其他文檔的列表,你也許會對它們感興趣。這些文檔討論的主題是交易和策略開發(fā),你可以考慮按下面的順序閱讀這些文檔以便于加快學習速度。1.SystemArchitectureManual.ThismanualintroducesSmartQuantsystemterminology,majorsystemcomponents,andsystemconfigurationsforsolvingtypicalusergoals.系統構架手冊。這本手冊介紹了SmartQuant系統的術語、主要系統組件和典型的為了達到用戶目標的系統配置。2.GettingStartedManual.ThisOpenQuantmanual(theoneyouarereadingnow)showsyouhowtousetheOpenQuantIDEtoconfigureandexecuteasimplestrategyonhistoricaldatastoredintheIDEdatabase.Youcanchooseafinancialinstrument,runastrategy,andinspectthesimulationresults.入門指南。該指南(即本手冊)描述了如何使用該框架配置、執(zhí)行一個基于存儲在OpenQuantIDE數據庫中的歷史數據的簡單策略。你可以選擇一個金融產品,運行策略并且查看模擬結果。3.StrategyDevelopmentManual.Thismanualshowsyouhowtodesignandcodeuser-definedstrategiesonuser-specifiedfinancialinstruments.Themanualbeginswithanoverviewoftradingsystemdesign,thenmovesontoSmartQuantsystemconcepts,andfinallydiscussestheSmartQuantcodeforseveralstrategiesindepth.策略開發(fā)手冊。該手冊描述了如何基于用戶自定義的金融產品去設計和編寫策略。該手冊以交易系統設計綜述開始,然后描述了SmartQuant系統概念,最后深入討論了SmartQuant中幾個交易策略的代碼。ThisdocumentisanintroductoryGettingStarteddocumentfortheOpenQuantIDE,writtenatalevelthatissuitablefornovicestrategydevelopers.Experiencedstrategydeveloperswillhavenoproblemsatallunderstandingtheinformationprovidedhere.2本文檔是介紹OpenQuantIDE的入門文檔。適合初學的策略開發(fā)人員。有經驗的策略開發(fā)人員在理解本文的所有內容時不會有任何問題。ThemaingoalofthisdocumentistoshowyouhowtousethenewOpenQuantIDEtocreateandruncomputerizedtradingstrategiesoneitherhistoricalorlivemarketdata,usingeithersimulatedorlivetradeexecutionmodes.Inparticular,thisdocumentdiscussesthepurposeanduseofallIDEwindowssoyoucanusetheIDEproductively.本文檔的主要目的是說明如何使用新的OpenQuantIDE利用歷史或實盤數據來模擬或實盤執(zhí)行交易策略。此外,本文檔討論了所有IDE窗口的建立目的和使用方法,這樣,你就能有效率的使用這個IDE了。Thisdocumentdoesnottalkaboutthetheoryandclassificationofcomputerizedtradingstrategies.Nordoesdescribehowtowriteprofitableandefficienttradingsystemsusingtrendfollowing,gaptrading,volatilitytrading,orarbitragetradingstrategies.Forthatkindofinformation,readtheSmartQuantStrategyDevelopmentManual.本文檔討論的不是計算機交易策略的理論和分類,更沒有描述如何編寫有效的趨勢跟隨、跳空交易、波動率交易或者套利策略。想了解這些內容,請閱讀SmartQuant策略開發(fā)手冊。Afterreadingthisdocument,youshouldhaveagoodunderstandingofhowtheOpenQuantIDEworks,andshouldbeabletowriteandtestyourowntradingstrategiesrightaway.閱讀這篇文檔之后,你能深入了解OpenQuantIDE如何工作,并且能夠立刻編寫和測試自己的交3安裝證書文件ThelicensefilefortheOpenQuantapplicationisnamedOpenQuant.license.CopythisfileintotheSmartQuantFramework/bin/directory,normallylocatedhereinatypicaldefaultinstallationonWindows7:OpenQuant的證書文件被命名為OpenQuant.license。把這個文件復制到SmartQuant的C:\ProgramFiles\SmartQuantLtd\OpenQuant\Framework\bin\OpenQuant.licenseOnceOpenQuantcanfindthelicensefile,thesplashscreenwillnotshowa—“Demoversion”warning.只要OpenQuant能找到這個證書文件,啟動畫面就不會顯示“Demoversion”警告了。4覽OpenQuant開發(fā)界面ThissectionprovidesanoverviewofthemainelementsoftheOpenQuantuserinterface.Theinterfaceisintendedtosupporttheactivitiesof這一部分提供了OpenQuant用戶界面主要元素的概述。界面能支持如下功能:●Financialinstrumentanalysiswithtechnicalindicatorssuchasmovingaverages使用技術指標對金融合約分析,如移動平均線●StrategydevelopmentinC#usingtheOpenQuantprogrammingAPI,and使用C#語言,利用OpenQuantAPI進行策略開發(fā)●AutomatictradinginSimulation,PaperTrading,andLiveTradingmodesofoperation以模擬、仿真和實盤模式進行自動化交易First,hereisascreenshotoftheentireIDE,showingmenus,dockabletoolbars(deliberatelyspreadapartforvisualseparation),dockablesideandbottomwindows,andachartofAMZNshowninthecenterwindowpane.首先,這里有一張完整主界面的截圖,展示了菜單、??抗ぞ邫?為了觀看刻意展開),??總冗厵诤偷撞看翱冢€有一個在中心面板的圖表窗口正顯示股票AMZN。TheOpenQuantIDEismodeledaftermodernsoftwaredevelopmentIDEssuchasVisualStudio—themaindifferencebeingthatOpenQuantisintendedforcomputerizedquantitativetradingstrategydevelopment,whereasVisualStudioisintendedforgeneralsoftwaredevelopment.OpenQuant集成開發(fā)環(huán)境是以時下流行的軟件開發(fā)環(huán)境為模型,例如VisualStudio—主要區(qū)別是OpenQuant是面向計算機量化交易策略開發(fā),而VS面向通用軟件開發(fā)。ThissectionintroducestheIDEmenus,onebyone.Ascreenshotofeachmenuisfollowedbyabriefdescriptionofthemenufunctionality.這一部分一一介紹了IDE菜單。每個菜單都有一個截圖和一段簡短的菜單的功能描述。5FileEditViewSolutionDataToolsWindowHelpPerfoimancASimpleMovingAverageCross(SMA13.Close]SMA[T.CbseCodeOnBarHistoricalData(beta)AilsnDateTime《OuputOuputScriptExploreStopOCALeve0.98Qy4X4XReportEnableiFalseTestingPerioddaylColor1Color1Realtime2008-04-0512:26:51PMSolutionDataToolsWindowHelpStockAAPL.(TmR=8E?00)PerfomanceTheFileMenuprovidestheusualmenuchoicesforcreatingnewsolutioncontainersandstrategyprojects,openingexistingsolutionsandstrategies,andaccessingrecentlyusedsolutionsandstrategies.Asolutioncontainercancontainmultiplesimplementadifferentalgorithm,usingdifferentinstruments(tickers)andcodeblocks.文件菜單提供了通用的菜單選項,如創(chuàng)建一個新的解決方案和策略項目,打開已存的解決方案和策略,訪問最近使用的解決方案和策略。一個解決方案容器能包含多個策略項目。每個策略與解決方案結合,使用不同的合約和代碼塊能實現不同的算法。63.1.2TheEditMenu編輯菜單稱稱OpenQuant2-Chart(SimpleMrSPY國困白出AAPLDailyInstruTheEditMenuprovidestheusualcut/copy/paste/undo/redooptionsforeditingC#strategysourcecodefiles.(NochoicesareselectableinthisscreenshotbecausethemainwindowisacandlestickchartofAAPL—youmusthavesometext(code)selectedbeforeanyofthesechoiceswillbecomeactive.)編輯菜單提供了通用的剪切/復制/粘貼/撤銷/恢復選項,這些選項能編輯C#策略源文件。(在截圖中沒有選項能選擇,這是因為主窗口是一個AAPL股票的蠟燭圖——當你在使用這些選項之前,你必須有一些文本(代碼)能選擇。)7SolutionDataToolsWindowHelpAPLDailyPortfolioSMA[3.Clbse]SMA[T.Chse]十FProvidersProviderErrorsuQuoteMonitorToolbars田田PropertiesWindowDateTimeTheViewMenuprovideschoicesformanydifferentwindowpanesandtoolbars.Hereisabriefdescriptionofthevariouswindowpanes.ManyofthewindowpaneslistedontheViewmenuarevisibleintheentirescreenshotshownatthestartofthissection.視圖菜單提供了許多不同的面板和工具欄。這有個多種面板的簡單描述。在視圖菜單中羅列了許多面板,可以在本章節(jié)開始的完整截圖中明顯地看出來。Allofthedockingpanesontheleft,bottom,andrightsideoftheinterfacearemodern“tear-off”windowspanes.Bygrabbingthepanetitlebarwithyourmouse,youcantearoffthepanesandrepositionthematotherscreenlocationsinsideoroutsideofthemainwindowboundaries.左側、底部、左側的??棵姘宥际乾F代的可分離面板,通過鼠標拖動窗口標題欄,可以分離面板或者把面板定位在界面的其他位置,主窗口邊界內外均可。8ThelistbelowonlygivesashortintroductorystatementabouteachmenuchoiceontheViewmenu.AmoredetailedpictureanddescriptionofeachwindowpanereferencedbytheViewmenuisshownlaterinthisdocument.以下列表只給出了每個視圖菜單按鈕的簡短介紹。更多的細節(jié)圖片和每個視圖面板的描述會在這篇文檔之后的內容中列出?!馮heInstrumentswindowpane(topleft)showsfinancialinstrumentsthataredefinedforusebytheIDE.TheInstrumentsisvisibleunderneaththemenuinthisscreenshot.Youmustdefineyourfavoriteinstrumentsherebeforeyoucanusetheminatradingstrategy.合約面板(左上)展示了已定義的金融合約。截圖中的菜單遮擋了這些合約。你在交易策略中使用你喜歡的合約之前,必須先對這些合約下好定義。TheIndicatorswindowpane(bottomleft)showsvarioustechnicalindicatorsthatyoucandraganddropontoachartofaninstrumentforanalyzinginstrumentbehavior.TheIndicatorstabisinactiveinthisscreenshot.指標面板(左下)展示了多種技術指標,你能拖拽它們到一個合約的圖表上來分析這些合約的行為。指標選項卡在這個截圖中非活動狀態(tài)。TheOrderManagergrid(centertab)helpsyoutoview,enter,andcanceltradingordersthataresenttotheExecutionproviderthatisresponsibleforexecutingtradingorders.報單管理(中央選項卡)幫助你查看、入場和撤銷已發(fā)送給交易接口的交易指令,負責執(zhí)行交易指令。ThePortfoliogrid(centertab)showsallthetradesforalltheinstrumentsthatwereexecutedaspartofyourstrategy.AseparatePortfolioisprovidedforeachtradingmode(Simulation,PaperTrading,orLiveMode).ThePortfoliogridshowsyouropenpositionswhenyouareinlivetradingmode,profitandlossforthosepositions,aswellasAccountvaluesandAccounttransactions.投資組合(中央選項卡)顯示了作為你策略部分的已執(zhí)行的所有合約的所有交易。一個分離的投資組合提供了各種交易模式(模擬、仿真或者實盤模式)。當你在實盤交易模式的時候,投資組合選項卡顯示你的開倉頭寸,這些頭寸的盈虧,還有賬戶權益和交易記錄。TheProviderswindowpane(bottomleft)showsprovidersfortradeExecution,HistoricalMarketData,Instrumentdefinitions,andrealtimeMarketData.ThedockableProviderspanesharesdockingspacewiththeIndicatorspaneinthebottomleftofthescreen.提供商面板(左下)顯示了交易執(zhí)行,歷史數據、合約、實時行情提供商。提供商面板與指標面板共享左下??靠臻g。TheProviderErrorswindowpane(bottomcenter)showserrormessagesthatmightarisefromproviders.Typicalerrorsincludeconnectionfailuremessages,anddatarequestfailures.Checkthiswindowforinformationifyouhavetroublewithproviders.提供商錯誤面板(中下)顯示提供商引發(fā)的錯誤。典型的錯誤包括連接失敗信息,和數據請求失敗。如果你的提供商出現問題,請查看這個窗口的信息。9TheBrokerInfowindowpane(centertab)showsinformationaboutyourcurrentbrokeraccount,whenyouarepapertradingorlivetradingwitharealbrokerageaccount.Thecentertabisemptyifyouaredoingsimulatedtrading.賬號信息面板(中央)。當你仿真或實盤交易一個實際賬號時會顯示賬戶信息。模擬下只顯示空白。TheSolutionExplorerwindowpane(topright)showskeyaspectsofyourtradingstrategysuchasthesizeofbardatabeingused(Daily,5-Minute,etc),theinstrumentsbeingtraded,andtheC#sourcecodeandlistofAPIsoftwareeventsthatyourstrategycanutilizeinitsalgorithms.TowritesomecodeforaneventsuchasOnBarOpen,youdoubleclicktheeventnameinthiswindowtoopenupacodewindowinthecentertab.解決方案資源管理器面板(右上)顯示了你的交易策略的關鍵點,如bar數據(每日、5分鐘或其他)、要交易的合約、C#源代碼以及在策略中可能用到的事件列表。要編輯事件,如OnBarOpen,雙擊這個事件名打開一個代碼窗口。TheScriptExplorerwindowpane(topright)showsalistofscripts(actually,C#code)thatyoumightwritetoperformsimpleprogrammaticdatamanagementtasksortotestcodingideasthatcanusetheOpenQuantframework.Inotherwords,scriptsareutilityC#programsfordoingnon-strategysortsofthings.Forexample,youmightwritescriptstoaddinstrumentstothedatabase,convertmarkettradedataintobardataofvariouslengths,andsoon.腳本資源管理器面板(右上)顯示了一系列的腳本(事實上就是C#代碼),這些腳本能執(zhí)行簡單的數據管理任務,或者使用OpenQuant框架的代碼來測試自己的想法。例如,編寫腳本去把合約添加到數據庫,把市場交易數據轉為不同長度的bar數據,等等。TheQuoteMonitorgrid(centertab)displaysincomingquotesforinstrumentsofinterest.SimplydraganddropinstrumentsfromtheInstrumentpaneontotheQuoteMonitor,andstarttheQuoteMonitortotrackinstrumentbidandaskpricesinrealtime.IfyouarenotconnectedtoamarketdataproviderwhenyoudraganinstrumentontotheQuoteMonitor,itwillpromptyoutoestablishaproviderconnection.行情報價監(jiān)示器網格(中)顯示了接收到的感興趣合約的報價。把合約從合約面板拖拽到行情報價監(jiān)示器,運行監(jiān)示器來實時追蹤合約買價和賣價。如果你沒有連接一個市場數據提供商,那當你拖拽合約到報價監(jiān)視器時,它會提示你去建立一個提供商鏈接。TheOtherWindowsmenuchoicecurrentlyhasonlytheStartPagetabinthesubmenu.TheStartPagedisplaysinthecentertab,andshowsalistofrecentstrategysolutionlinksthatyoucanclicktoloadthereferencedsolutionintotheIDEforuse.其他窗口菜單目前只有開始頁選項卡在子菜單里。開始頁在中央選項卡顯示最近的策略解決方案鏈接列表,你可以加載最近的解決方案到IDE中使用。TheToolbars(allofwhicharetear-offanddockable)providefastaccesstocommonfunctions.Currentthereareseventoolbars—File,Edit,View,Solution,SolutionView,Chart,andInstruments.Eachtoolbarisshownanddescribedlaterinthisdocument.SeveralofthetoolbarsaredisplayedverticallyalongtherightsideofthemainIDEwindow.工具條(都能分離和可???提供了常用功能的快捷訪問。通常,有7個工具條文件、困困日編輯、視圖、解決方案、解決方案視圖、圖表、合約。每個工具條都將在本文檔之后的內容中描述。部分工具條在主IDE窗口的右邊豎著顯示。TheOutputwindowpane(bottomcenter)showsprintedoutputoriginatingfromtheIDEandfromprintmessagesinyourstrategy.Forexample,compilationsuccessmessagesappearhere,aswellasdebuggingmessagesfromyourstrategy.CompilationerrorsaredisplayedintheErrorListwindow,whichsharesdockingspacewiththeOutputwindow.輸出面板(中下)顯示從IDE和策略中輸出而來的打印輸出。例如,編譯成功信息在這顯示,策略的調試信息也在這顯示。編譯錯誤顯示在錯誤列表窗口,它和輸出窗口共享相同的空間。ThePropertieswindowpane(bottomright)showsthepropertiesofwhateverobjectisselectedelsewhereintheIDE.Read-writepropertiescanbemodifiedhere.Propertyvaluessuchasstrategyparameterscanbemodifiedherebetweenstrategyruns.屬性面板(右下)顯示了在IDE中選定的任意內容的屬性。可以在這修改可讀寫的屬性。屬性值例如策略參數在策略運行時也可以在這修改。Forpractice,hereisanotherscreenshotofthemainscreen.Nowthatyouknowmoreaboutthevarioustabs(egScriptExplorer)andwheretheyarelocated(seethemanyverticalToolbarsontherightsideofthemainscreen),seeifyoucanidentifythefunctionofeachwindowpane.為了方便練習,這有另一張主界面截圖?,F在你可以更了解多種選項卡(如腳本資源管理器),知道它們的位置(看主界面右側的大量垂直工具條),看看你能否識別每個面板的功能。OpenQuant2-SolutionExplorerFileEdtViewSolutionDataToolsWindowHelp-□PerformanceFTlndexSMA[B,Clbee]SMAT,Cbse)Code+田fe HistoricalData(betaHistoryInstrumentMaiketData200413n?2DateTime0uputProvider0uputProviderldCodeStopOCALeve.0.98日MessagReportEnablerFalseTestingPeriodday1Color1Color1>ColorofSMA1Realtime2008-04-0512:26:51PM3.1.4TheSolutionMenu解決方案菜單FileEditWiewSolutionDataToolsWindoManageReferenceseD.dosebUpdateUIduringsimulationWiewResultsViewPerformanceViewMarketScannerTheSolutionMenuprovidesfunctionsformanagingreferencestocodelibraries,andforbuilding,running,pausing,stopping,andviewingtheoutputofyourstrategyinvariousways(chart,results,performance,andmarketscanner).解決方案菜單提供了代碼庫的管理功能,構建、運行、暫停、停止,用多種方式(圖表、結果、績效、市場掃描)查看策略輸出。Ifyouwanttowatchthebarsandtradesflashbyonyourscreenasyourstrategyruns,youcantelltheIDEtoupdatethechartdisplayduringthesimulation.UpdatingtheIDEalsomeanstoupdateallotherwindowsthatshowdynamicinformation—portfoliopositions,accountvalues,andtransactionvalues.UpdatingtheIDEslowsdownsimulationssignificantly,sothedefaultisnottoupdatetheIDE.如果你想查看策略運行時屏幕上閃過Bar與交易,你可以讓IDE在模擬中更新圖表。更新IDE還意味著更新所有其他顯示動態(tài)信息的窗口,證券投資組合持倉、賬戶權益、交易記錄。更新IDE會顯著地減慢模擬,所以默認是不更新IDE。TheOptimizechoicedisplaystheOptimizationdialogsoyoucanoptimizevariousstrategyparameters.Tooptimize,youmustcodeoptimizationparameters(describedlater)andspecifyanoptimizationrangeandincrementsizefortheparameters.ThenOpenQuantloopsandrunscompletelynewsimulations,oneforeachpossibleparameterset.Asummaryofresultsisdisplayedattheendofallruns.優(yōu)化選項顯示優(yōu)化對話框以便你能優(yōu)化不同策略參數。為了優(yōu)化,你必須編寫優(yōu)化參數(之后會說)、指定優(yōu)化范圍、步長。然后OpenQuant循環(huán)并完整運行新解決方案每個可能的參數集。在所有運行結束后會展示一個結果匯總。TheSolutionmenualsoprovidesfunctionstoviewthefollowingdisplays(SolutionViews).EachoftheseviewsisalsoavailableontheSolutionViewtoolbarontherightsideofthemainscreen.解決方案菜單也提供查看下列顯示(解決方案視圖)的功能。這些視圖都可以在主界面右側的解決方案視圖工具條中操作?!馮hebarchartofinstrumentpricesandindicatorsbar圖表顯示合約價格和指標●Theresultsofyourstrategy(barchart,tradepoints,andtransactions)策略的結果(bar圖表、交易點、交易記錄)●Theperformanceofyourstrategy(statisticsonaverageprofitpertrade,equitycharts,etc)策略的績效(統計每次交易的平均利潤、權益圖表,等等)●Thecodeforyourstrategy(soyoucane策略的代碼(這樣你就能檢驗和編輯代碼了)3.1.5TheDataMenu數據菜單DataToolsWindowHelpDataManager…NCSVorTextFiles.TAQCD…Download.XCompressBars...MarketDataDailyInstrumentsRealtimeESignalGenesisntspenHistoricalData(beta)MBTradingOpentickOpenTickPATSAPIQuoteTrackerTTAPITTFIX4F2004Jan02Feb-02Mar.01TheDataMenuprovidesmanyusefulfunctionsforimportingordownloadingvariouskindsofdataforuseinyourtradingstrategies.數據菜單提供了多種有用的功能,能導入和下載多種數據,你能在你的交易策略中使用這些數據?!馯singtheCSVorTAQchoicesonthismenu,youcanimporthistoricalinstrumentdataintheformofCSV(comma-separatedvalues)orastextfilesfromaTAQ(tradeandquotesCD).在菜單中使用CSV或者TAQ選項,你可以以CSV格式導入歷史合約交易數據或者以TXT格式從TAQCD導入數據?!馯singtheDownloadchoice,youcandownloadhistoricalmarketdatafromremoteserviceproviderssuchasESignal.使用下載選項,你能從遠程的服務提供商下載歷史數據,例如ESignal。UsingtheInstrumentssub-menu,youcandownloadlistsofinstrumentsfromaprovidersoyoudon'thavetotypethemallinmanually.使用合約子菜單,你能從提供商下載合約列表,這樣你就不必手工輸入他們了。UsingtheRealtimechoice,youcandownloadmarketdatafromamarketprovider.使用實時選項,你能從市場數據提供商獲取市場數據。UsingtheHistoricalData(beta)choice,youcandownloadhistoricaldatafromwebsitessuchasYahoo,orfromdataserviceproviderssuchasESignalorGenesis.使用歷史數據(測試版)選項,你能從網站例如Yahoo等下載歷史數據,或者從數據服務提供商如ESignal或者Genesis下載數據。Finally,youcancompressfine-grainedtradedataseriesinformationintobarsoflargersize—bytime(1secondto6hours),bytick(1to1000ticks),byvolume(10to100,000),orbypricerange最后,你能壓縮細粒度的成交序列為bars——按時間(1秒到6小時),按tick(1到1000),按成交量(10到100,000)或按價格范圍(0.001到1)。SolutionDataToolsWindowHelpChartColorManager..4XOptions..S200906]DataSeriesObjectCount《TheToolsMenuprovidesfunctionsformanagingChartColorTemplatesandforsettingglobalapplicationoptions.工具菜單提供了管理圖表顏色模板和設置全局應用程序的選項。TochangethedefaultMidnightBluechartcolor,usethechartcolormanagerdialogtocreateanewtemplatewithyourownfavoritecolors,andsetitasthedefault.Ifyouupgradetheprogramtoalaterversion,theupgradedprogram(atleastasofVersion2.7.3)willnotrememberyourchoiceofdefaulttemplate,soyouwillhavetoresetthedefault.Theupgradeprocessdoesnotdestroyyourtemplates,butitdoesforgetwhichonethatyoudefinedasthedefault.要改變默認的午夜藍圖表顏色,使用圖表顏色管理對話框來創(chuàng)建一個自己喜歡顏色的模板,然后設置為默認。如果你把程序升級為新版本,升級后的程序(至少在2.7.3版本之前)不會記錄你設置的模板,所以不得不重新設置。升級進程不會刪除你的模板,但它會忽略你定義的默認模板。MemoryErrors使用“選項”對話框,解決內存溢出的錯誤Theoptionsdialogismostlyselfexplanatory,exceptforsomeGeneralsettingsthatcanhelptoprevent"OutofMemory"errors.Duringabacktestingsimulation,OpenQuantstoresallincomingbars,quotes,andtradesinarraysininternalmemory.Thestoredbar,quote,andtradevaluesarerequired(1)forchartreplay,and(2)forportfoliovaluecalculationsthatinvolvethewholesimulation.Chartreplayisobviouslyusefulwhenyouwanttoscrollthebarchartbacktothebeginningofthesimulationtoseeallbarsinthewholesimulation.選項對話框是不言自明的,除了一些常規(guī)設置還可以幫助以防止出現“內存不足”的錯誤。在回溯測試中,OpenQuant內部存儲了所有傳入的bar,quotes和trades。(1)用于圖表回放,(2)涉及整個模擬的投資組合的價值計算。當你想要在整個模擬中滾動圖表回到模擬的開始階段看所有的bar時,圖表回放功能顯然是必須的。Theportfoliostatisticscalculationsarenotalwaysuseful,butbydefaulttheyareupdatedaseachnewtradearrives,andeachseparatevalueisstoredinanotherinternalarray.Thesestatisticscanconsumealotofmemoryifyouareprocessingalotoftrades,andarethesourceofmanyoutofmemoryerrors.投資組合的統計計算并不總是需要,但默認情況下,有新交易到來時進行更新,每一個單獨的值存儲在另一個內部數組。如果你正在處理大量的交易(這就是內存不足錯誤的來源),這些統計數據會消耗大量的內存。Toavoidmostoutofmemoryerrors,disablethecalculationofportfoliostatisticsundertheBacktestingsectionoftheOptionsdialog.Notonlywillthisfreeuplotsofinternalmemoryconsumption,butitwillalsohelpyoursimulationstorunnoticeablyfasterbecausethestatisticsdonothavetobecalculated.為了避免出現內存不足的錯誤,禁用“選項”對話框的回溯測試部分中的統計組合計算。這不僅會釋放很多內存,也將幫助您的明顯加快模擬運行,因為統計數據沒有進行計算。3.1.8TheHelpMenu幫助菜單稱稱OpenQuant2-Chart(SimpleMoving.AverageCrossover)雨ViewAAPLTheHelpMenuprovidesfunctionsforaccessingPDFdocuments(suchasthisone)andforsearchingandbrowsingAPIdocumentationinasearchableHelpviewerwindowformat.幫助菜單提供了訪問PDF文檔(例如本文)的功能,也可以通過幫助查看器窗口搜索并瀏覽API3.2UnderstandingIDEToolbars了解IDE工具條Thissectionintroductionstheoperationsthatareaccessiblethroughconvenienttoolbarbuttons.本部分介紹了通過快捷工具條按鈕的業(yè)務操作。Ihavereorganizedthetoolbarsinthescreenshotsbelowtoseparatethemandputthemallintotworowsfordocumentationconvenience.Bydefault,theyareorganizedinadifferentpatternthatyoucanseeinthepicturesofthemainscreen,butofcourseyoucanclickanddragthetoolbarstoarrangethemtosuityourowntaste.我已經認識了下圖的工具條,為了操作便利把它們變成了兩行。默認它們都按不同的模式分組,如主界面所示,但是你也能單擊和拖拽工具條來把它們按你自己的喜好來排列。OpenQrOpenQr-nt2-code.cs(SimpleMovingAverageCrossover)EdtewSolutionDataToolsWindowHelp¥5imulationTheFileToolbarprovidesonlytwobuttons—oneforcreatingNewSolutionsandProjects,andoneforOpeningexistingsolutionsandprojects.文件工具條只提供2個按鍵——一個建立新的解決方案和項目,一個打開已存的解決方案和項AAPL:5imulationNTheEditToolbarprovidesbuttonsforSave,Cut,Copy,Past,Undo,andRedooperations.編輯工具條提供保存、剪切、復制、粘貼、撤銷和恢復操作按鈕。3.2.3TheInstrumentToolbar合約工具條Fle.EdtMewSolutionDataoolsWindowHelp8AAPL:Smulation題團@TheInstrumentToolbarprovidesaneasywaytochooseaninstrumentandabarsizeforviewinginthetabsofthecenterwindow.Asinglestrategycanrunagainstmultipleinstrumentswithmultiplebarsizes,soyoucanusethistoolbartorapidlychangeinstrumentsandbarsizeswhenyouwanttolookattheresultsofasimulationforparticularinstrumentsandbarsizes.合約工具條提供了一個簡單的方法來選擇一個合約或bar,你可以在中央窗口里查看。一個簡單的策略運行時支持多個合約的多種bar,當你想看一個特定的合約和bar的模擬結果時,你能用這個工具條來迅速改變合約和bar。3.2.4TheSolutionToolbar解決方案工具條OpenQuant2-code.cs(SimpleMovN:四@②TheProjectToolbarprovidesbuttonsforworkingonyourstrategyproject:項目工具條提供了運行策略項目的按鈕:Buildthestrategy構建策略●Execute(run)thestrategy執(zhí)行(運行)策略Pauseexecutionofthestrategy暫停執(zhí)行策略Stopexecutionofthestrategy停止執(zhí)行策略●UpdateUIdurings模擬中更新用戶界面(高亮顯示)Viewstrategybarchart查看策略bar圖表查看策略結果查看策略績效Viewstrategycode查看策略代碼3.2.5TheTradingModeToolbar交易模式工具條FileEdtSolutionDataToolsWindowHelpN:四@SimulationInstrumentsTheTradingModetoolbarprovidesthreechoicesforselectingyourtradingmode:交易模式工具條提供了三種選擇來選擇你的交易模式:●Simulation(historicalmarketdata,simulatedtradeexecution)模擬(歷史市場數據,模擬交易執(zhí)行)●PaperTrading(livemarketdata,livetradeexecutiononatestaccountwithfakemoney)仿真交易(實盤市場數據,用測試賬戶進行實盤交易執(zhí)行測試)●LiveT

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論