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

COCO研究院

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

[教學] condition2 = CurrentBar > 1 and Condition1 and Condition1[1] = false;

[複製鏈接]
發表於 16-1-27 18:04 | 顯示全部樓層 |閱讀模式
本帖最後由 huagei 於 16-1-27 18:12 編輯

各位大大…  請問

Condition1 = Price > var0 and var0 > var1 and var1 > var2 ;
condition2 = CurrentBar > 1 and Condition1 and Condition1[1] = false;
if condition2                                                                     
then  Buy ( "MA3CrsLE" ) next bar at market  ;

------------------------------------------------------------------------

這一句 … condition2 = CurrentBar > 1 and Condition1 and Condition1[1] = false;
看不太懂 紅字部分 在說什麼?   
為什麼 condition2 最後要 = false  ?  



發表於 16-1-28 09:20 | 顯示全部樓層
condition2 = (CurrentBar > 1) and (Condition1 = true) and (Condition1[1] = false);
這樣就容易懂了。翻成中文就是

條件2 = (這一根的CurrentBar超過1)  且  (這一根條件1成立)   且   (前一根條件1不成立)
回復 支持 1 反對 0

使用道具 舉報

發表於 16-1-27 18:17 | 顯示全部樓層
condition2沒有會=false

這意思是 要同時符合current bar>1,且condition1=true,且condition1[1](前一根K棒時的condition1)=false

當以上三種條件符合時condition2會=true,當其中一種不符合時,condtion2=false

所以我討厭偷懶寫簡寫,看得很痛苦

評分

參與人數 1金錢 +2 收起 理由
huagei + 2 感謝分享

查看全部評分

 樓主| 發表於 16-1-27 18:34 | 顯示全部樓層
blj0511 大大

感恩…  之前我看得頭都暈了
看了您寫的解說,馬上清醒了,太謝謝您了。
^_^

發表於 16-1-28 12:14 | 顯示全部樓層
黃金交叉買進訊號?
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-19 06:40

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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