等级: 超级版主
- 注册:
- 2021-5-24
- 曾用名:
|
本帖最后由 资深技术02 于 2022-9-26 10:24 编辑
//盈利
if (close-TAVGENTERPRICEEX2('' ,'' , 0))*tbuyholding(1)*MULTIPLIER>close*tbuyholding(1)*MULTIPLIER*TACCOUNT(41)*0.1 then
begin
tsell(1,tbuyholding(1),mkt);
END
//亏损
if (TAVGENTERPRICEEX2('' ,'' , 0)-close)*tbuyholding(1)*MULTIPLIER>close*tbuyholding(1)*MULTIPLIER*TACCOUNT(41)*0.05 then
begin
tsell(1,tbuyholding(1),mkt);
END
cond:tsellholding(1)>0 or tbuyholding(1)>0;
//需求2
GLOBALVARIABLE:flag1:=0,flag2:=0,flag3:=0;
if EXTGBDATA('夜盘权益')=0 or EXTGBDATA('早盘权益')=0 or EXTGBDATA('午盘权益')=0 then exit;
if todaybar=1 then
BEGIN
flag1:=0;
flag2:=0;
flag3:=0;
EXTGBDATASET('早盘',0);
EXTGBDATASET('午盘',1);
EXTGBDATASET('夜盘',1);
EXTGBDATASET('早盘权益最大',TACCOUNT( 6));
EXTGBDATASET('午盘权益最大',TACCOUNT( 6));
EXTGBDATASET('夜盘权益最大',TACCOUNT( 6));
end
if (currenttime>210000 or currenttime<050000) then EXTGBDATASET('夜盘权益',TACCOUNT( 6));
if (currenttime>090000 and currenttime<120000) then EXTGBDATASET('早盘权益',TACCOUNT( 6));
if (currenttime>120000 and currenttime<150000) then EXTGBDATASET('午盘权益',TACCOUNT( 6));
if (currenttime>090000 and currenttime<120000) then
begin
if TACCOUNT( 6)>EXTGBDATA('夜盘权益')*(1+0.01) then flag1:=1;
//超过1平仓底线
if flag1=1 and TACCOUNT( 6)<EXTGBDATA('夜盘权益')*(1-0.01) then
BEGIN
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('早盘',1);
end
//记录最大权益
if flag1=1 and TACCOUNT( 6)>EXTGBDATA('早盘权益最大') then EXTGBDATASET('早盘权益最大',TACCOUNT( 6));
//回撤50%
if flag1=1 and TACCOUNT( 6)<EXTGBDATA('早盘权益最大')*0.95 then
begin
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('早盘',1);
end
//总亏损-2
if TACCOUNT( 6)<EXTGBDATA('夜盘权益')*(1-0.02) then
BEGIN
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('早盘',1);
end
end
if (currenttime>120000 and currenttime<150000) then
begin
if TACCOUNT( 6)>EXTGBDATA('早盘权益')*(1+0.01) then flag2:=1;
//超过1平仓底线
if flag2=1 and TACCOUNT( 6)<EXTGBDATA('早盘权益')*(1-0.01) then
BEGIN
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('午盘',1);
end
//记录最大权益
if flag2=1 and TACCOUNT( 6)>EXTGBDATA('午盘权益最大') then EXTGBDATASET('午盘权益最大',TACCOUNT( 6));
//回撤50%
if flag2=1 and TACCOUNT( 6)<EXTGBDATA('午盘权益最大')*0.95 then
begin
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('午盘',1);
end
//总亏损-2
if TACCOUNT( 6)<EXTGBDATA('早盘权益')*(1-0.02) then
BEGIN
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('午盘',1);
end
end
if (currenttime>210000 or currenttime<050000) then
begin
if TACCOUNT( 6)>EXTGBDATA('午盘权益')*(1+0.01) then flag3:=1;
//超过1平仓底线
if flag3=1 and TACCOUNT( 6)<EXTGBDATA('午盘权益')*(1-0.01) then
BEGIN
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('夜盘',1);
end
//记录最大权益
if flag3=1 and TACCOUNT( 6)>EXTGBDATA('夜盘权益最大') then EXTGBDATASET('夜盘权益最大',TACCOUNT( 6));
//回撤50%
if flag3=1 and TACCOUNT( 6)<EXTGBDATA('夜盘权益最大')*0.95 then
begin
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('夜盘',1);
end
//总亏损-2
if TACCOUNT( 6)<EXTGBDATA('午盘权益')*(1-0.02) then
BEGIN
tsell(1,0,mkt);
tsellshort(1,0,mkt);
EXTGBDATASET('夜盘',1);
end
end
|
|