金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 310|回复: 1

帮我改写成后台程序化

[复制链接]

3

主题

16

帖子

16

积分

Rank: 1

等级: 新手上路

注册:
2024-5-29
曾用名:
发表于 2025-6-3 16:21 | 显示全部楼层 |阅读模式
VARIABLE:stt=0,n=0,;
CYC:BARSLAST(MONTH>REF(MONTH,1) OR YEAR>REF(YEAR,1))+1;
今开:ref(OPEN,CYC-1);//CALLSTOCK(STKLABEL,VTOPEN,8,0);

初始资金:=ASSET;
上轨:今开*(1+GG);
下轨:今开*(1-GG);
ss:INTPART( max(1,INTPART(初始资金*0.10)/abs(close*MULTIPLIER*0.13)));

kd:=h>上轨 and c>上轨 and L>上轨 and ISUP;
kk:=L<下轨 and C<下轨 AND H<下轨 and ISDOWN;
//止盈

ZY:=h>上轨+((上轨-下轨)*g);
ZS:=L<下轨-((上轨-下轨)*g);

if HOLDING<>0  and stt<=1 and (zs or zy) then BEGIN //必须保证if这里条件满足时候下面2个平仓得有一个执行,否则在止盈不满足的情况下stt照样会被赋值成1.
空盈:SELLSHORT(zs,SS,THISCLOSE);
多盈:SELL(zy,SS,THISCLOSE);
sTT:=1;
end
PK:h>上轨 and c>上轨 ;
if PK then       
SELLSHORT(HOLDING<0,SS,THISCLOSE);
PD:L<下轨 and C<下轨 ;
if PD then       
SELL(HOLDING>0,SS,THISCLOSE);         
if kd AND STT<1 and n<=5 and cyc>1 then BEGIN
       
  if BUY( HOLDING=0 ,SS,THISCLOSE) then
        n:=n+1;       
        end
if kk  AND STT<1 AND n<=5 and cyc>1 then BEGIN                    
  IF BUYSHORT( HOLDING=0 ,SS,THISCLOSE) THEN
        n:=n+1;       
        end       
if MONTH<>ref(MONTH,1) then BEGIN
n:=0;       
stt:=0;
end
IF ISMONTHEND=1 AND HOLDING<>0 THEN BEGIN
        月底平空:SELLSHORT(1,SS,THISCLOSE);
        月底平多:SELL(1,SS,THISCLOSE);
        n:=0;       
        stt:=0;
        end




回复

使用道具 举报

44

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
发表于 2025-6-3 16:41 | 显示全部楼层

GLOBALVARIABLE:stt:=0,n:=0,初始资金:=tASSET;;
CYC:BARSLAST(MONTH>REF(MONTH,1) OR YEAR>REF(YEAR,1))+1;
今开:ref(OPEN,CYC-1);//CALLSTOCK(STKLABEL,VTOPEN,8,0);


上轨:今开*(1+GG);
下轨:今开*(1-GG);
ss:INTPART( max(1,INTPART(初始资金*0.10)/abs(close*MULTIPLIER*0.13)));

kd:=h>上轨 and c>上轨 and L>上轨 and ISUP;
kk:=L<下轨 and C<下轨 AND H<下轨 and ISDOWN;
//止盈

ZY:=h>上轨+((上轨-下轨)*g);
ZS:=L<下轨-((上轨-下轨)*g);

if  stt<=1 and (zs or zy) then BEGIN //必须保证if这里条件满足时候下面2个平仓得有一个执行,否则在止盈不满足的情况下stt照样会被赋值成1.
tSELLSHORT(zs and tsellholding(1)>0,SS,mkt);
tSELL(zy and tbuyholding(1)>0,SS,mkt);
sTT:=1;
end
PK:h>上轨 and c>上轨 ;
if PK then      
tSELLSHORT(tsellholding(1)>0,SS,mkt);
PD:L<下轨 and C<下轨 ;
if PD then      
tSELL(tbuyholding(1)>0,SS,mkt);         
if kd AND STT<1 and n<=5 and cyc>1 then BEGIN
      
  if tBUY( tbuyholding(1)=0 ,SS,mkt) then
        n:=n+1;      
        end
if kk  AND STT<1 AND n<=5 and cyc>1 then BEGIN                    
  IF tBUYSHORT(tsellholding(1)=0 ,SS,mkt) THEN
        n:=n+1;      
        end      
if MONTH<>ref(MONTH,1) then BEGIN
n:=0;      
stt:=0;
end
IF ISMONTHEND=1 AND 1 THEN BEGIN
        tSELLSHORT(tsellholding(1)>0,SS,mkt);
        tSELL(tbuyholding(1)>0,SS,mkt);
        n:=0;      
        stt:=0;
        end
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-7-7 01:42 , Processed in 0.133875 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表