Rss & SiteMap

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

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

标题:求止盈的编写

1楼
dalunihao 发表于:2013/10/24 14:01:03
你好,老师,麻烦您用if then帮我编写个代码:
如图A多头,如果开多之后,(最高价)A减去开仓价,大于5个点且小于40个点,则当C减去开仓价小于等于5 止盈平仓。如果A减去开仓价,大于40个点,则当C减去开仓价小于等于30时, 止盈平仓。(空单也是如此)
图片点击可在新窗口打开查看此主题相关图片如下:001.jpg
图片点击可在新窗口打开查看
2楼
jinzhe 发表于:2013/10/24 14:14:28

hh:=hhv(h,enterbars+1);

if hh>enterprice+5*mindiff and hh<enterprice+40*mindiff and c-enterprice<5*mindiff then sell(1,0,market);

if hh>enterprice+40*mindiff and c>enterprice+30*mindiff then sell(1,0,market);

 

空单的思路说一下

 

 

 

3楼
dalunihao 发表于:2013/10/24 14:19:57
先谢谢老师。空头的思路是:
如图做空,如果开空之后,开仓价减去(最低点)A,大于5个点且小于40个点,则当开仓价减去close小于等于5
图片点击可在新窗口打开查看此主题相关图片如下:88888.jpg
图片点击可在新窗口打开查看
止盈平仓。如果开仓价减去A点,大于40个点,则当开仓价减去Close小于等于30时, 止盈平仓。
4楼
jinzhe 发表于:2013/10/24 14:46:44

ll:=llv(l,enterbars+1);

 

if enterprice-ll>5*mindiff and enterprice-ll<40*mindiff and enterprice-clsoe<=5*mindiff then sellshort(1,0,thisclose);

 

if enterprice-ll>40*mindif and enterprice-close<=30*minff then sellshort(1,0,thisclose);

5楼
lxihua5201 发表于:2013/10/24 14:53:59
variable:n=o;
if l>n then begin
N:l;
end

if enterprice-n>5*mindiff and n-enterprice<40*mindiff and enterprice-c<5*mindiff then sell(1,0,market);

if enterprice-n>40*mindiff and enterprice-c<=30*mindiff then sell(1,0,market);

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


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