Rss & SiteMap

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

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

标题:请教关于上次开仓

1楼
punkcat401 发表于:2013/12/11 11:08:07

上一次多头开仓盈利大于50点,则再次buy,怎么描述

2楼
jinzhe 发表于:2013/12/11 11:12:05

variable:n=0;

if holding>0 and 平多条件   then begin

    sell;

    if c-enterprice>50*mindiff then n:=1;

end

 

if n=1 then begin

 sellshort;

 buy;

end

3楼
punkcat401 发表于:2013/12/11 11:20:09
以下是引用jinzhe在2013/12/11 11:12:05的发言:

 

    if c-enterprice>50*mindiff then n:=1;

这个全局变量没有信号

4楼
jinzhe 发表于:2013/12/11 11:24:20
n是多少?调试一下,你那里有没有盈利50点的行情?
5楼
fly 发表于:2013/12/11 11:27:52

2楼是简略写法,具体开平仓及加仓条件,需要楼主自己填写的,以下为简单示例

 

variable:n=0;

ma5:ma(c,5);

ma20:ma(c,20);

 

if cross(ma5,ma20) and holding=0 then buy(1,1,market);

 

if  cross(ma20,ma5) and holding>0 then begin

    sell(1,1,market);

    if c-enterprice>50*mindiff then n:=1;//如果赢利超过50个点,则赋值为1

end

 

if cross(ma5,ma20) and holding=0  and n=1 then

begin

 buy(1,1,market);

 n:=0;//加仓后赋值为0

end

6楼
punkcat401 发表于:2013/12/11 11:36:36
以下是引用fly在2013/12/11 11:27:52的发言:

2楼是简略写法,具体开平仓及加仓条件,需要楼主自己填写的,以下为简单示例

 

明白了,原来是N在赋值为1后,没有初始化为0.....

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


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