设为首页收藏本站

 找回密码
 注册
楼主: qsb588986

又一个失败的策略。望大神提谐。 [复制链接]

Rank: 3Rank: 3

精华
0
UID
213396
积分
187
帖子
140
主题
26
阅读权限
40
注册时间
2015-7-10
最后登录
2023-4-14
发表于 2019-1-18 15:40:17 |显示全部楼层
本帖最后由 qsb588986 于 2019-1-18 15:56 编辑

又一新的。赚到飞!
Params
Numeric offset(6)        ;

Vars

Numeric totalequity;
Numeric turtleunits;

Numeric hlvol;
Numeric hlvoll;
Numeric voll;
Numeric dvol;
Numeric h1;
Numeric l1;
Numeric hh;
Numeric ll;
Numeric hhh;
Numeric lll;
Numeric hb;
Numeric lb;
Numeric hhb;
Numeric llb;
Numeric hhhb;
Numeric lllb;
Numeric hhhhb;
Numeric llllb;
Numeric vollh;
Numeric volll;
Numeric vollhh;
Numeric vollll;
Numeric vollhhh;
Numeric volllll;
Numeric vollhhhh;
Numeric vollllll;
Numeric hlhl;
Numeric lhlh;
Numeric zzzz;
Numeric hbt;
Numeric lbt;
Numeric dvolt;
Numeric dvoltl;
NumericSeries hlvolt;
NumericSeries hlvollt;
NumericSeries count;
NumericSeries htt;
NumericSeries ltt;
Numeric hyy;
Numeric lyy;
Numeric hvol;
Numeric lvol;
Numeric hyyy;
Numeric lyyy;
Numeric hhvol;
Numeric llvol;
Numeric hyyyy;
Numeric lyyyy;
Numeric hhhvol;
Numeric lllvol;
Numeric hyyyyy;
Numeric lyyyyy;
Numeric hhhhvol;
Numeric llllvol;
Numeric hhhvol1;
Numeric lllvol1;



Begin
if(isCallAuctionTime())
Return;

TotalEquity = Portfolio_CurrentCapital() + Portfolio_UsedMargin();   //账户最新资产 = 按当前Bar开盘价计算的可用资金 + 持仓保证金
TurtleUnits=(TotalEquity/(MarginRatio*ContractUnit()*BigPointValue()*Close))*6/10;
TurtleUnits = IntPart(TurtleUnits); // 对小数取整
if(GetGlobalVar(13)!=8 && BarStatus==2 && time==0.0900 || GetGlobalVar(13)!=8 && BarStatus==2 && time==0.2100)      \\每天开盘初始化
{
SetGlobalVar(13,8);
SetGlobalVar(1,1);
SetGlobalVar(2,1);
SetGlobalVar(3,0);
SetGlobalVar(4,0);
}
Else If(Time!=0.0900 && Time!=0.2100)
SetGlobalVar(13,1);

if(GetGlobalVar(14)!=8 && BarStatus==2)
{
SetGlobalVar(14,8);
SetGlobalVar(1,1);
SetGlobalVar(2,1);
SetGlobalVar(3,0);
SetGlobalVar(4,0);
}
if(time!=time[1]+0.0001 && time==0.0900 or time!=time[1]+0.0001 && time==0.2100)
{
count=1;
SetGlobalVar(30,0);
SetGlobalVar(31,0);
}
Else
count=count+1;
h1=Highest(high,count);    \\求距最近的最高最低价BAR数。
l1=Lowest(low,count);
hb=HighestBar(High,count);
lb=LowestBar(low,count);
hh=Highest(High,lb);
ll=Lowest(low,hb);
hhb=HighestBar(High,lb);
llb=LowestBar(low,hb);
hhh=Highest(High,llb);
lll=Lowest(low,hhb);
hhhb=HighestBar(High,llb);
lllb=LowestBar(Low,hhb);
hhhhb=HighestBar(High,lllb);
llllb=LowestBar(Low,hhhb);

voll=Average(vol,count);
vollh=Summation(vol,hb+1);
volll=Summation(vol,lb+1);
vollhh=Summation(vol,hhb+1);
vollll=Summation(vol,llb+1);
vollhhh=Summation(vol,hhhb+1);
volllll=Summation(vol,lllb+1);
vollhhhh=Summation(vol,hhhhb+1);
vollllll=Summation(vol,llllb+1);

