1、数据通信(Loading Data API.sas)
2、信号检测(Long And Short API.sas )
3、模拟交易(Calculation Performance API.sas)
4、绩效报告(Performance Report API.sas )
这四个模块初具成形,但还有待提高。系统介绍如下:
|*****************The Information of SAS Back Trading System****************|
|--Description--------------------------------------------------------------|
| This is a Programming Trading Back System that provide accurate |
| back transaction record executive bag and detailed transaction report |
| package,applicable to all kinds of securities. |
| |
|--Routine Package----------------------------------------------------------|
| 1. Loading Data API.sas |
| 2. Long And Short API.sas |
| 3. Calculation Performance API.sas |
| 4. Performance Report API.sas |
| |
|--Loading Data API.sas-----------------------------------------------------|
| This routine package contains three Macro Programs,Their main task |
| is to read dataset.Three Macro Program name are LoadingDataAlone(1), |
| LoadingDataMore(2) and LoadingDataFromYahoo(3) respectively,Now to |
| describe their usage. |
| (1)LoadingDataAlone(Dir=,DataTableType=,Library=,DataSetName=,getnames=) |
| Call methods: |
| % LoadingDataAlone( |
| Dir = "C:\Documents\IF300.csv", |
| DataTableType = csv, |
| Library =work, |
| DataSetName = a4, |
| getnames = yes ) |
| Each variable meaning:Dir外部数据表的路径 DataTableType数据类型 |
| Library逻辑库名 DataSetName输出数据集名称 getnames是否读入变量名YES NO |
| (2) LoadingDataMore(dir= ,Library = ) |
| Call methods: |
| % LoadingDataMore( dir=E:\期货EXCEL表,Library =work ) |
| (3)LoadingDataFromYahoo(code=, start=, end=, prompt=NO) |
| Call methods: |
| % LoadingDataFromYahoo(code=000001.SZ, start=1/1/2005, end=11/16/2012) |
| Each variable meaning:code为股票代码,美票不用加后缀,深市代码后加.SZ, |
| 沪市代码后加.SS,如000001.SZ为深发展代码.start和end分别为起止日期,格式为 |
| mm/dd/yyyy .prompt:是否弹出窗口输入上述参数(一般为NO) |
| |
|--Long And Short API.sas---------------------------------------------------|
| This routine package contains eight Macro Programs,their main task |
| is to detection trading signal in market.Now to describe their usage. |
| (1)OpenLong(BuyPrice = ) |
| This is a Macro that opening Long Position. |
| (2)OpenShort(SellShortPrice = ) |
| This is a Macro that opening Short Position. |
| (3)CloseLong(SellPrice = ) |
| This is a Macro that closing Long Position. |
| (4)CloseShort(BuytoCoverPrice = ) |
| This is a Macro that closing Short Position. |
| (5)CloseLongAndOpenShort(SellPrice = ,SellShortPrice = ) |
| This is a Macro that closing Long and opening Short Position. |
| (6)CloseShortAndOpenLong(BuytoCoverPrice = , BuyPrice = ) |
| This is a Macro that closing Short and opening Long Position. |
| (7)ForceCloseLong(SellPrice = ) |
| This is a Macro that force closing Long Position. |
| (8)ForceCloseShort(BuytoCoverPrice = ) |
| This is a Macro that force closing Short Position. |
| |
|--Calculation Performance API.sas------------------------------------------|
| This routine package contains one Macro Program,it main task is to |
| place an order and excution simulation trade in market.This Macro need |
| to use macro variable -Short- to specify strategy have shorting mechanism|
| Now to describe it usage. |
| Call methods: |
| % computePerformace(Short = NO) |
| Note: The strategy have no shorting mechanism then variable Short to be |
| set NO,and they have shorting mechanism then Short to be set YES must. |
策略编辑界面:
- /***************************************************************************/
- /*Subject: Programming Trading Strategy Editor */
- /*策略描述:*/
- /*作 者: */
- /*通讯方式:*/
- /*完成日期:*/
- /***************************************************************************/
- Options mprint mlogic;
- /*接口程序目录*/
- filename Frame "E:\工作\SAS程序化交易系统\Framework API";
- /*调用并编译各API的源文件*/
- %include Frame(LoadingDataAPI.sas);
- %include Frame(LoadingStockDataFromYahoo.sas);
- %include Frame(LongAndShortAPI.sas);
- %include Frame(CalculationPerformanceAPI.sas);
- *****************Step1:数据装载;
- *****************Step2:策略算法;
- *****************Step3:检查信号;
- *****************Step3:模拟交易,并输出策略评估报告;
/*还请感兴趣的人士,讨论我的方案可行性*/



雷达卡





京公网安备 11010802022788号







