首页 > 编程知识 正文

开拓者tb自带领航交易策略,tb交易开拓者官网

时间:2023-05-05 03:20:16 阅读:254837 作者:2153

Params
Numeric N1(5);
Numeric N2(10);
Numeric ShortLimen(0);
Numeric LongLimen(0);
Numeric LinearLength(3);
Numeric Margin(0.12);
Numeric LotsChoose(0);

Numeric Lot(1);
string UserID(“simulate”);
String CODE(“ni1601”);
Numeric slippoint(10);

Vars

Numeric ma5;
NumericSeries Xnum;
Numeric Center;
Numeric A;
Numeric A1;
Numeric B;
Numeric B1;
NumericSeries pointA;
NumericSeries pointB;
NumericSeries SlopeA;
NumericSeries SlopeB;
NumericSeries OpenEntryPrice;
NumericSeries WinTimes;
NumericSeries WinPoints;
NumericSeries LossTimes;
NumericSeries LossPoints;
Numeric WinRate;
Numeric ProfitAndLoss;
Numeric TotalEquity;
Numeric lots;
NumericSeries ADXV;
NumericSeries PDI;
NumericSeries MDI;
NumericSeries sendprice;
Numeric minpoint;

Begin

If(highlow )Return;
if(CurrentBar0)
{ WinPoints=0;
LossTimes=0;
LossPoints=0;
}
TotalEquity = Portfolio_CurrentCapital() + Portfolio_UsedMargin();
If(LotsChoose1)
{
WinRate=WinTimes/(WinTimes+lossTimes);
ProfitAndLoss=(WinPoints/WinTimes)/(LossPoints/lossTimes);
TotalEquity = Portfolio_CurrentCapital() + Portfolio_UsedMargin();
lots=IntPart((TotalEquity*(WinRateProfitAndLoss-(1-WinRate))/ProfitAndLoss)/(OpenBigPointValue()*ContractUnit()*margin));
} Else If(LotsChoose2)lots=IntPart(TotalEquity0.1/(OpenBigPointValue()ContractUnit()margin));
Else lots=lot;
If(lots<1)lots=1;
Xnum=(3Close+Low+Open+High)/6;
Center=(20Xnum+19Xnum[1]+18Xnum[2]+17Xnum[3]+16Xnum[4]+15Xnum[5]+14Xnum[6]+13Xnum[7]+12Xnum[8]+11Xnum[9]+
10Xnum[10]+9Xnum[11]+8Xnum[12]+7Xnum[13]+6Xnum[14]+5Xnum[15]+4Xnum[16]+3Xnum[13]+2Xnum[18]+Xnum[20])/210;
A=(Highest(Center,10)+Highest(Center,30)+Highest(Center,N1))/3;
A1=(Highest(Center,10)+Highest(Center,30)+Highest(Center,N2))/3;
B=(Lowest(Center,10)+Lowest(Center,30)+Lowest(Center,N1))/3;
B1=(Lowest(Center,10)+Lowest(Center,30)+Lowest(Center,N2))/3;
pointA=(Center+A+A1)-3Center;
pointB=3Center-(Center+B+B1);
SlopeA=LinearRegSlope(pointA,LinearLength);
SlopeB=LinearRegSlope(pointB,LinearLength);
ADXV=ADX(3,14); If(MarketPosition==0 And SlopeB[1]<=0 And ADXV[1]>25 And PDI[1]<MDI[1] )
{}
if(MarketPosition==-1 And SlopeB[1]>ShortLimen)
{
BuyToCover(0,Open);
if(Open<=OpenEntryPrice)
{ WinPoints=WinPoints+(OpenEntryPrice-open);
}
if(Open>OpenEntryPrice)
{
LossTimes=lossTimes+1;
lossPoints=lossPoints+(open-OpenEntryPrice);
}
}
If(MarketPosition0 And SlopeA[1]<=0 AND ADXV[1]>25 And PDI[1]>MDI[1])
{
Buy(lots,Open); }
if(MarketPosition1 And SlopeA[1]>LongLimen)
{
Sell(0,Open);
if(Open>=OpenEntryPrice)
{ WinPoints=WinPoints+(Open-OpenEntryPrice);
}
if(Open<OpenEntryPrice)
{
LossTimes=lossTimes+1;
lossPoints=lossPoints+(OpenEntryPrice-Open);
}
}

PlotNumeric(沉默的书包,SlopeB,0,Green);
Commentary(“TotalEquity=”+Text(Open*BigPointValue()*ContractUnit()*margin));
Commentary(“PDI=”+Text(ADX(1,14)));
Commentary(“MDI=”+text(ADX(2,14)));
Commentary(“ADX=”+Text(ADX(3,14)));
End

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。