Rss & SiteMap

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

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

标题:求教:extgbdata定义的全局变量,不是满足条件才赋值?

1楼
fly 发表于:2011/11/17 14:44:05

//用的是1分钟K线,走完一根K线

 

runmode:1;
price:='price';// 全局变量,控制开仓次数

 

if tholding=0 and DYNAINFO(207)>112300 then
begin
tbuy(1,1,mkt);
extgbdataset('price',close);//记录开仓价格
end

 

tsell(tholding>0 and tenterbars>5,1,mkt);

 

if islastbar then
begin 
DEBUGFILE2('d:\debug.txt','xinhao:%.2f',ttype(1),1);//+',当前持仓量:'+numtostr(abs(tholding),0)
DEBUGFILE2('d:\debug.txt','jiage:%.2f',extgbdata('price'),1);
end

 

全局变量price的值在每根K线上,都有变化,且变化为该周期的开盘价

从全局变量表里,和DEBUG文件里看到的都是这样.

我明明限定了,在开仓的时候,才改变其值,应该一直都是开仓价的

2楼
fly 发表于:2011/11/17 15:19:15

在该句中加入了红色部分,貌似正常了,明天继续跟踪一下.

 

if tholding=0 and DYNAINFO(207)>112300 and islastbar then
begin
tbuy(1,1,mkt);
extgbdataset('price',close);//记录开仓价格
end

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


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