語法問題

  •   283 
  • 最後發表   股海無涯  2024 九月 27
股海無涯 發文於   2024/09/24

Input: Length(20), LowerBand(3);

 

settotalbar(Length + 3);

 

SetInputName(1, "期數");

 

SetInputName(2, "通道下緣");

 

 

 

condition1 = close cross over bollingerband(getfield("Close","5"), Length, -1 * LowerBand) ; //收盤價向上突破布林下軌

 

condition2 = close cross under bollingerband(getfield("Close","5"), Length, -1 * LowerBand) ; //收盤價向上突破布林下軌

 

if condition1 or condition2 then ret = 1;


各位大神及小編大家好,以上是我參考版上的,想詢問如果我想多增加一些排除條件
1.突破上軌且當前漲幅不超過7%
2.跌破下軌且當前跌幅不超過7%
3.標的僅限當日可買賣現沖
4.目前股價位於100-200間

請問應該如何修正會比較適當

排序方式: 標準 | 最新
虎科大許教授 發文於   2024/09/24

value1=bollingerband(getfield("Close","5"), Length, 1 * LowerBand);

value2=bollingerband(getfield("Close","5"), Length, -1 * LowerBand);

1.突破上軌且當前漲幅不超過7%

condition3=close cross over value1 and GetQuote("漲跌幅")<7;
2.跌破下軌且當前跌幅不超過7%

condition4=close cross under value2 and GetQuote("漲跌幅")>-7;
3.標的僅限當日可買賣現沖

condition5=GetSymbolInfo("買賣現沖")=true;
4.目前股價位於100-200間

condition6=c>100 and c<200;

XS小編 發文於   2024/09/27

Hello 股海無涯,

 

小編補充,您可以先觀看網站上的教學區教學影片,裡面有XS語法的基礎和應用可以閱覽。

文中的條件都相對單純,只要有基礎大多可以自行寫出。

 

感謝 虎科大許教授 的熱心回覆。

發表回覆
Close