Skip to content

Commit

Permalink
volume checks, update config
Browse files Browse the repository at this point in the history
  • Loading branch information
nateemma committed Dec 8, 2023
1 parent 07e2632 commit 8b7224e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
22 changes: 13 additions & 9 deletions TSPredict/TSPredict.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ class TSPredict(IStrategy):

# Buy hyperspace params:
buy_params = {
"cexit_min_profit_th": 0.6,
"cexit_profit_nstd": 3.4,
"cexit_min_profit_th": 0.5,
"cexit_profit_nstd": 3.2,
"enable_entry_guards": False,
"entry_guard_fwr": -0.4,
"entry_guard_fwr": -0.9,
}

# Sell hyperspace params:
sell_params = {
"cexit_fwr_overbought": 0.99,
"cexit_fwr_take_profit": 0.98,
"cexit_loss_nstd": 0.3,
"cexit_fwr_take_profit": 0.99,
"cexit_loss_nstd": 0.7,
"cexit_min_loss_th": -0.2,
"cexit_enable_large_drop": False, # value loaded from strategy
"cexit_large_drop": -1.5, # value loaded from strategy
Expand Down Expand Up @@ -226,18 +226,18 @@ class TSPredict(IStrategy):
"""

# No. Standard Deviations of profit/loss for target, and lower limit
cexit_min_profit_th = DecimalParameter(0.4, 1.0, default=0.6, decimals=1, space="buy", load=True, optimize=True)
cexit_profit_nstd = DecimalParameter(0.0, 4.0, default=3.4, decimals=1, space="buy", load=True, optimize=True)
cexit_min_profit_th = DecimalParameter(0.4, 1.0, default=0.5, decimals=1, space="buy", load=True, optimize=True)
cexit_profit_nstd = DecimalParameter(0.0, 4.0, default=3.2, decimals=1, space="buy", load=True, optimize=True)

cexit_min_loss_th = DecimalParameter(-1.0, -0.1, default=-0.2, decimals=1, space="sell", load=True, optimize=True)
cexit_loss_nstd = DecimalParameter(0.0, 4.0, default=0.3, decimals=1, space="sell", load=True, optimize=True)
cexit_loss_nstd = DecimalParameter(0.0, 4.0, default=0.7, decimals=1, space="sell", load=True, optimize=True)

# Fisher/Williams sell limits
cexit_fwr_overbought = DecimalParameter(
0.90, 0.99, default=0.99, decimals=2, space="sell", load=True, optimize=True
)
cexit_fwr_take_profit = DecimalParameter(
0.90, 0.99, default=0.98, decimals=2, space="sell", load=True, optimize=True
0.90, 0.99, default=0.99, decimals=2, space="sell", load=True, optimize=True
)

# sell if we see a large drop, and how large?
Expand Down Expand Up @@ -995,6 +995,10 @@ def custom_exit(
if not self.use_custom_stoploss:
return None

# check volume?!
if last_candle['volume'] <= 1.0:
return None

# strong sell signal, in profit
if (current_profit > 0.0) and (last_candle["fisher_wr"] >= self.cexit_fwr_overbought.value):
return "fwr_overbought"
Expand Down
14 changes: 7 additions & 7 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
"unit": "minutes"
},
"entry_pricing": {
"price_side": "other",
"price_side": "same",
"use_order_book": true,
"order_book_top": 1,
"price_last_balance": 0.0,
"check_depth_of_market": {
"enabled": false,
"bids_to_ask_delta": 1
"enabled": false,
"bids_to_ask_delta": 1
}
},
"exit_pricing": {
},
"exit_pricing": {
"price_side": "other",
"use_order_book": true,
"order_book_top": 1
},
},
"order_types": {
"entry": "market",
"entry": "limit",
"exit": "market",
"emergency_exit": "market",
"force_exit": "market",
Expand Down

0 comments on commit 8b7224e

Please sign in to comment.