据说有90胜率的交易系统Word下载.docx
《据说有90胜率的交易系统Word下载.docx》由会员分享,可在线阅读,更多相关《据说有90胜率的交易系统Word下载.docx(8页珍藏版)》请在冰豆网上搜索。
3=DrawdownModel;
4=KellyModel;
5=Williams'
Model;
6=FixedRatioModel;
7=MarketMoneyModel}
MM
(1),{%Riskparameter}
MM_add(0),{%Riskforplayingmarketmoney;
0to
disactivate}
MaxVolat(100),{%Riskforplayingmarketmoney;
100to
MaxDD(20),{%Drawdown资金回撤率}
InitCapital(100000);
{Initialcapitaltotrade开始资金}
Vars:
LL(99999),HH(0),Trend(0),
Volat(TrueRange);
MP(0),Risk(Range),Num
(1),
add_num(0),red_num(0),FRDelta(0),DD(0),Equity(InitCapital),
TotalEquity(InitCapital),
EqTop(InitCapital),AssuredProfit(0),HPositionProfit(0),
Kelly(0);
MP=MarketPosition;
Volat=.5*TrueRange.5*Volat[1];
ifMP&
lt;
=0then
begin
ifPrice
&
LLthenLL=Price;
crossaboveLL*(1+PtUp*.01)then
Trend=1;
HH=Price;
end;
end;
gt;
=0thenbegin
HHthenHH=Price;
if
PricecrossbelowHH*(1-PtDn*.01)then
Trend=-1;
LL=Price;
Iftrend=1thenRisk=PtDn*.01*close{Slippage};
Iftrend=-1thenRisk=PtUp*.01*close{Slippage};
HPositionProfit=maxlist(OpenPositionProfit,
HPositionProfit);
AssuredProfit=HPositionProfit-Risk;
Equity=InitCapitalNetProfit;
TotalEquity=EquityOpenPositionProfit;
EqTop=MaxList(EqTop,TotalEquity);
ifMM_Model=1then{%RiskModel}
Num=
floor(MM*Equity*.01/Risk);
ifMM_Model=2then{%VolatilityModel}
Num
=floor(MM*Equity*.01/Volat/BigPointValue);
ifMM_Model=3thenbegin{DrawdownModel}
floor(MM*(Equity-(1-MaxDD*.01)*EqTop)*.01/Volat/
BigPointValue);
ifMM_Model=4then
begin{KellyModel}
If
TotalTrades&
20andGrossProfit&
0
then
Kelly=NumWinTrades/TotalTrades*(1-
GrossLoss/GrossProfit)
else
Kelly=
0.1;
ifKelly
.9thenKelly=.9;
floor(MM*Kelly*Equity*.01/Risk);
{Print(Kelly);
}
ifMM_Model=5then
begin{LarryWilliams'
Model}
value11
=MaxList(-LargestLosTrade/MaxList(CurrentContracts,1),
Risk);
Num=floor(MM*Equity*.01/value11);
ifMM_Model=6then
begin{FixedRatioModel}
{DD=MaxList(DD,(EqTop-TotalEquity)/MaxList(CurrentContracts,
1));
{Max
Drawdown}
ifTotalTrades&
20andDD&
0then
FRDelta=MM*DD*.01
else}
FRDelta=MM*volat*BigPointValue*.01;
{Delta}
value12=MaxList(Equity-.5*close*(closeFRDelta)/FRDelta,
0.25);
Num=floor(SquareRoot(2*value12/FRDelta.25).5);
ifMM_Model=7then{Playingthemarketmoney}
num=floor((MM*(InitCapitalMinList(NetProfit,0))MM_add
*
MaxList(NetProfit,0))*.01/Volat/BigPointValue);
{Entries}
iftrend=1andtrend[1]&
1then
buy("
Trend.LE"
)numcontractsatmarket;
iftrend=-1andtrend[1]&
-1then
sell("
Trend.SE"
add_num=floor(MM_add*AssuredProfit*.01/Volat/
{AssuredProfitPyramiding}
ifadd_num&
0andOpenPositionProfit
Volat*BigPointValuethen
ifTrend=1andMP=1thenbuy("
Add.LE"
)add_numcontractsat
market;
Trend=-1andMP=-1thensell("
Add.SE"
red_num=floor((CurrentContracts*Volat*BigPointValue-
MaxVolat*
TotalEquity*.01)/close);
ifred_num&
ifTrend=1andMP=1thenexitlong("
Red.LX"
)red_numcontracts
atmarket;
ifTrend=-1andMP=-1thenexitshort("
Red.SX"
)red_num
contractsatmarket;
ifNum&
1thenNum=1;
这个系统很简单的,大概说明以下:
1从“MP=MarketPosition;
”开始才是指令,前面为参数说明,变量定义
2MarketPosition表示多头空头,这是一个双向交易系统,多头、空头规则不同
3然后是一段趋势跟踪:
ifPrice&
ifPricecrossaboveLL*(1PtUp*.01)thenbegin
ifPricecrossbelowHH*(1-PtDn*.01)thenbegin
4然后是一段风险计算指令
AssuredProfit=HPositionProfit-Risk
5然后是头寸计算指令,一共有7种模型
......
6然后是开仓指令
交易采用市价指令,趋势变化时