以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- ATR止损止盈写法 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=143378) |
-- 作者:pyfans27 -- 发布时间:2016/11/24 20:49:42 -- ATR止损止盈写法 某价位进场后,1ATR止损,3ATR止盈,5天没有到止损止盈位置也退出 怎么写?
|
-- 作者:jinzhe -- 发布时间:2016/11/25 9:12:09 -- 交易在日线还是分钟线? |
-- 作者:pyfans27 -- 发布时间:2016/11/28 19:41:31 -- 两者都写一下 我学习下 |
-- 作者:jinzhe -- 发布时间:2016/11/29 8:58:45 --
日线: atr:=stkindi(\'\',\'atr.atr\',0,datatype);
if c<enterprice-atr then sell(1,0,thisclose); if c>enterprice+3*atr then sell(1,0,thisclose); if enterbars>5 then sell(1,0,thisclose);
分钟: 分钟线上你要手工算一下一天有多少根k线,假设一天有ss根当前周期的k线
atr:=stkindi(\'\',\'atr.atr\',0,datatype);
if c<enterprice-atr then sell(1,0,thisclose); if c>enterprice+3*atr then sell(1,0,thisclose); if enterbars>ss*5 then sell(1,0,thisclose); |