欢迎您光临花生网社区!
| |

 找回密码
 立即注册
查看: 6184|回复: 12
打印 上一主题 下一主题

关于复合价格的语句问题 [复制链接]



Rank: 2

跳转到指定楼层
1#
发表于 2013-4-3 16:21:25 |只看该作者 |倒序浏览 | [分享到 腾讯微博 新浪微博]
请版主将下面表述转换成金魔方的原码,谢谢!
J:=如果收盘价>=开盘价,则(O+C+H)/3,否则(O+C+L)/3);


使用道具 举报



Rank: 8Rank: 8

2#
发表于 2013-4-3 16:35:44 |只看该作者 | [分享到 腾讯微博 新浪微博]
//J:=如果收盘价>=开盘价,则(O+C+H)/3,否则(O+C+L)/3);

j:=IIF(c>=open,(O+C+H)/3,(O+C+L)/3);
1,Initial stop loss
2,Trailing stop loss(Moves up from initial stop to reduce risk,Protects us at break-even point)
3,Profit protection stop(Keeps winning trades from becoming losses,Locks in a portion of the open profit)
4,Profit maximizing exit(Attempts to exit without giving back profits)

使用道具 举报



Rank: 2

3#
发表于 2013-4-8 10:25:43 |只看该作者 | [分享到 腾讯微博 新浪微博]
上次弄的有误,现再次表述如下------
另建公式叫ZPR:
  1. LS:=IIF(C>=OPEN,(O+C+H)/3,(O+C+L)/3);
  2. LS1:=IIF(C>=OPEN,(O+H)/2,(O+L)/2);
  3. P:=SMA(LS,2,1);
  4. JP:LS/REF(LS,1)*100,OWNERSCAle;
  5. ZP:P/REF(P,1)*100,OWNERSCAle;
复制代码运行代码


然后建一个策略叫 跨ZPR,主要是调用公式中的日线的相关值:
BSJ=LastEntryPrice;
KT=intpart((CurrentTime-LastEntryTime)/100);{分钟}
(以下在5分钟图表上跨周期调用公式ZPR中的日线ZP值)
bEnterLong :=(日ZP>100.1 && C<BSJ)或者(日ZP>100.1 && C>BSJ&& KT>=N);   //多头开仓条件
bExitLong  :=(日ZP<99.9  && C>BSJ)或者(日ZP<99.9  && C<BSJ && KT>=N);    //多头平仓条件
bEnterShort:=(日ZP<99.9  && C>BSJ)或者(日ZP<99.9  && C<BSJ && KT>=N);  //空头开仓条件
bExitShort :=(日ZP>100.1 && C<BSJ)或者(日ZP>100.1 && C>BSJ&& KT>=N);  //空头平仓条件

使用道具 举报



Rank: 8Rank: 8

4#
发表于 2013-4-8 10:58:27 |只看该作者 | [分享到 腾讯微博 新浪微博]
zpr:
  1.     LS:=IIF(C>=OPEN,(O+C+H)/3,(O+C+L)/3);
  2.     LS1:=IIF(C>=OPEN,(O+H)/2,(O+L)/2);
  3.     P:=SMA(LS,2,1);
  4.     JP:LS/REF(LS,1)*100,OWNERSCAle;
  5.     ZP:P/REF(P,1)*100,OWNERSCAle;
复制代码运行代码
日ZP:RefIndi('', 'zpr.zp', P_DAY, 1);
这样可以在其他周期引用日线上的zp值
1,Initial stop loss
2,Trailing stop loss(Moves up from initial stop to reduce risk,Protects us at break-even point)
3,Profit protection stop(Keeps winning trades from becoming losses,Locks in a portion of the open profit)
4,Profit maximizing exit(Attempts to exit without giving back profits)

使用道具 举报



Rank: 2

5#
发表于 2013-4-11 15:28:55 |只看该作者 | [分享到 腾讯微博 新浪微博]
LS:=(C+H+L)/3;
P:=SMA(LS,2,1);
ZP/REF(P,1)*100,OWNERSCAle;
求:
PZL:=最后平(多)仓以来 ZP 的最低值;
PZH:=最后平(空)仓以来 ZP 的最高值;

使用道具 举报



Rank: 2

6#
发表于 2013-4-11 15:34:31 |只看该作者 | [分享到 腾讯微博 新浪微博]
PJLLV(X88,BARSSP+1),NODRAW;

使用道具 举报



Rank: 8Rank: 8

7#
发表于 2013-4-11 16:06:32 |只看该作者 | [分享到 腾讯微博 新浪微博]
XXN139 发表于 2013-4-11 15:28
LS:=(C+H+L)/3;
P:=SMA(LS,2,1);
ZP/REF(P,1)*100,OWNERSCAle;

pzl=llv(zp,BarsSinceExit);
pzh=hhv(zp,BarsSinceExit);
1,Initial stop loss
2,Trailing stop loss(Moves up from initial stop to reduce risk,Protects us at break-even point)
3,Profit protection stop(Keeps winning trades from becoming losses,Locks in a portion of the open profit)
4,Profit maximizing exit(Attempts to exit without giving back profits)

使用道具 举报



Rank: 1

8#
发表于 2013-4-11 16:41:24 |只看该作者 | [分享到 腾讯微博 新浪微博]
来学习了!!!

使用道具 举报



Rank: 2

9#
发表于 2013-4-11 17:14:51 |只看该作者 | [分享到 腾讯微博 新浪微博]
谢谢版主,我试试看。

使用道具 举报



Rank: 6Rank: 6

10#
发表于 2013-4-13 15:09:21 |只看该作者 | [分享到 腾讯微博 新浪微博]
学习了谢谢啊

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册


bottom

Archiver|www.hs633.com ( 粤ICP备11107430号 )

GMT+8, 2024-5-18 17:12 , Processed in 0.101563 second(s), 8 queries .

花生网 Copyright©2012-2014

回顶部