Rss & SiteMap

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

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

标题:请帮忙看看止盈止扣为什么不能产生作用

1楼
leonxu 发表于:2013/1/25 14:27:19


if tholding2=0 then begin
 extgbdataset('maxprofit',0);
 
 //判断当前持仓状态下的最大盈利
 win:=0;
 win2:=0;
end
 
if tavgenterprice>0 then begin

 debugout('最新开仓价tavgenterprice=%2.f',tavgenterprice);
 
 maxprofit:=extgbdata('maxprofit');
 
 if tholding2 > 0  then
 begin
  win:=(c-tavgenterprice)/tavgenterprice*100; //记录最大盈利
   if win > maxprofit then extgbdataset('maxprofit',win);
    win2:=(maxprofit-win)/maxprofit*100; //最大盈利后的回调幅度
 end
 
 if tholding2 < 0  then
 begin
  win:=(tavgenterprice-c)/tavgenterprice*100; //记录最大盈利
  if win > maxprofit then extgbdataset('maxprofit',win);
  win2:=(maxprofit-win)/maxprofit*100; //最大盈利后的回调幅度
 end
end

//出现浮动亏损比如2%平仓
多止损:TSELL(win<=-1*止损,0);
空止损:TSELLshort(win<=-1*止损,0);
 
//出现最高盈利后,回落到盈利的40%平仓出场
多止赢:TSELL(maxprofit>止盈 and win2 >= 50 and topenprofit>0,0);
空止赢:TSELLshort(maxprofit>止盈 and win2 >= 50 and topenprofit>0,0);

 

 

2楼
jinzhe 发表于:2013/1/25 14:38:42
在全局变量管理器里面看看有没有记录值
3楼
leonxu 发表于:2013/1/25 15:31:47
监控里是有的输出的
4楼
leonxu 发表于:2013/1/28 10:41:55

管理器里有值,会不会是,因为比例的原因,小数位太小,系统反应不过来?

5楼
jinzhe 发表于:2013/1/28 10:51:41
输出相应的值,看条件是否满足,
6楼
leonxu 发表于:2013/1/28 16:11:38

程序本身在全局变量的应用上有问题吗

7楼
RogarZ 发表于:2013/1/28 20:50:11

Tsell参数不全~

8楼
leonxu 发表于:2013/1/29 9:23:12

跟踪了一下,那个maxprofitr 全局变量怎么还会缩小的?按程序要求是记录最大值的。

9楼
leonxu 发表于:2013/1/29 9:24:19
请问Tsell怎么参数不全法,应该怎么写,不是省略就全卖吗?
10楼
leonxu 发表于:2013/1/29 11:26:16

跟踪了一下,那个maxprofitr 全局变量怎么还会缩小的?按程序要求是记录最大值的。

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


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