Skip to content

Commit

Permalink
price_channel and trailing
Browse files Browse the repository at this point in the history
  • Loading branch information
VladKochetov007 committed Apr 10, 2022
1 parent cac1ff0 commit d7550bc
Show file tree
Hide file tree
Showing 17 changed files with 152,736 additions and 152,556 deletions.
6 changes: 1 addition & 5 deletions docs/docs/quick_trade/trading_sys.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,9 @@ The strategy issues its verdict based on the last change to the dataframe. If yo

### deposit_history_update

### update_identifier

### correct_sl_tp

### save

### load
### trailing_stop

## ExampleStrategies

Expand Down
50 changes: 50 additions & 0 deletions examples/bot_portfolio_backtest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from quick_trade.trading_sys import ExampleStrategies
from quick_trade.plots import make_trader_figure, TraderGraph
from custom_client import BinanceTradingClient

class Portfolio(ExampleStrategies):
def DP2(self, sl=400, tp=3000):
self.DP_2_strategy(tp=sl,
sl=tp)
self.inverse_strategy()

def DP2I(self, sl=400, tp=3000):
self.DP_2_strategy(tp=tp,
sl=sl)

def BB(self, window=80, dev=1):
self.strategy_bollinger_breakout(window=window,
window_dev=dev)

def SMA3(self, s=1500, m=400, f=60):
self.strategy_3_sma(fast=f,
slow=s,
mid=m)


timeframe = '15m'

figure = make_trader_figure(height=700, width=1400, row_heights=[1, 20, 1])
graph = TraderGraph(figure=figure)
client = BinanceTradingClient()

trader = Portfolio(interval=timeframe)

trader.connect_graph(graph)
trader.log_deposit()
trader.log_data()
trader.set_client(client)

config = {
'BTC/USDT': [
{'DP2': {}},
],
'ETH/USDT': [
{'DP2': {}},
],
'SOL/USDT': [
{'DP2': dict(sl=1000)},
{'DP2': dict(sl=700)},
]
}
trader.multi_backtest(test_config=config, deposit=300, commission=0.075)
3 changes: 3 additions & 0 deletions examples/dataframes/BNBBTC1h.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/dataframes/DASHUSDT15m.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/dataframes/DOTUSDT15m.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/dataframes/KAVAUSDT1d.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/dataframes/MATICUSDT15m.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/dataframes/OMGUSDT1d.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/dataframes/SOLBTC1h.csv
Git LFS file not shown
19 changes: 19 additions & 0 deletions examples/price_channel_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from quick_trade.trading_sys import ExampleStrategies
from quick_trade.plots import make_trader_figure, TraderGraph
from custom_client import BinanceTradingClient

ticker = 'SOL/BTC'
timeframe = '1h'

figure = make_trader_figure(height=600, width=900)
graph = TraderGraph(figure=figure)
client = BinanceTradingClient()

df = client.get_data_historical(ticker=ticker, interval=timeframe)

trader = ExampleStrategies(ticker=ticker, interval=timeframe, df=df)

trader.connect_graph(graph)

trader.strategy_price_channel(100, 100, 1)
trader.backtest(deposit=300, commission=0.075)
2 changes: 1 addition & 1 deletion examples/pump_detector_backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def get_data_historical(self,
test_config={ticker: config for ticker in tickers},
commission=0.1,
limit=100_000
)
)
Loading

0 comments on commit d7550bc

Please sign in to comment.