hyy=Highest(High,lb+1);           \\最高价和最低差
lyy=Lowest(low,hb+1);
hyyy=Highest(High,llb+1);
lyyy=Lowest(low,hhb+1);
hyyyy=Highest(High,lllb+1);
lyyyy=Lowest(low,hhhb+1);
hyyyyy=Highest(High,llllb+1);
lyyyyy=Lowest(low,hhhhb+1);



hvol=(close-l1)*volll;              \\量价比
lvol=(h1-close)*vollh*-1;
hhvol=(close-lyy)*vollll;
llvol=(hyy-close)*vollhh*-1;
hhhvol=(close-lyyy)*vollhhh;
lllvol=(hyyy-close)*vollhhh*-1;
hhhvol1=(close-lyyy)*volllll;
lllvol1=(hyyy-close)*volllll*-1;
hhhhvol=(close-lyyyyy)*vollhhhh;
llllvol=(hyyyyy-close)*vollllll*-1;





if(currenttime>0.0900 && currenttime<0.1458 or currenttime>0.2100 && currenttime<0.2258)        \\开仓
{

if(A_BuyPosition==0 && A_SellPosition==0 && BarStatus==2 )

{
if(GetGlobalVar(3)==0 && hvol>100000 && abs(hvol)>abs(lvol))
{
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(3,1);
SetGlobalVar(2,1);
SetGlobalVar(4,1);
SetGlobalVar(10,hvol);
}
Else if(GetGlobalVar(4)==0 && lvol<-100000 && abs(lvol)>abs(hvol))
{

A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(4,1);
SetGlobalVar(1,1);
SetGlobalVar(3,1);
SetGlobalVar(11,lvol);
}
}

if(GetGlobalVar(1)==1 && hhhvol1>100000 && Abs(hhhvol1)>Abs(lllvol1)  && Close-lyyy>hyyy-close+2 && A_SellPosition>0 && BarStatus==2 )      \\反手
{
if(a_todaysellposition>0)
A_SendOrder(Enum_Buy,Enum_ExitToday,A_TodaySellPosition,Q_AskPrice+offset*MinMove*PriceScale);
Else
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,Q_AskPrice+offset*MinMove*PriceScale);
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(1,2);
SetGlobalVar(2,1);
SetGlobalVar(10,hhhvol);
}




