Rss & SiteMap

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

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

标题:交易系统中移动止损得范例

1楼
admin 发表于:2010/6/21 22:28:56

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

RUNMODE:0;            //工作于逐周期模式

 

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

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));

[此贴子已经被作者于2010-9-16 16:30:03编辑过]
2楼
易士 发表于:2010/6/21 22:33:58
太好了。解决了大问题
3楼
helan 发表于:2010/6/22 0:21:58
这是admin管理员写的吗?您太伟大了。是不是神仙下凡。
4楼
sludi 发表于:2010/6/22 11:01:18

赞~~

5楼
wzywzy292 发表于:2010/7/17 0:02:52
 谢谢
6楼
趋势7778888 发表于:2010/7/17 13:57:32
请问移动止赢 改那里的函数 谢谢
7楼
xian_0_9 发表于:2010/8/14 16:04:13

这个系统一旦触发止损就会反向开仓。买卖信号太频繁了。

我想把这个改成开盘价和收盘价全都超过止损线再反向出信号怎么改?

下面是我自己改的。但是是收盘价过去了,就会出反向的止损。

if barpos = 0 then
  stopprice := l - stopnum;

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

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

8楼
海边的鱼 发表于:2011/6/27 10:17:18

为何图上什么显示都没有呢?

 

  
图片点击可在新窗口打开查看
9楼
海边的鱼 发表于:2011/6/27 10:21:15
  
图片点击可在新窗口打开查看
 
共9 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.04492 s, 2 queries.