新增实盘策略:FisherTrendStrategy(FG)
This commit is contained in:
@@ -118,7 +118,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
self._closes.append(prev_bar.close)
|
||||
|
||||
T, FV, FB, ATR = self._calculate_indicators()
|
||||
self.log(f'T: {Tf} FV: {FVf} FB: {FBf} ATR: {ATRf}')
|
||||
self.log(f'T: {T} FV: {FV} FB: {FB} ATR: {ATR}')
|
||||
if T is None or math.isnan(ATR): return
|
||||
|
||||
self._fbs.append(FB)
|
||||
@@ -134,7 +134,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
|
||||
is_met = self.indicator is None or self.indicator.is_condition_met(*self.get_indicator_tuple())
|
||||
|
||||
self.log(f'is_met: {is_met}, pos: {pos}, current_fb: {current_fbf}, prev_fb: {prev_fbf}')
|
||||
self.log(f'is_met: {is_met}, pos: {pos}, current_fb: {current_fb}, prev_fb: {prev_fb}')
|
||||
|
||||
# ==========================================
|
||||
# 核心一:经典出场逻辑 (你的原版设计)
|
||||
@@ -151,7 +151,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
if pos > 0:
|
||||
# A. 动能极值止盈
|
||||
if current_fb > self.fisher_exit_level and current_fb < prev_fb:
|
||||
self.log(f"TAKE PROFIT (Long): FB {current_fbf} Peak Reached")
|
||||
self.log(f"TAKE PROFIT (Long): FB {current_fb} Peak Reached")
|
||||
self.send_market_order("CLOSE_LONG", abs(pos), "CLOSE")
|
||||
return
|
||||
|
||||
@@ -171,7 +171,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
elif pos < 0:
|
||||
# A. 动能极值止盈
|
||||
if current_fb < -self.fisher_exit_level and current_fb > prev_fb:
|
||||
self.log(f"TAKE PROFIT (Short): FB {current_fbf} Bottom Reached")
|
||||
self.log(f"TAKE PROFIT (Short): FB {current_fb} Bottom Reached")
|
||||
self.send_market_order("CLOSE_SHORT", abs(pos), "CLOSE")
|
||||
return
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
self._closes.append(prev_bar.close)
|
||||
|
||||
T, FV, FB, ATR = self._calculate_indicators()
|
||||
self.log(f'T: {Tf} FV: {FVf} FB: {FBf} ATR: {ATRf}')
|
||||
self.log(f'T: {T} FV: {FV} FB: {FB} ATR: {ATR}')
|
||||
if T is None or math.isnan(ATR): return
|
||||
|
||||
self._fbs.append(FB)
|
||||
@@ -134,7 +134,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
|
||||
is_met = self.indicator is None or self.indicator.is_condition_met(*self.get_indicator_tuple())
|
||||
|
||||
self.log(f'is_met: {is_met}, pos: {pos}, current_fb: {current_fbf}, prev_fb: {prev_fbf}')
|
||||
self.log(f'is_met: {is_met}, pos: {pos}, current_fb: {current_fb}, prev_fb: {prev_fb}')
|
||||
|
||||
# ==========================================
|
||||
# 核心一:经典出场逻辑 (你的原版设计)
|
||||
@@ -151,7 +151,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
if pos > 0:
|
||||
# A. 动能极值止盈
|
||||
if current_fb > self.fisher_exit_level and current_fb < prev_fb:
|
||||
self.log(f"TAKE PROFIT (Long): FB {current_fbf} Peak Reached")
|
||||
self.log(f"TAKE PROFIT (Long): FB {current_fb} Peak Reached")
|
||||
self.send_market_order("CLOSE_LONG", abs(pos), "CLOSE")
|
||||
return
|
||||
|
||||
@@ -171,7 +171,7 @@ class PragmaticCyberneticStrategy(Strategy):
|
||||
elif pos < 0:
|
||||
# A. 动能极值止盈
|
||||
if current_fb < -self.fisher_exit_level and current_fb > prev_fb:
|
||||
self.log(f"TAKE PROFIT (Short): FB {current_fbf} Bottom Reached")
|
||||
self.log(f"TAKE PROFIT (Short): FB {current_fb} Bottom Reached")
|
||||
self.send_market_order("CLOSE_SHORT", abs(pos), "CLOSE")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user