『最佳拍檔』智能決策系統

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 4253|回复: 17

Enhanced System Tester

[复制链接]
发表于 2009-2-24 00:26:37 | 显示全部楼层 |阅读模式

Matthew大師,

 

喺呢度搵左好耐,好辛苦學寫左少少 ,請教點寫:

在Enhanced System Tester,

買入: Cross(mov(close,10,s), mov(close,20,s))
沽出: Cross(mov(close,20,s), mov(close,10,s))

在每天10:00am to 10:15am及12:30pm和16:30pm忽略(即不發出)買入/沽出signal

在12:29pm及16:29pm平倉底

 

BUY ORDER:

Cross(mov(close,10,s), mov(close,20,s))

 

SELL ORDER:

Hour()=12 and Minute()=29
or
Hour()=16 and Minute()=29

 

SELL SHORT ORDER:

Cross(mov(close,20,s), mov(close,10,s))

 

BUY TO COVER ORDER:

Hour()=12 and Minute()=29
or
Hour()=16 and Minute()=29

(在每天10:00am to 10:15am及12:30pm和16:30pm忽略(即不發出)買入/沽出signal)應該點寫/加在那兒?

以上有錯請指教

謝過Matthew大師


[ 本帖最后由 alice 于 2009-2-24 00:32 编辑 ]
发表于 2009-2-24 13:43:27 | 显示全部楼层

 太過複雜了, 會有很多問題須要解決 ~

如真的要做到, 你可以試下這樣:

BUY ORDER:
buyinfo1:=Cross(mov(close,10,s), mov(close,20,s)) ;
info1:= Hour()<=10 ;
info2:= Hour()=10 and Minute()>15;
info3:= Hour()=12 and Minute()<30;
info4:= Hour()=16 and Minute()<30;


 


if(buyinfo1 and info4,1,
if(buyinfo1 and info3,1,
if(buyinfo1 and info2,1,
if(buyinfo1 and info1,1,0


))))


 


其它你自己執下佢 ~


 



 

 楼主| 发表于 2009-2-24 18:32:36 | 显示全部楼层

回复 2# 的帖子

謝過Matthew大師and大大師兄!<img 比左我好多啟示!

1)是否所有時段都要有定義?可否只定義不出buy/sell signal時段=0, else=1?

2)if()裏面可否有多個"and"?
3)請問當中是否1=出buy signal, 0=不出buy signal?<img

4)在索引找不到"buyinfo" 及":=" command是什麼意思?可在那兒找的?<img

[ 本帖最后由 alice 于 2009-2-24 18:52 编辑 ]
发表于 2009-2-24 23:19:15 | 显示全部楼层
1) 要睇你如何運用

2) 可以

3) 正確 <img src="http://www.bp-system.com/discuz/images/smilies/yang/A_100.gif" border=0 smilieid="286">

4) 自定義變數值

於 help 中  Operator Precedence 內有:
Parentheses were used in manyof the preceding formulas in this chapter to control the operation precedence (the order in which the operators are calculated). MetaStock always does operations within the innermost parentheses first.
When parentheses are not used, the precedence is as follows:
- Negative values
* Multiplication
/ Division
+ Addition
- Subtraction
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
= Equal to
<> Not equal to
And Logical "And"
Or Logical "Or"
:= Variable assignment operator

The expression "H + L / 2" (without parenthesis) would be calculated by MetaStock as "L / 2" plus "H," since division has a higher precedence. This would result in a much different value than "(H + L) / 2."

For ease of reading, we recommend that you always use parenthesis to control precedence.
 楼主| 发表于 2009-2-25 02:55:33 | 显示全部楼层
複雜死人!
簡單d,咁只要
1)在12:30pm和16:30pm忽略(即不發出)買入/沽出signal應該點寫 / 加在那兒?
2)在12:30pm和16:30pm平倉底

煩請指教!
謝過Matthew大師and大大師兄!
发表于 2009-2-26 01:40:36 | 显示全部楼层

試下


BUY:


buyinfo1:=Cross(mov(close,10,s), mov(close,20,s)) ;

info1:= Hour()=12 and Minute()<29;
info2:= Hour()=16 and Minute()<29;


if(buyinfo1 and info2,1,
if(buyinfo1 and info1,1,0


)
)


 


Sell:
Hour()=12 and Minute()=29
or
Hour()=16 and Minute()=29

 楼主| 发表于 2009-2-26 09:58:55 | 显示全部楼层

回复 6# 的帖子

又比左我好多啟示! 謝過Matthew大師and大大師兄!
 楼主| 发表于 2009-2-26 18:31:03 | 显示全部楼层

回复 6# 的帖子

Matthew大師,

我發現 Hour()=16 and Minute()=29 {這個等於16:00 及所有29分}

點先可以指定16:29這刻?
发表于 2009-2-26 23:53:05 | 显示全部楼层

無問題喎 ~

 

Q&A_Alice.gif

 楼主| 发表于 2009-2-27 06:47:05 | 显示全部楼层

Matthew大師早晨,



當set左止賺/止蝕後,出來的結果:
當某一bar(e.g.10:32)的高/低位到達或超越果一bar的入市價(以close計)的止賺/止蝕後(e.g.10pts),
system會在果個時間出止賺/止蝕! (見圖)


(A)果bar當時無出止賺,但(B)果bar因低位到達或超越止賺位(e.g.10pts),即時(e.g.10:32)出左止賺!



我係唔係有d地方未set好?


 


剪輯_3.jpg


剪輯_2.jpg

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

本版积分规则

QQ|小黑屋|Archiver|『最佳拍檔』智能決策系統

GMT+8, 2024-4-29 14:01 , Processed in 0.063372 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表