請問五分鐘K棒進場與五分鐘TICK出場

  •   151 
  • 最後發表   小羅羅  2023 八月 07
小羅羅 發文於   2023/07/31

你好 我想請問自動交易中心可以用五分鐘K棒確認進場,然後出場要用逐筆洗價TICK出場,請問這樣要如何寫出來?

排序方式: 標準 | 最新
XQ小幫手 發文於   2023/08/02

Hello 小羅羅,

 

您可以使用5分鐘逐筆洗價頻率,並用上一根Bar (已結束的Bar) 來判斷是否要進場,當根Bar (當下的洗價)的資訊判斷是否要出場。

舉例來說:

condition1 = 進場條件;

condition2 = 出場條件;

 

if position = 0 and filled = 0 and condition1[1] then setposition(1, market);   //用上一根Bar來判斷進場

if position = 1 and filled = 1 and condition2 then setposition(0, market);;oop    //用當下的Bar來判斷出場

小羅羅 發文於   2023/08/07

好的 我試看看 感謝

 

發表回覆
Close