Rss & SiteMap

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

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

标题:关于程序编写

1楼
zhouyang 发表于:2017/1/16 9:46:01
老师,我要写一个股票后台程序化,内容如下:
1、持仓股票涨3%卖出50%仓位;
2、卖出后检测,股票从最高价回落2.5%以上卖出100%仓位;

请帮助编写,谢谢!
2楼
jinzhe 发表于:2017/1/16 9:50:52

if c>=tenterprice*0.03 then tsell(1,50%,mkt),pertrader;

if c<=hhv(h,tenterbars+1) and tenterbars<>-1 then tsell(1,100%,mkt),pertrader;

3楼
zhouyang 发表于:2017/1/16 10:00:11
老师:
    1、股票涨3%是以昨日收盘价计算涨3%卖出50%仓位
4楼
zhouyang 发表于:2017/1/16 10:02:47
卖出后检测股票从最高价回落2.5%卖出可用仓位100%,指从今日最高价回落2.5%
5楼
jinzhe 发表于:2017/1/16 10:05:12

if c>=ref(c,todaybar)*0.03 then tsell(1,50%,mkt),pertrader;

if c<=hhv(h,todaybar)  then tsell(1,100%,mkt),pertrader;

6楼
zhouyang 发表于:2017/1/16 10:19:30
老师:你写的是序列模式还是逐K线模式?

是不是可以这样写:

//持仓股票以昨天收盘价计算涨3%卖出50%仓位:
if c>=ref(c,1)*1.03 then tsell(1,50%,mkt),pertrader;

//卖出后以今天最高价计算,回落2.5%卖出剩余仓位的100%:
if c<=hhv(h,todaybar)*0.975  then tsell(1,100%,mkt),pertrader;
还是应该写成是
if c<=h*0.975  then tsell(1,100%,mkt),pertrader;
7楼
jinzhe 发表于:2017/1/16 10:21:54

1序列

2你的写法只能是用在日线上,我的还可以用在分钟周期上

8楼
zhouyang 发表于:2017/1/16 10:23:56
回落平仓更正
//卖出后以今天最高价计算,回落2.5%卖出剩余仓位的100%:
if c<=(HIGH - C)/REF(C,1))*0.975  then tsell(1,100%,mkt),pertrader;
9楼
zhouyang 发表于:2017/1/16 10:25:45
老师:
     我都搞晕了,麻烦你再写个正确的给我好吗,谢谢!
10楼
jinzhe 发表于:2017/1/16 10:28:48

if c>=ref(c,todaybar)*1.03 then tsell(1,50%,mkt),pertrader;

if c<=hhv(h,todaybar) *0.975 then tsell(1,100%,mkt),pertrader;

[此贴子已经被作者于2017-1-16 10:29:35编辑过]
共17 条记录, 每页显示 10 条, 页签: [1] [2]


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