Rss & SiteMap

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

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

标题:[求助]修改公式,先谢谢!!!

1楼
wzywzy292 发表于:2010/7/17 1:10:22
VARIABLE: aspect多=0; //初始化假定做多头
VARIABLE: stopprice多=0;//止损价格变量
VARIABLE: stopnum多 = 10; //止损价差
 
if barpos = 0 then
  stopprice多 := l - stopnum多;

if aspect多 = 0 then
begin
 //多头处理  
 if l <= stopprice多 then
 begin
  //多反空
  aspect多:= 1;
  stopprice多 := h+stopnum多;
 end
 
 //处理移动的底部
 if l - stopnum多 > stopprice多 then
  stopprice多 := l-stopnum多;
end


VARIABLE: aspect空=1; //初始化假定做多头
VARIABLE: stopprice空=0;//止损价格变量
VARIABLE: stopnum空 = 10; //止损价差

if barpos = 0 then
  stopprice空 := h + stopnum空;

if aspect空 = 1 then
begin
 //空头处理  
 if h >= stopprice空 then
 begin
  //空反多
  aspect空:= 0;
  stopprice空 := l-stopnum空;
 end
 
 //处理移动的底部
 if h + stopnum空 < stopprice空 then
  stopprice空 := h+stopnum空;
end

//画线
PARTLINE( aspect多 = 0, stopprice多 , colorrgb(255,0,0));
PARTLINE( aspect空 = 1, stopprice空 , colorrgb(0,255,0));

上式是根据移动止损范例(http://www.weistock.com/bbs/dispbbs.asp?BoardID=4&ID=1900&replyID=&skin=1)改成的两个独立(分别为多和空)的移动止损公式,但问题是图上没有显示,请领导帮忙解决,谢谢!!!

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


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