Skip to content

Commit

Permalink
new freelance strategy)))
Browse files Browse the repository at this point in the history
  • Loading branch information
VladKochetov007 committed Aug 10, 2021
1 parent c9bac9b commit 225d4ff
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
25 changes: 24 additions & 1 deletion quick_trade/trading_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
from typing import Union
from warnings import warn

import ta
import ta.momentum
import ta.trend
import ta.volatility
from numpy import array
from numpy import digitize
from numpy import inf
Expand Down Expand Up @@ -1592,3 +1594,24 @@ def strategy_idris(self, points=20):
self.set_open_stop_and_take(stop_loss=points * 2, take_profits=points * 20)
self.set_credit_leverages()
return self.returns

def DP_strategy(self,
length: int = 14,
s1: int = 3,
s2: int = 3,
sl:float=300.0,
tp:float=500.0):
self.returns = []
stoch = ta.momentum.StochRSIIndicator((self.df['High'] + self.df['Low']) / 2, length, s1, s2)
flag = utils.EXIT
for fast, slow in zip(stoch.stochrsi_k()*100,
stoch.stochrsi_d()*100):
if fast > 80 and slow > 80:
flag = utils.SELL
if fast < 20 and slow < 20:
flag = utils.BUY
self.returns.append(flag)
self.set_credit_leverages()
self.set_open_stop_and_take(take_profit=500,
stop_loss=300)
return self.returns
2 changes: 1 addition & 1 deletion quick_trade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
mean year percentage profit: {}%
winrate: {}%""" # .format(Trader.losses, Trader.trades, Trader.profits, Trader.year_profit, Trader.winrate)

__version__: str = "6.4.2"
__version__: str = "6.4.3"
__author__: str = 'Vlad Kochetov'
__credits__: List[str] = [
"Hemerson Tacon -- Stack overflow",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
with open('README.md') as file:
long_desc = file.read()

__version__ = "6.4.2"
__version__ = "6.4.3"

setup(
name='quick_trade',
Expand Down

0 comments on commit 225d4ff

Please sign in to comment.