
等级: 新手上路
- 注册:
- 2021-8-27
- 曾用名:
|
Params
Numeric NN1(55);
Numeric N2(6.4);
Numeric LOT(1);
Vars
NumericSeries HH;
NumericSeries LL;
NumericSeries RH;
NumericSeries RL;
NumericSeries BBB;
NumericSeries SSS;
NumericSeries BB;
NumericSeries SS;
NumericSeries RBBH;
NumericSeries RSSH;
NumericSeries BBL;
NumericSeries SSL;
NumericSeries RBBL;
NumericSeries RSSL;
NumericSeries VVB;
NumericSeries HHTD;
NumericSeries VVBN;
NumericSeries VVBN2;
NumericSeries VVS;
NumericSeries LLTD;
NumericSeries VVSN;
NumericSeries VVSN2;
NumericSeries MyPrice;
NumericSeries VBBB;
NumericSeries VHHH;
NumericSeries VSSS;
NumericSeries VLLL;
NumericSeries HL;
NumericSeries VLLL1;
NumericSeries VHHH1;
NumericSeries SJ;
NumericSeries ZT;
NumericSeries KBAR;
NumericSeries ZUIGAOYINPRICE1;
NumericSeries ZUIGAOYINPRICE;
NumericSeries PINGCANG;
NumericSeries XZ;
NumericSeries tiao;
NumericSeries BBS;
Begin
tiao=MinMove*PriceScale*1;
HH=Highest(H,NN1);
LL=LOWEST(L,NN1);
RH=HH[1];
RL=LL[1];
BB=NthCon(HH>RH)+1;
SS=NthCon(HH<RH)+1;
RBBH=BB[1];
RSSH=SS[1];
////////////////////////////////////////////////////////////////
BBL=NthCon(LL>RL)+1;
SSL=NthCon(LL<RL)+1;
RBBL=BBL[1];
RSSL=SSL[1];
XZ=IIF(IntPart(AvgTrueRange(21))/2>=1,1,0);
If(CountIf(Abs(vol/vol[1])>1.05,10)>5 AND XZ>=1)
{
SJ=Highest(IntPart(Rand(15,50)),5);
BBS=1;
}Else SJ=1; BBS=0;
ZT=IIF(RBBH<RSSH AND RBBL<RSSL,1,IIF(RBBH>RSSH AND RBBL>RSSL,-1,0));
Commentary("随机数"+Text(SJ));
if(h>RH and MarketPosition==0 and ZT==1)//
//if(h>RH and MarketPosition==0)
{
MyPrice=Max(O+tiao,RH+tiao);
Buy(lot,MyPrice);
KBAR=CurrentBar;
}
if(l<RL and MarketPosition==0 and ZT==-1 )//
//if(l<RL and MarketPosition==0)
{
MyPrice=Min(Open-tiao,RL-tiao);
SellShort(lot,MyPrice);
KBAR=CurrentBar;
}
//////////////PINGDUO//////////
if(MarketPosition==1)
{
ZUIGAOYINPRICE1=Highest(H,CurrentBar-KBAR+1);
if(CurrentBar-KBAR==0)
{ZUIGAOYINPRICE=H; }
if(CurrentBar-KBAR>0)
{ZUIGAOYINPRICE=ZUIGAOYINPRICE1[1];}
PINGCANG=Lowest(ZUIGAOYINPRICE*(1-N2/100)*(1-SJ/1500),5);
}
Commentary("ZUIGAOYNPRICE1="+TEXT(CurrentBar-KBAR+3));
if(L<PINGCANG and MarketPosition==1 and BarsSinceLastEntry>0)
{ MyPrice=Min(Open,PINGCANG);
Sell(lot,MyPrice-tiao);
}
///////////////////PINGKONG/////////
if(MarketPosition==-1)
{
ZUIGAOYINPRICE1=LOWEST(L,CurrentBar-KBAR+3);
if(CurrentBar-KBAR==0)
{ZUIGAOYINPRICE=L; }
if(CurrentBar-KBAR>0)
{ZUIGAOYINPRICE=ZUIGAOYINPRICE1[1];}
PINGCANG=Highest(ZUIGAOYINPRICE*(1+N2/100)*(1+SJ/1500),9);
}
if( h>PINGCANG and MarketPosition==-1 and BarsSinceLastEntry>0)
{ MyPrice=Max(O,PINGCANG);
BuyToCover(lot,MyPrice+tiao);
}
PlotNumeric("PINGCANG",PINGCANG);
Commentary("ZT= " +TEXT(ZT));
end
|
|