add mode
This commit is contained in:
parent
85fd4f4eba
commit
4ae6d050e5
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# --- Do not remove these libs ---
|
# --- Do not remove these libs ---
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from freqtrade.strategy import IStrategy
|
from freqtrade.strategy import IStrategy
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
@ -11,6 +11,7 @@ from pandas import DataFrame
|
|||||||
import talib.abstract as ta
|
import talib.abstract as ta
|
||||||
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||||
import numpy # noqa
|
import numpy # noqa
|
||||||
|
from datetime import datetime
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
@ -159,7 +160,8 @@ class Strategy002(IStrategy):
|
|||||||
:return bool: When True is returned, then the buy-order is placed on the exchange.
|
:return bool: When True is returned, then the buy-order is placed on the exchange.
|
||||||
False aborts the process
|
False aborts the process
|
||||||
"""
|
"""
|
||||||
print("confirm_trade_entry --------------> current_time = " + str(current_time))
|
mode = "test"
|
||||||
subprocess.call("python /root/workspace/execution/launcher.py", shell=True)
|
coin = pair.split("/")[0]
|
||||||
|
subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@ from pandas import DataFrame
|
|||||||
import talib.abstract as ta
|
import talib.abstract as ta
|
||||||
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||||
import numpy # noqa
|
import numpy # noqa
|
||||||
|
from datetime import datetime
|
||||||
|
import subprocess
|
||||||
|
|
||||||
class Strategy003(IStrategy):
|
class Strategy003(IStrategy):
|
||||||
"""
|
"""
|
||||||
@ -150,3 +151,29 @@ class Strategy003(IStrategy):
|
|||||||
),
|
),
|
||||||
'sell'] = 1
|
'sell'] = 1
|
||||||
return dataframe
|
return dataframe
|
||||||
|
|
||||||
|
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
|
||||||
|
time_in_force: str, current_time: datetime, **kwargs) -> bool:
|
||||||
|
"""
|
||||||
|
Called right before placing a buy order.
|
||||||
|
Timing for this function is critical, so avoid doing heavy computations or
|
||||||
|
network requests in this method.
|
||||||
|
|
||||||
|
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
|
||||||
|
|
||||||
|
When not implemented by a strategy, returns True (always confirming).
|
||||||
|
|
||||||
|
:param pair: Pair that's about to be bought.
|
||||||
|
:param order_type: Order type (as configured in order_types). usually limit or market.
|
||||||
|
:param amount: Amount in target (quote) currency that's going to be traded.
|
||||||
|
:param rate: Rate that's going to be used when using limit orders
|
||||||
|
:param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).
|
||||||
|
:param current_time: datetime object, containing the current datetime
|
||||||
|
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||||
|
:return bool: When True is returned, then the buy-order is placed on the exchange.
|
||||||
|
False aborts the process
|
||||||
|
"""
|
||||||
|
mode = "test"
|
||||||
|
coin = pair.split("/")[0]
|
||||||
|
subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True)
|
||||||
|
return True
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# --- Do not remove these libs ---
|
# --- Do not remove these libs ---
|
||||||
from freqtrade.strategy import IStrategy
|
from freqtrade.strategy import IStrategy
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
@ -6,12 +5,12 @@ from functools import reduce
|
|||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import talib.abstract as ta
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
class Strategy004(IStrategy):
|
import talib.abstract as ta
|
||||||
|
|
||||||
|
|
||||||
|
class Strategy004(IStrategy):
|
||||||
"""
|
"""
|
||||||
Strategy 004
|
Strategy 004
|
||||||
author@: Gerald Lonlas
|
author@: Gerald Lonlas
|
||||||
@ -24,10 +23,10 @@ class Strategy004(IStrategy):
|
|||||||
# Minimal ROI designed for the strategy.
|
# Minimal ROI designed for the strategy.
|
||||||
# This attribute will be overridden if the config file contains "minimal_roi"
|
# This attribute will be overridden if the config file contains "minimal_roi"
|
||||||
minimal_roi = {
|
minimal_roi = {
|
||||||
"60": 0.01,
|
"60": 0.01,
|
||||||
"30": 0.03,
|
"30": 0.03,
|
||||||
"20": 0.04,
|
"20": 0.04,
|
||||||
"0": 0.05
|
"0": 0.05
|
||||||
}
|
}
|
||||||
|
|
||||||
# Optimal stoploss designed for the strategy
|
# Optimal stoploss designed for the strategy
|
||||||
@ -116,23 +115,23 @@ class Strategy004(IStrategy):
|
|||||||
"""
|
"""
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
(dataframe['adx'] > 50) |
|
(dataframe['adx'] > 50) |
|
||||||
(dataframe['slowadx'] > 26)
|
(dataframe['slowadx'] > 26)
|
||||||
) &
|
) &
|
||||||
(dataframe['cci'] < -100) &
|
(dataframe['cci'] < -100) &
|
||||||
(
|
(
|
||||||
(dataframe['fastk-previous'] < 20) &
|
(dataframe['fastk-previous'] < 20) &
|
||||||
(dataframe['fastd-previous'] < 20)
|
(dataframe['fastd-previous'] < 20)
|
||||||
) &
|
) &
|
||||||
(
|
(
|
||||||
(dataframe['slowfastk-previous'] < 30) &
|
(dataframe['slowfastk-previous'] < 30) &
|
||||||
(dataframe['slowfastd-previous'] < 30)
|
(dataframe['slowfastd-previous'] < 30)
|
||||||
) &
|
) &
|
||||||
(dataframe['fastk-previous'] < dataframe['fastd-previous']) &
|
(dataframe['fastk-previous'] < dataframe['fastd-previous']) &
|
||||||
(dataframe['fastk'] > dataframe['fastd']) &
|
(dataframe['fastk'] > dataframe['fastd']) &
|
||||||
(dataframe['mean-volume'] > 0.75) &
|
(dataframe['mean-volume'] > 0.75) &
|
||||||
(dataframe['close'] > 0.00000100)
|
(dataframe['close'] > 0.00000100)
|
||||||
),
|
),
|
||||||
'buy'] = 1
|
'buy'] = 1
|
||||||
|
|
||||||
@ -146,15 +145,14 @@ class Strategy004(IStrategy):
|
|||||||
"""
|
"""
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
(dataframe['slowadx'] < 25) &
|
(dataframe['slowadx'] < 25) &
|
||||||
((dataframe['fastk'] > 70) | (dataframe['fastd'] > 70)) &
|
((dataframe['fastk'] > 70) | (dataframe['fastd'] > 70)) &
|
||||||
(dataframe['fastk-previous'] < dataframe['fastd-previous']) &
|
(dataframe['fastk-previous'] < dataframe['fastd-previous']) &
|
||||||
(dataframe['close'] > dataframe['ema5'])
|
(dataframe['close'] > dataframe['ema5'])
|
||||||
),
|
),
|
||||||
'sell'] = 1
|
'sell'] = 1
|
||||||
return dataframe
|
return dataframe
|
||||||
|
|
||||||
|
|
||||||
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
|
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
|
||||||
time_in_force: str, current_time: datetime, **kwargs) -> bool:
|
time_in_force: str, current_time: datetime, **kwargs) -> bool:
|
||||||
"""
|
"""
|
||||||
@ -176,7 +174,7 @@ class Strategy004(IStrategy):
|
|||||||
:return bool: When True is returned, then the buy-order is placed on the exchange.
|
:return bool: When True is returned, then the buy-order is placed on the exchange.
|
||||||
False aborts the process
|
False aborts the process
|
||||||
"""
|
"""
|
||||||
print("confirm_trade_entry --------------> current_time = " + str(current_time))
|
mode = "test"
|
||||||
subprocess.call("python3 /root/workspace/execution/launcher.py "+ pair, shell=True)
|
coin = pair.split("/")[0]
|
||||||
|
subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user