Rss & SiteMap

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

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

标题:[求助]次交易日起卖出如何编写

1楼
okmijn365 发表于:2013/1/6 10:24:59

请帮忙,谢谢!

 

N分钟周期下,买入后,要求从次一个交易日起开始卖出(不能从下一根K线起),这个“次交易日起”条件如何实现?

 

if 次一个交易日 and c>enterprice then sell(); 

2楼
jinzhe 发表于:2013/1/7 9:14:42

date_1:=valuewhen(开仓条件,date);

if date>=date_1+1 and c>enterprice then sell;//注意,这个判断条件,正好月末的时候,不顶用

3楼
fly 发表于:2013/1/7 9:19:07

用全局变量控制.以下为简单示例

 

variable:flag=0;// 全局变量,买开仓时赋值为1

 

if cond1 and holding=0 then

begin

 buy(1,1,market);

 flag:=1;

end

 

if cond2 and holding>0 and flag=0 then  sell(1,1,thisclose);

 

if time=150000 then flag:=0;// 商品期货,收盘的同时,flag赋值为0

4楼
okmijn365 发表于:2013/1/7 15:44:13
多谢2位
共4 条记录, 每页显示 10 条, 页签: [1]


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