Compare commits
3 Commits
Incrementa
...
b013183f67
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b013183f67 | ||
|
|
6916722a43 | ||
|
|
47551d6781 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -6,6 +6,9 @@ __pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# ignore credentils JSON
|
||||
/credentials/*.json
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
|
||||
@@ -123,12 +123,12 @@ class DefaultStrategy(StrategyBase):
|
||||
if not self.initialized:
|
||||
return StrategySignal("HOLD", 0.0)
|
||||
|
||||
if df_index < 1:
|
||||
if df_index < 2: # shifting one index to prevent lookahead bias
|
||||
return StrategySignal("HOLD", 0.0)
|
||||
|
||||
# Check for meta-trend entry condition
|
||||
prev_trend = backtester.strategies["meta_trend"][df_index - 1]
|
||||
curr_trend = backtester.strategies["meta_trend"][df_index]
|
||||
prev_trend = backtester.strategies["meta_trend"][df_index - 2]
|
||||
curr_trend = backtester.strategies["meta_trend"][df_index - 1]
|
||||
|
||||
if prev_trend != 1 and curr_trend == 1:
|
||||
# Strong confidence when all indicators align for entry
|
||||
|
||||
Reference in New Issue
Block a user