- 精华
- 0
- 在线时间
- 525 小时
- UID
- 213396
- 积分
- 187
- 帖子
- 140
- 阅读权限
- 40
- 注册时间
- 2015-7-10
- 最后登录
- 2023-4-14
- 精华
- 0
- UID
- 213396
- 积分
- 187
- 帖子
- 140
- 主题
- 26
- 阅读权限
- 40
- 注册时间
- 2015-7-10
- 最后登录
- 2023-4-14
|
if(currenttime>0.0900 && currenttime<0.1458)
{
if(A_BuyPosition==0 && A_SellPosition==0 && BarStatus==2 && vol>0)
{
if(GetGlobalVar(0)==1 && Close>GetGlobalVar(30) && GetGlobalVar(90)==1)
{
A_SendOrder(Enum_Buy,Enum_Entry,TurtleUnits,Q_AskPrice+offset*MinMove*PriceScale);
SetGlobalVar(0,2);
SetGlobalVar(4,2);
SetGlobalVar(2,1);
SetGlobalVar(60,1);
SetGlobalVar(90,2);
}
Else if(GetGlobalVar(4)==1 && Close<GetGlobalVar(30) && GetGlobalVar(91)==1)
{
A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(4,2);
SetGlobalVar(0,2);
SetGlobalVar(1,1);
SetGlobalVar(6,1);
SetGlobalVar(60,1);
SetGlobalVar(91,2);
}
}
if(A_SellPosition>0 && BarStatus==2 && vol>0)
{
if(GetGlobalVar(1)==1 && GetGlobalVar(30)-ll>=10 && Close>GetGlobalVar(30))
{
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);
SetGlobalVar(1,3);
SetGlobalVar(2,3);
SetGlobalVar(4,3);
SetGlobalVar(0,3);
SetGlobalVar(90,3);
SetGlobalVar(91,3);
}
else if(GetGlobalVar(1)==1 && Close>GetGlobalVar(30) && GetGlobalVar(90)==1)
{
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(90,2);
}
else if(GetGlobalVar(1)==1 && A_TotalAvgPrice-Close>=22)
{
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);
SetGlobalVar(1,3);
SetGlobalVar(2,3);
SetGlobalVar(4,3);
SetGlobalVar(0,3);
SetGlobalVar(90,3);
SetGlobalVar(91,3);
}
}
if(A_BuyPosition>0 && BarStatus==2 && vol>0)
{
if(GetGlobalVar(2)==1 && hh-GetGlobalVar(30)>=10 && Close<GetGlobalVar(30))
{
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);
SetGlobalVar(2,3);
SetGlobalVar(1,3);
SetGlobalVar(4,3);
SetGlobalVar(0,3);
SetGlobalVar(90,3);
SetGlobalVar(91,3);
}
else if(GetGlobalVar(2)==1 && Close<GetGlobalVar(30) && GetGlobalVar(91)==1)
{
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(6,1);
SetGlobalVar(91,2);
}
else if(GetGlobalVar(2)==1 && Close-A_TotalAvgPrice>=22)
{
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);
SetGlobalVar(2,3);
SetGlobalVar(1,3);
SetGlobalVar(4,3);
SetGlobalVar(0,3);
SetGlobalVar(90,3);
SetGlobalVar(91,3);
}
}
}
if(currenttime>0.2100 && currenttime<0.2258)
{
if(A_BuyPosition==0 && A_SellPosition==0 && BarStatus==2 && vol>0)
{
if(GetGlobalVar(0)==1 && Close>GetGlobalVar(30) && GetGlobalVar(90)==1)
{
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 && Close<GetGlobalVar(30) && GetGlobalVar(91)==1)
{
A_SendOrder(Enum_Sell,Enum_Entry,TurtleUnits,Q_BidPrice-offset*MinMove*PriceScale);
SetGlobalVar(4,2);
SetGlobalVar(0,2);
SetGlobalVar(1,1);
SetGlobalVar(6,1);
}
}
if(A_SellPosition>0 && BarStatus==2 && vol>0)
{
if(GetGlobalVar(1)==1 && GetGlobalVar(30)-ll>=10 && Close>GetGlobalVar(30))
{
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);
SetGlobalVar(1,6);
SetGlobalVar(2,6);
SetGlobalVar(4,6);
SetGlobalVar(0,6);
}
else if(GetGlobalVar(1)==1 && Close>GetGlobalVar(30) && GetGlobalVar(90)==1)
{
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);
}
else if(GetGlobalVar(1)==1 && A_TotalAvgPrice-Close>=16)
{
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);
SetGlobalVar(2,7);
SetGlobalVar(1,7);
SetGlobalVar(4,7);
SetGlobalVar(0,7);
}
}
if(A_BuyPosition>0 && BarStatus==2 && vol>0)
{
if(GetGlobalVar(2)==1 && hh-GetGlobalVar(30)>=10 && Close<GetGlobalVar(30))
{
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);
SetGlobalVar(2,3);
SetGlobalVar(1,3);
SetGlobalVar(4,3);
SetGlobalVar(0,3);
}
else if(GetGlobalVar(2)==1 && Close<GetGlobalVar(30) && GetGlobalVar(91)==1)
{
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(6,1);
}
else if(GetGlobalVar(2)==1 && Close-A_TotalAvgPrice>=16)
{
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);
SetGlobalVar(2,4);
SetGlobalVar(1,4);
SetGlobalVar(4,4);
SetGlobalVar(0,4);
}
}
}
if(A_GetOpenOrderCount==0)
SetGlobalVar(20,0);
Else
SetGlobalVar(20,1);
if(currenttime>0.1458 && currenttime<0.1500 && (A_BuyPosition>0 or A_SellPosition>0) && GetGlobalVar(20)==0 or currenttime>0.2258 && currenttime<0.2300 && (A_BuyPosition>0 or 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,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);
}
}
Commentary("GetGlobalVar(0)"+text(GetGlobalVar(0)));
Commentary("GetGlobalVar(4)"+text(GetGlobalVar(4)));
Commentary("GetGlobalVar(1)"+text(GetGlobalVar(1)));
Commentary("GetGlobalVar(2)"+text(GetGlobalVar(2)));
Commentary("GetGlobalVar(6)"+text(GetGlobalVar(6)));
Commentary("GetGlobalVar(13)"+text(GetGlobalVar(13)));
Commentary("GetGlobalVar(14)"+text(GetGlobalVar(14)));
Commentary("GetGlobalVar(20)"+text(GetGlobalVar(20)));
Commentary("GetGlobalVar(21)"+text(GetGlobalVar(21)));
Commentary("GetGlobalVar(22)"+text(GetGlobalVar(22)));
Commentary("GetGlobalVar(30)"+text(GetGlobalVar(30)));
Commentary("GetGlobalVar(31)"+text(GetGlobalVar(31)));
Commentary("GetGlobalVar(32)"+text(GetGlobalVar(32)));
Commentary("GetGlobalVar(74)"+text(GetGlobalVar(74)));
Commentary("GetGlobalVar(75)"+text(GetGlobalVar(75)));
Commentary("GetGlobalVar(90)"+text(GetGlobalVar(90)));
Commentary("GetGlobalVar(91)"+text(GetGlobalVar(91)));
Commentary("A_BuyPosition"+text(A_BuyPosition));
Commentary("A_SellPosition"+text(A_SellPosition));
Commentary("count"+text(count));
Commentary("A_TotalAvgPrice"+text(A_TotalAvgPrice));
Commentary("hh="+text(hh));
Commentary("ll="+text(ll));
End
|
|