COCO研究院

 找回密碼
 註冊
搜索
查看: 3207|回復: 6

求解讀一下程式碼

[複製鏈接]
發表於 18-8-20 23:08 | 顯示全部樓層 |閱讀模式
小弟從其他大大的blog上面看到以下這個程式碼, 但看不懂condition3/condition4的意思
想請問有人能說明一下嗎?

condition1=highd(0)>=opend(0)*(1+F);
condition3=(high=highd(0) and high>=opend(0)*(1+F)) or high<highd(0);
condition2=lowd(0)<=opend(0)*(1-F);
condition4=(low=lowd(0)and low<=opend(0)*(1-F) ) or low>lowd(0);

if marketposition=0  and k1=0 and time>0900 and time<=1300  and condition1 and condition3  then
buy("b") next bar at highd(0) stop;
if marketposition=0 and k2=0 and time>0900 and time<=1300  and condition2 and condition4 then
Sellshort("s") next bar at lowd(0) stop ;

發表於 18-8-22 12:17 | 顯示全部樓層
今高設定今高,不使用昨天或明天XD簡單的說是一種強迫症狀
回復 支持 1 反對 0

使用道具 舉報

發表於 18-8-22 13:18 | 顯示全部樓層
突破或破低 開盤加上固定比例一個點位後進場,好奇這個績效會好嗎?
 樓主| 發表於 18-8-23 22:55 來自手機 | 顯示全部樓層
沒有, 因為是初學所以在網絡上找一些大大的程式碼來研究
發表於 18-8-24 00:06 | 顯示全部樓層
本帖最後由 沒房子的阿捨 於 18-8-24 00:59 編輯

先從condition3來看:
由於有條件為high=highd(0) , 所以condition3可以簡化如下:

condition3=(highd(0)>=opend(0)*(1+F)) or high<highd(0);

在把簡化後的condition3 and condition1一起看:
condition1=highd(0)>=opend(0)*(1+F);
condition3=(highd(0)>=opend(0)*(1+F)) or high<highd(0);


這樣看應該比較好懂......

發表於 19-1-10 23:26 | 顯示全部樓層
BO策略近年來績效均不佳,若加上移動停利尚可一用.
發表於 21-2-2 22:51 | 顯示全部樓層
感謝大大分享
趕快來看看~~~~
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-28 08:55

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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