請選擇 進入手機版 | 繼續訪問電腦版

COCO研究院

 找回密碼
 註冊
搜索
查看: 4639|回復: 4

[教學] 請教寫法

[複製鏈接]
發表於 17-5-7 13:53 | 顯示全部樓層 |閱讀模式
本帖最後由 平靜的海 於 17-5-7 13:55 編輯

使用的是券商版MC 8.5 x64
看的商品是BO(黃豆油)
使用的是1分K

資料的起始為2015/7/31
連續觀察的結果是 我發現

O - C = X
C - L = Y
H=O
L < C
Y > X
Y / X >1.1就是下影線大於實體線1.1或1倍以上時.....
都會反轉相對的Y值 (甚至更高) 其勝率約有60-70%

但 不可以在開盤後10分鐘內  也不可以在收盤前15分鐘之內
也不可以在道瓊開盤的前後10分鐘內

我看的到但不會寫 @@|||










發表於 17-5-7 17:58 | 顯示全部樓層
假設開盤10分鐘為08:40,收盤前15分鐘為13:15

if time>0840 and time<1315 then begin
   {buy or sellshort}
end;

定義好你的交易時間即可,為什麼不會寫?
發表於 17-5-11 23:48 | 顯示全部樓層
// 把沒有的東西加個 Variable 就是了
// 但只有 買入策略,怎樣離場?

variable: X( 0 ), Y( 0 );

if time>0840 and time<1315 then begin
    O - C = X;
    C - L = Y;

if H=O and L < C and Y > X and ((Y / X) >1.1) then
    buy next bar at market;

end;

// Easy language 幾乎是你說了甚麼就是這樣出來了!
發表於 17-5-12 08:20 | 顯示全部樓層

但 不可以在開盤後10分鐘內  也不可以在收盤前15分鐘之內

condition1 = Time > CalcTime(Sess1StartTime,10*BarInterval) and Time < CalcTime(Sess1EndTime,-15*BarInterval) ;

也不可以在道瓊開盤的前後10分鐘內
假設是 黃豆油開盤後 2Hr (120 min) 道瓊開盤

condition2 = Time > CalcTime(Sess1StartTime,110*BarInterval) and Time < CalcTime(Sess1StartTime,130*BarInterval) ;


把樓上這段
if time>0840 and time<1315 then begin
換成

if condition1 and condition2 then begin
 樓主| 發表於 17-5-21 21:17 | 顯示全部樓層
vars:line15(0),line30(0);
line15=Average(close,15);
line30=Average(close,30);
condition1=o<c and o=l and h>c and h-c>c-o and (h-c)/(c-o)>=1.1;//red
condition2=o>c and c=l and h>o and h-o>o-c and (h-o)/(o-c)>=1.1;//green
condition3=o>c and o=h and l<c and h-c<c-l and (c-l)/(o-c)>=1.1;//green
condition4=o<c and c=h and l<o and c-o<o-l and (o-l)/(c-o)>=1.1;//red

if marketposition=0 and condition1  then sellshort("S1") next bar market;
if marketposition=0 and condition2  then sellshort("S2") next bar market;
if marketposition=-1 and c<entryprice and entryprice-c>=0.1 then buytocover next bar market;
if marketposition=-1 and c>entryprice and c-entryprice>=0.1 then buytocover next bar market;


if marketposition=0 and condition3 then buy("B1") next bar market;
if marketposition=0 and condition4 then buy("B2") next bar market;
if marketposition=1 and c>entryprice and c-entryprice>=0.1 then sell next bar market;
if marketposition=1 and c<entryprice and entryprice-c>=0.1 then sell next bar market;

這是我簡單的想法寫出來的.
(1)沒有除去我不想進場的時間
(2)停損跟停利相同 (因為我還在研究怎麼寫移動停利)
(3)K棒的時間改為五分K 試過1-4分K都只會虧更多

當我去調整設定時 只做空 是虧的 只做多 是賺的
還有可過濾的參數為 在line15 之上或是之下 加入設定後
ex:if marketposition=0 and condition3 and c<line15 then buy("B1") next bar market;
獲利變少的原因??
我的疑問是
當我調整 con1~con4的倍數 配合 均線參數調整 這樣會有
很多種變化 是要一樣一樣的去調整才能找到最好的權益曲線嗎?
1.調整倍數(從1.0-3.0) 有很多種@@
2.調整K棒的位置(在均線上或是下)(大約32種)
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-3-28 19:50

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook