Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共12 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:请教后台程序化代码编写

1楼
a383623133 发表于:2017/2/8 8:49:52
后台程序化怎么写如下规则?:
1.开盘就开多仓
2.如果止盈就继续开多仓,如果止损就开空仓
3.尾盘不留仓
2楼
jinzhe 发表于:2017/2/8 9:16:21

if todaybar=1 then tbuy(tholding=0,1,mkt);

 

if tnumprofit(1)>0 then tbuy(tholding=0,1,mkt);

 

if tnumprofit(1)<0 then tbuyshort(tholding=0,1,mkt);

 

if time=closetime(0) then begin

   tsell(1,0,mkt);

   tsellshort(1,0,mkt);

end

3楼
a383623133 发表于:2017/2/8 12:55:27
老师,再请教下:
1.开盘就开多仓
2.不关盈利还是亏损,下一次开仓都是反向开仓
3.尾盘不留仓
后台该如何写?
4楼
jinzhe 发表于:2017/2/8 12:59:10

if todaybar=1 then tbuy(tholding=0,1,mkt);

 

if ttype(1)=4 then tbuy(tholding=0,1,mkt);

 

if ttype(1)=2 then tbuyshort(tholding=0,1,mkt);

 

if time=closetime(0) then begin

   tsell(1,0,mkt);

   tsellshort(1,0,mkt);

end


5楼
a383623133 发表于:2017/2/8 14:19:14
后台的跟踪止盈该怎么编写?
盈利回撤4跳就止盈
6楼
jinzhe 发表于:2017/2/8 14:21:56
盈利1跳也回撤4跳止损?
7楼
a383623133 发表于:2017/2/8 14:27:02
盈利4跳以上才用到止盈,没超过4跳的就等止损信号
8楼
jinzhe 发表于:2017/2/8 14:45:45

if hhv(h,tenterbars+1)-tenterprice>=4*mindiff and c<=hhv(h,tenterbars+1)-4*mindiff then tsell(1,0,mkt);

if tenterprice-llv(l,enterbars+1)>=4*mindiff and c>=llv(l,enterbars+1)+4*mindiff then tsell(1,0,mkt);

9楼
a383623133 发表于:2017/2/9 8:53:47
哪一句是跟踪止盈?
10楼
jinzhe 发表于:2017/2/9 8:58:58

if hhv(h,tenterbars+1)-tenterprice>=4*mindiff and c<=hhv(h,tenterbars+1)-4*mindiff then tsell(1,0,mkt);

if tenterprice-llv(l,enterbars+1)>=4*mindiff and c>=llv(l,enterbars+1)+4*mindiff then tsellshort(1,0,mkt);

第一句是多头,第二句是空头

这两句都是,前面第二句疏忽了,没写成空头

共12 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 3 queries.