if(GetGlobalVar(2)==1 && lllvol<-100000 && Abs(lllvol)>Abs(hhhvol)  && hyyy-close>close-lyyy+2 && A_BuyPosition>0 && BarStatus==2)      \\反手
{
if(A_TodayBuyPosition>0)
A_SendOrder(Enum_Sell,Enum_ExitToday,A_TodayBuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
Else
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(2,2);
SetGlobalVar(1,1);
SetGlobalVar(11,lllvol);
}




}
if(A_GetOpenOrderCount==0)        \\收盘前平仓
SetGlobalVar(20,0);
Else
SetGlobalVar(20,1);
if(currenttime>0.1458 && currenttime<0.1500 && A_BuyPosition>0 && GetGlobalVar(20)==0 or currenttime>0.1458 && currenttime<0.1500 && A_SellPosition>0 && GetGlobalVar(20)==0 or currenttime>0.2258 && currenttime<0.2300 && A_BuyPosition>0 && GetGlobalVar(20)==0 or currenttime>0.2258 && time<0.2300 && A_SellPosition>0 && GetGlobalVar(20)==0)
{
if(A_TodayBuyPosition>0)
{
A_SendOrder(Enum_Sell,Enum_ExitToday,A_TodayBuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
Else
{
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
if(a_todaysellposition>0)
{
A_SendOrder(Enum_Buy,Enum_ExitToday,A_TodaySellPosition,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
Else
{
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
}

Commentary("GetGlobalVar(3)"+text(GetGlobalVar(3)));
Commentary("GetGlobalVar(4)"+text(GetGlobalVar(4)));
Commentary("GetGlobalVar(1)"+text(GetGlobalVar(1)));
Commentary("GetGlobalVar(2)"+text(GetGlobalVar(2)));
Commentary("GetGlobalVar(10)"+text(GetGlobalVar(10)));
Commentary("GetGlobalVar(11)"+text(GetGlobalVar(11)));
Commentary("GetGlobalVar(13)"+text(GetGlobalVar(13)));
Commentary("GetGlobalVar(14)"+text(GetGlobalVar(14)));
/*Commentary("hlvol="+Text(hlvol));
Commentary("hlvoll="+Text(hlvoll));
Commentary("voll="+Text(voll));
Commentary("h1="+Text(h1));
Commentary("l1="+Text(l1));
Commentary("hh="+Text(hh));
Commentary("ll="+Text(ll));
Commentary("hhh="+Text(hhh));
Commentary("lll="+Text(lll));
Commentary("vollh="+Text(vollh));
Commentary("volll="+Text(volll));
Commentary("vollhh="+Text(vollhh));
Commentary("vollll="+Text(vollll));
Commentary("vollhhh="+Text(vollhhh));
Commentary("volllll="+Text(volllll));
Commentary("hlhl="+Text(hlhl));
Commentary("lhlh="+Text(lhlh));*/
Commentary("count="+Text(count));
Commentary("hb="+Text(hb));
Commentary("lb="+Text(lb));
Commentary("hhb="+Text(hhb));
Commentary("llb="+Text(llb));
Commentary("hhhb="+Text(hhhb));
Commentary("lllb="+Text(lllb));
Commentary("hhhhb="+Text(hhhhb));
Commentary("llllb="+Text(llllb));
Commentary("hyyy-close="+Text(hyyy-close));
Commentary("close-lyyy="+Text(close-lyyy));
Commentary("hvol="+Text(hvol));
Commentary("lvol="+Text(lvol));
Commentary("hhvol="+Text(hhvol));
Commentary("llvol="+Text(llvol));
Commentary("hhhvol="+Text(hhhvol));
Commentary("lllvol="+Text(lllvol));
Commentary("hhhhvol="+Text(hhhhvol));
Commentary("llllvol="+Text(llllvol));
Commentary("hhhvol1="+Text(hhhvol1));
Commentary("lllvol1="+Text(lllvol1));

End


//------------------------------------------------------------------------
// 编译版本:        2018/12/14 173649
// 内核版本:        V2.8.2.14
// 版权所有        qsb588986
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TradeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
213396
积分
187
帖子
140
主题
26
阅读权限
40
注册时间
2015-7-10
最后登录
2023-4-14
发表于 2019-2-23 16:46:58 |显示全部楼层
又一个最新最爆的终极策略。赚到飞!
// 简称: wanneng
// 名称: wanneng
// 类别: 公式应用
// 类型: 用户应用
// 输出: Void
//------------------------------------------------------------------------
Params
Numeric offset(6);       

Vars
NumericSeries cc;
NumericSeries bb;
Numeric totalequity;
Numeric turtleunits;
Numeric hh;
Numeric hl;
Numeric lh;
Numeric ll;
Numeric hvol;
Numeric volh;
Numeric lvol;
Numeric voll;
NumericSeries hh1;
NumericSeries ll1;
Begin

if(isCallAuctionTime())
Return;

TotalEquity = Portfolio_CurrentCapital() + Portfolio_UsedMargin();   //账户最新资产 = 按当前Bar开盘价计算的可用资金 + 持仓保证金
TurtleUnits=(TotalEquity/(MarginRatio*ContractUnit()*BigPointValue()*Close))*6/10;
TurtleUnits = IntPart(TurtleUnits); // 对小数取整
if(GetGlobalVar(43)!=8 && BarStatus==2 && time==0.0900 || GetGlobalVar(43)!=8 && BarStatus==2 && time==0.2100)
{
SetGlobalVar(43,8);
SetGlobalVar(1,1);
SetGlobalVar(2,1);
SetGlobalVar(3,0);
SetGlobalVar(4,0);
}
Else If(Time!=0.0900 && Time!=0.2100)
SetGlobalVar(43,1);

if(GetGlobalVar(44)!=8 && BarStatus==2)
{
SetGlobalVar(44,8);
SetGlobalVar(1,1);
SetGlobalVar(2,1);
SetGlobalVar(3,0);
SetGlobalVar(4,0);
}

if(a_buyposition>0)
cc=0;
Else if(close<low[1] && close<low[2] && Close<low[4] && hh1[1]-close>4)
{
cc=1;
SetGlobalVar(50,1);
SetGlobalVar(51,2);
}
Else if(GetGlobalVar(51)!=1)
cc=cc+1;

if(a_sellposition>0)
bb=0;
else if(high>high[1] && high>high[2] && high>high[4] && close-ll1[1]>4)
{
bb=1;
SetGlobalVar(51,1);
SetGlobalVar(50,2);
}
Else if(GetGlobalVar(50)!=1)
bb=bb+1;




hh1=Highest(high,4);
ll1=Lowest(low,4);
hh=Highest(high,cc);
hl=Lowest(low,cc);
volh=Summation(vol,cc);
hvol=(close-hl)*volh;
lh=Highest(high,bb);
ll=Lowest(low,bb);
voll=Summation(vol,bb);
lvol=(lh-close)*voll*-1;


if(currenttime>0.0900 && currenttime<0.1458 or currenttime>0.2100 && currenttime<0.2258)
{

if(A_BuyPosition==0 && A_SellPosition==0 && BarStatus==2 )

{
if(GetGlobalVar(3)==0 && hvol>200000 && abs(hvol)>abs(lvol))
{
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(3,1);
SetGlobalVar(2,1);
SetGlobalVar(4,1);
SetGlobalVar(30,hvol);
}
Else if(GetGlobalVar(4)==0 && lvol<-200000 && abs(lvol)>abs(hvol))
{

A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(4,1);
SetGlobalVar(1,1);
SetGlobalVar(3,1);
SetGlobalVar(31,lvol);
}
}
if(GetGlobalVar(1)==1 && hvol>200000  && abs(hvol)>abs(lvol) && close-low>high-close+2 && A_SellPosition>0 && BarStatus==2 )
{
if(a_todaysellposition>0)
A_SendOrder(Enum_Buy,Enum_ExitToday,A_TodaySellPosition,Q_AskPrice+offset*MinMove*PriceScale);
Else
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,Q_AskPrice+offset*MinMove*PriceScale);
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(1,2);
SetGlobalVar(2,1);
SetGlobalVar(32,hvol);
}
if(GetGlobalVar(2)==1 && lvol<-200000 && abs(lvol)>abs(hvol) && high-close>close-low+2 && A_BuyPosition>0 && BarStatus==2)
{
if(A_TodayBuyPosition>0)
A_SendOrder(Enum_Sell,Enum_ExitToday,A_TodayBuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
Else
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(2,2);
SetGlobalVar(1,1);
SetGlobalVar(33,lvol);
}
}


if(A_GetOpenOrderCount==0)
SetGlobalVar(20,0);
Else
SetGlobalVar(20,1);
if(currenttime>0.1458 && currenttime<0.1500 && A_BuyPosition>0 && GetGlobalVar(20)==0 or currenttime>0.1458 && currenttime<0.1500 && A_SellPosition>0 && GetGlobalVar(20)==0 or currenttime>0.2258 && currenttime<0.2300 && A_BuyPosition>0 && GetGlobalVar(20)==0 or currenttime>0.2258 && time<0.2300 && A_SellPosition>0 && GetGlobalVar(20)==0)
{
if(A_TodayBuyPosition>0)
{
A_SendOrder(Enum_Sell,Enum_ExitToday,A_TodayBuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
Else
{
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
if(a_todaysellposition>0)
{
A_SendOrder(Enum_Buy,Enum_ExitToday,A_TodaySellPosition,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
Else
{
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(20,2);
}
}
Commentary("cc="+text(cc));
Commentary("bb="+text(bb));
Commentary("hvol="+text(hvol));
Commentary("lvol="+text(lvol));       
Commentary("GetGlobalVar(1)="+text(GetGlobalVar(1)));
Commentary("GetGlobalVar(2)="+text(GetGlobalVar(2)));
Commentary("GetGlobalVar(3)="+text(GetGlobalVar(3)));
Commentary("GetGlobalVar(4)="+text(GetGlobalVar(4)));
Commentary("GetGlobalVar(30)="+text(GetGlobalVar(30)));
Commentary("GetGlobalVar(31)="+text(GetGlobalVar(31)));
Commentary("GetGlobalVar(32)="+text(GetGlobalVar(32)));
Commentary("GetGlobalVar(33)="+text(GetGlobalVar(33)));
Commentary("GetGlobalVar(43)="+text(GetGlobalVar(43)));
Commentary("GetGlobalVar(44)="+text(GetGlobalVar(44)));
End


//------------------------------------------------------------------------
// 编译版本:        2019/02/21 172011
// 内核版本:        V2.8.2.14
// 版权所有        qsb588986
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TradeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
213396
积分
187
帖子
140
主题
26
阅读权限
40
注册时间
2015-7-10
最后登录
2023-4-14
发表于 2019-7-7 20:47:22 |显示全部楼层
本帖最后由 qsb588986 于 2019-7-7 21:48 编辑

又一个新的。吃到肉。
Params
Numeric offset(6)        ;

Vars

Numeric totalequity;
Numeric turtleunits;
NumericSeries count;

Begin


TotalEquity = A_FreeMargin + A_TotalMargin;   //账户最新资产 = 按当前Bar开盘价计算的可用资金 + 持仓保证金
TurtleUnits=(TotalEquity/(MarginRatio*ContractUnit()*BigPointValue()*Close)*1/5);
TurtleUnits = IntPart(TurtleUnits); // 对小数取整
if(GetGlobalVar(13)!=8 && BarStatus==2 && time==0.0900 || GetGlobalVar(13)!=8 && BarStatus==2 && time==0.2100)
{
SetGlobalVar(1,1);
SetGlobalVar(2,1);
SetGlobalVar(0,1);
SetGlobalVar(4,1);
SetGlobalVar(20,1);
SetGlobalVar(21,1);
SetGlobalVar(102,0);
SetGlobalVar(103,0);
}
Else If(Time!=0.0900 && Time!=0.2100)
SetGlobalVar(13,1);


if(GetGlobalVar(14)!=8 && BarStatus==2 )
{
SetGlobalVar(14,8);
SetGlobalVar(1,1);
SetGlobalVar(2,1);
SetGlobalVar(0,1);
SetGlobalVar(4,1);
SetGlobalVar(20,1);
SetGlobalVar(21,1);
SetGlobalVar(100,0);
SetGlobalVar(101,0);
SetGlobalVar(102,0);
SetGlobalVar(103,0);
}

if(GetGlobalVar(21)==1 && BarStatus==2)
{
SetGlobalVar(33,Close);
SetGlobalVar(34,Close);
SetGlobalVar(21,2);
}

if(Close>GetGlobalVar(33) && Close>GetGlobalVar(34) && GetGlobalVar(100)==0)
{
SetGlobalVar(33,Close);
SetGlobalVar(34,High);
}
else if(Close>GetGlobalVar(33) && Close<=GetGlobalVar(34))
{
SetGlobalVar(33,Close);
SetGlobalVar(34,High);
}
else if(Close<GetGlobalVar(33))
SetGlobalVar(33,Close);
if(Close<GetGlobalVar(35) && Close<GetGlobalVar(36) && GetGlobalVar(101)==0)
{
SetGlobalVar(35,Close);
SetGlobalVar(36,Low);
}
else if(Close<GetGlobalVar(35) && Close>=GetGlobalVar(36))
{
SetGlobalVar(35,Close);
SetGlobalVar(36,Low);
}
else if(Close>GetGlobalVar(35))
SetGlobalVar(35,Close);


if(Time+0.000002>CurrentTime && GetGlobalVar(9)!=9)
{
SetGlobalVar(100,0);
SetGlobalVar(102,0);
SetGlobalVar(9,9);
}
Else if(CurrentTime>time+0.000002)
SetGlobalVar(9,1);
if(Close>GetGlobalVar(34))
SetGlobalVar(100,0);
else if(Close==High)
{
SetGlobalVar(100,GetGlobalVar(100)+Q_AskVol);
if(GetGlobalVar(100)>=GetGlobalVar(102))
SetGlobalVar(102,GetGlobalVar(100));
}

if(Time+0.000002>CurrentTime && GetGlobalVar(10)!=10)
{
SetGlobalVar(101,0);
SetGlobalVar(103,0);
SetGlobalVar(10,10);
}
Else if(CurrentTime>time+0.000002)
SetGlobalVar(10,1);
if(Close<GetGlobalVar(36))
SetGlobalVar(101,0);
else if(Close==Low)
{
SetGlobalVar(101,GetGlobalVar(101)+Q_AskVol);
if(GetGlobalVar(101)>=GetGlobalVar(103))
SetGlobalVar(103,GetGlobalVar(101));
}


if(time!=time[1]+0.0001 && time==0.0900 or time!=time[1]+0.0001 && time==0.2100)
count=1;
Else
count=count+1;

If(GetGlobalVar(102)>=2* GetGlobalVar(103) && GetGlobalVar(102)>12000)
{
SetGlobalVar(91,1);
SetGlobalVar(92,2);
setglobalvar(109,high);
}
If(GetGlobalVar(103)>=2*GetGlobalVar(102) && GetGlobalVar(103)>12000)
{
SetGlobalVar(92,1);
SetGlobalVar(91,2);
setglobalvar(110,low);
}

if(currenttime>0.090 && currenttime<0.1458 or currenttime>0.2100 && currenttime<0.2258)
{

if(A_BuyPosition==0 && A_SellPosition==0 && BarStatus==2 && vol>0)

{
if(GetGlobalVar(0)==1 && GetGlobalVar(91)==1 && Close>GetGlobalVar(109))
{
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(0,2);
SetGlobalVar(4,2);
SetGlobalVar(2,1);
}
Else if(GetGlobalVar(4)==1 && GetGlobalVar(92)==1 && Close<GetGlobalVar(110))
{

A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(4,2);
SetGlobalVar(0,2);
SetGlobalVar(1,1);
}
}

if(A_SellPosition>0 && BarStatus==2  && vol>0)
{

if(GetGlobalVar(1)==1 && GetGlobalVar(91)==1 && Close>GetGlobalVar(109))
{
if(a_todaysellposition>0)
A_SendOrder(Enum_Buy,Enum_ExitToday,A_TodaySellPosition,Q_AskPrice+offset*MinMove*PriceScale);
Else
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,Q_AskPrice+offset*MinMove*PriceScale);
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(1,2);
SetGlobalVar(2,1);
}
}


if(A_BuyPosition>0 && BarStatus==2 && vol>0)
{

if(GetGlobalVar(2)==1 && GetGlobalVar(92)==1 && Close<GetGlobalVar(110))
{
if(A_TodayBuyPosition>0)
A_SendOrder(Enum_Sell,Enum_ExitToday,A_TodayBuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
Else
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(2,2);
SetGlobalVar(1,1);
}
}


}
if(A_GetOpenOrderCount==0)
SetGlobalVar(20,0);
Else
SetGlobalVar(20,1);
if(currenttime>0.1458 && currenttime<0.1500 && A_BuyPosition>0 or currenttime>0.1458 && currenttime<0.1500 && A_SellPosition>0 or currenttime>0.2258 && currenttime<0.2300 && A_BuyPosition>0 or currenttime>0.2258 && time<0.2300 && A_SellPosition>0)
{
if(A_TodayBuyPosition>0)
{
A_SendOrder(Enum_Sell,Enum_ExitToday,A_TodayBuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(20,1);
}
Else
{
A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(20,1);
}
if(a_todaysellposition>0)
{
A_SendOrder(Enum_Buy,Enum_ExitToday,A_TodaySellPosition,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(20,1);
}
Else
{
A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(20,1);
}
}

End

使用道具 举报

Rank: 1

精华
0
UID
216747
积分
16
帖子
10
主题
1
阅读权限
10
注册时间
2015-8-12
最后登录
2022-3-29
发表于 2019-12-19 09:12:53 |显示全部楼层
写的方法有错误,,,还有些逻辑问题,我修改了一下,感觉好一点

使用道具 举报

Rank: 1

精华
0
UID
249036
积分
4
帖子
1
主题
0
阅读权限
10
注册时间
2017-3-22
最后登录
2021-5-29
发表于 2020-3-17 21:51:32 |显示全部楼层
你疯了

使用道具 举报

Rank: 2

精华
0
UID
286472
积分
61
帖子
10
主题
6
阅读权限
30
注册时间
2019-12-5
最后登录
2020-6-6
发表于 2020-3-18 19:20:16 |显示全部楼层
太复杂

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-3-29 23:29

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部