Skip to content

Commit

Permalink
misc preparing for spacex announce to suuport doge merch
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineLep committed Jun 3, 2022
1 parent 0e15b29 commit bebc084
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/application_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from strategies.multi_coin_abnormal_volume_tracker.multi_coin_abnormal_volume_tracker \
import MultiCoinAbnormalVolumeTracker

strategy = CryptofeedStrategy()
strategy = TwitterElonMuskDogeTracker()

log = {
"level": "info",
Expand Down
3 changes: 3 additions & 0 deletions strategies/cryptofeed_strategy/cryptofeed_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import List

import pandas as pd
from stockstats import StockDataFrame

from core.enums.order_type_enum import OrderTypeEnum
from core.enums.position_state_enum import PositionStateEnum
Expand Down Expand Up @@ -95,6 +96,8 @@ def __init__(self):
# Dict of running position drivers
self.position_drivers = {}

StockDataFrame.BOLL_STD_TIMES = 4

self._t: threading.Thread = threading.Thread(target=self.strategy_runner)

def before_loop(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
BASE_LEVERAGE = 15 # Will be used otherwise

# First take profit
TP1_TARGET_PERCENTAGE = 10
TP1_TARGET_PERCENTAGE = 12 # old: 10
TP1_SIZE_RATIO = 0.3

# Second take profit
TP2_TARGET_PERCENTAGE = 15
TP2_TARGET_PERCENTAGE = 16 # old: 15
TP2_SIZE_RATIO = 0.4

# Last take profit
TP3_TARGET_PERCENTAGE = 20
# TP3_SIZE_RATIO Will be filled with remaining position size

# Stop loss
SL_PERCENTAGE = 1
SL_PERCENTAGE = 2 # old: 1

MAX_OPEN_DURATION = 60 * 6

Expand Down Expand Up @@ -245,6 +245,13 @@ def process_last_tweet(self):
probable_related_words = ["moon", "mars", "hodl", "hold", "coin"]
last_tweet["text"] = last_tweet["text"].lower()

spacex_doge_merch_words = ["spacex", "doge", "merch"]
if all(word in last_tweet["text"] for word in spacex_doge_merch_words) \
and str(last_tweet["text"]).startswith("@") is False:
logging.info("Doge merch tweet")
self.last_tweet_doge_oriented_probability = ProbabilityEnum.NO_DOUBT
return

if str(last_tweet["text"]).startswith("@"):
logging.info("Answering someone, can have weird market reaction")
self.last_tweet_doge_oriented_probability = ProbabilityEnum.NOT_PROBABLE
Expand Down

0 comments on commit bebc084

Please sign in to comment.