漲幅必須是紅bar

  •   90 
  • 最後發表   阿杜  2023 一月 11
阿杜 發文於   2023/01/09

請問

condition1 = trueany(high>=low*1.03,4) ;

如何在新增條件漲幅3%那根bar必須是紅bar,

目前回測會有3%的黑bar...不知如何再新增條件。

謝謝

排序方式: 標準 | 最新
jo 發文於   2023/01/09

condition1 = trueany(high>=low*1.03,4) and C>O ;

 

XQ小幫手 發文於   2023/01/11

Hello 阿杜,

 

如果是漲幅3%那根Bar必須是紅Bar的話,可以這麼寫:

condition1 = trueany(high>=low*1.03 and close > open,4);

 

condition1 = trueany(high>=low*1.03,4) and C>O ;

這種寫法會是當下那根Bar要是紅Bar,並不是漲幅3%的那根Bar。

阿杜 發文於   2023/01/11

謝謝 小幫手!!

發表回覆
Close