据说有90胜率的交易系统.docx
- 文档编号:3047647
- 上传时间:2022-11-17
- 格式:DOCX
- 页数:8
- 大小:15.96KB
据说有90胜率的交易系统.docx
《据说有90胜率的交易系统.docx》由会员分享,可在线阅读,更多相关《据说有90胜率的交易系统.docx(8页珍藏版)》请在冰豆网上搜索。
据说有90胜率的交易系统
据说有90%胜率的交易系统
据说有90%胜率的交易系统
Asystemgivingover90%profitable
trades.
[博主注:
easylanguge语言编写,适用于TS8、MC等软件,使用时去掉中间中文字]
{****************************************************
TheSimplestSystem#3withMoneyManagement.
Copyright(c)2002DT
****************************************************}
Input:
Price((HL)*.5),{中间价}
PtUp(4.),PtDn(4.),{Maxcorrectiontochangetrend}
MM_Model
(2),{1=%RiskModel;2=%VolatilityModel;
3=DrawdownModel;4=KellyModel;5=Williams'Model;
6=FixedRatioModel;7=MarketMoneyModel}
MM
(1),{%Riskparameter}
MM_add(0),{%Riskforplayingmarketmoney;0to
disactivate}
MaxVolat(100),{%Riskforplayingmarketmoney;100to
disactivate}
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<=0then
begin
ifPrice
<LLthenLL=Price;
ifPrice
crossaboveLL*(1+PtUp*.01)then
begin
Trend=1;
HH=Price;
end;
end;
ifMP>=0thenbegin
ifPrice
>HHthenHH=Price;
if
PricecrossbelowHH*(1-PtDn*.01)then
begin
Trend=-1;
LL=Price;
end;
end;
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}
Num=
floor(MM*(Equity-(1-MaxDD*.01)*EqTop)*.01/Volat/
BigPointValue);
end;
ifMM_Model=4then
begin{KellyModel}
If
TotalTrades>20andGrossProfit>0
then
Kelly=NumWinTrades/TotalTrades*(1-
GrossLoss/GrossProfit)
else
Kelly=
0.1;
ifKelly
>.9thenKelly=.9;
Num=
floor(MM*Kelly*Equity*.01/Risk);{Print(Kelly);}
end;ifMM_Model=5then
begin{LarryWilliams'Model}
value11
=MaxList(-LargestLosTrade/MaxList(CurrentContracts,1),
Risk);
Num=floor(MM*Equity*.01/value11);
end;
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);
end;
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")numcontractsatmarket;
add_num=floor(MM_add*AssuredProfit*.01/Volat/
BigPointValue);
{AssuredProfitPyramiding}
ifadd_num>0andOpenPositionProfit
>Volat*BigPointValuethen
begin
ifTrend=1andMP=1thenbuy("Add.LE")add_numcontractsat
market;
if
Trend=-1andMP=-1thensell("Add.SE")add_numcontractsat
market;
end;
red_num=floor((CurrentContracts*Volat*BigPointValue-
MaxVolat*
TotalEquity*.01)/close);
ifred_num>0then
begin
ifTrend=1andMP=1thenexitlong("Red.LX")red_numcontracts
atmarket;
ifTrend=-1andMP=-1thenexitshort("Red.SX")red_num
contractsatmarket;
end;
ifNum<1thenNum=1;
这个系统很简单的,大概说明以下:
1从“MP=MarketPosition;”开始才是指令,前面为参数说明,变量定义
2MarketPosition表示多头空头,这是一个双向交易系统,多头、空头规则不同
3然后是一段趋势跟踪:
ifMP<=0thenbegin
ifPrice<LLthenLL=Price;
ifPricecrossaboveLL*(1PtUp*.01)thenbegin
Trend=1;
HH=Price;
end;
end;
ifMP>=0thenbegin
ifPrice>HHthenHH=Price;
ifPricecrossbelowHH*(1-PtDn*.01)thenbegin
Trend=-1;
LL=Price;
end;
end;
4然后是一段风险计算指令
Iftrend=1thenRisk=PtDn*.01*close{Slippage};
Iftrend=-1thenRisk=PtUp*.01*close{Slippage};
HPositionProfit=maxlist(OpenPositionProfit,
HPositionProfit);
AssuredProfit=HPositionProfit-Risk
5然后是头寸计算指令,一共有7种模型
......
6然后是开仓指令
{Entries}
iftrend=1andtrend[1]<>1then
buy("Trend.LE")numcontractsatmarket;
iftrend=-1andtrend[1]<>-1then
sell("Trend.SE")numcontractsatmarket;
交易采用市价指令,趋势变化时
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 据说 90 胜率 交易系统