Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
VladKochetov007 committed Mar 16, 2022
1 parent 6dbc409 commit 8518b68
Show file tree
Hide file tree
Showing 26 changed files with 2,046 additions and 27 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ cd ..
```python
import quick_trade.trading_sys as qtr
from quick_trade import brokers
from quick_trade.plots import QuickTradeGraph, make_trader_figure
from quick_trade.plots import TraderGraph, make_trader_figure
import yfinance as yf
import ccxt
from quick_trade import strategy
Expand All @@ -73,7 +73,7 @@ class MyTrader(qtr.Trader):


a = MyTrader('MSFT/USD', df=yf.download('MSFT', start='2019-01-01'))
a.connect_graph(QuickTradeGraph(make_trader_figure()))
a.connect_graph(TraderGraph(make_trader_figure()))
a.set_client(brokers.TradingClient(ccxt.ftx()))
a.strategy_sell_and_hold()
a.backtest()
Expand Down Expand Up @@ -188,7 +188,7 @@ client = brokers.TradingClient(ccxt.binance())
df = client.get_data_historical('BTC/USDT', '15m', 1000)
trader = qtr.ExampleStrategies('BTC/USDT', df=df, interval='15m')
trader.set_client(client)
trader.connect_graph(QuickTradeGraph(make_trader_figure(height=731, width=1440, row_heights=[10, 5, 2])))
trader.connect_graph(TraderGraph(make_trader_figure(height=731, width=1440, row_heights=[10, 5, 2])))
trader.strategy_2_sma(55, 21)
trader.backtest(deposit=1000, commission=0.075, bet=inf) # backtest on one pair
```
Expand Down Expand Up @@ -220,7 +220,7 @@ Use the strategy on real moneys. YES, IT'S FULLY AUTOMATED!
import datetime
from quick_trade.trading_sys import ExampleStrategies
from quick_trade.brokers import TradingClient
from quick_trade.plots import QuickTradeGraph, make_figure
from quick_trade.plots import TraderGraph, make_figure
import ccxt

ticker = 'MATIC/USDT'
Expand Down Expand Up @@ -252,7 +252,7 @@ trader = MyTrade(ticker=ticker,
interval='1m',
df=client.get_data_historical(ticker, limit=10))
fig = make_trader_figure()
graph = QuickTradeGraph(figure=fig)
graph = TraderGraph(figure=fig)
trader.connect_graph(graph)
trader.set_client(client)

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/quick_trade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Code:
```python
# initializing a trader, connecting the exchange and the graph and using the strategy.
from quick_trade.brokers import TradingClient
from quick_trade.plots import QuickTradeGraph, make_trader_figure
from quick_trade.plots import TraderGraph, make_trader_figure
from ccxt import ftx

client = TradingClient(ftx())
Expand All @@ -125,7 +125,7 @@ trader = MyTrader(ticker='ETH/BTC',
interval='5m')

fig = make_trader_figure()
graph = QuickTradeGraph(figure=fig)
graph = TraderGraph(figure=fig)
trader.connect_graph(graph)
trader.set_client(client)

Expand Down Expand Up @@ -162,7 +162,7 @@ trader = MyTrader(ticker='ETH/BTC',
interval='5m')

fig = make_trader_figure()
graph = QuickTradeGraph(figure=fig)
graph = TraderGraph(figure=fig)
trader.connect_graph(graph)
trader.set_client(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/quick_trade/plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Method for creating standard figure for plotly.

### plot_candlestick

## QuickTradeGraph
## TraderGraph

### plot_deposit

Expand Down
10 changes: 5 additions & 5 deletions docs/docs/quick_trade/trading_sys.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ and `self.credit_leverages`.
from quick_trade.plots import *

fig = make_trader_figure()
graph = QuickTradeGraph(figure=fig)
graph = TraderGraph(figure=fig)
trader.connect_graph(graph)

# At this point, you need to use the strategy
Expand Down Expand Up @@ -195,7 +195,7 @@ trader = ExampleStrategies(ticker='ETH/BTC',
interval='5m')

fig = make_trader_figure()
graph = QuickTradeGraph(figure=fig)
graph = TraderGraph(figure=fig)
trader.connect_graph(graph)
trader.set_client(client)

Expand Down Expand Up @@ -240,13 +240,13 @@ The method sets the plotly figure for graphs

| param | type | description |
| :---: | :---: | :---: |
| graph | `plots.QuickTradeGraph` | QuickTradeGraph figure |
| graph | `plots.TraderGraph` | TraderGraph figure |

```python
from quick_trade.plots import QuickTradeGraph, make_trader_figure
from quick_trade.plots import TraderGraph, make_trader_figure

figure = make_trader_figure()
graph = QuickTradeGraph(figure=figure)
graph = TraderGraph(figure=figure)
```

```python
Expand Down
206 changes: 206 additions & 0 deletions examples/dataframes/ADAUSDT1w.csv

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions examples/dataframes/AVAXUSDT1w.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
timestamp,Open,High,Low,Close,Volume,close_time,quote_av,trades,tb_base_av,tb_quote_av,ignore
2020-09-21,0.85,7.0,0.85,4.6484,58371499.27,1601251199999.0,281624186.897005,787290.0,28938961.68,140247786.443616,0.0
2020-09-28,4.6485,4.705,3.6332,3.964,7819394.42,1601855999999.0,32119013.774294,117162.0,3841374.55,15783029.924699,0.0
2020-10-05,3.9582,4.3252,3.207,4.096,5273523.99,1602460799999.0,19993336.623441,81955.0,2552325.01,9680636.132629,0.0
2020-10-12,4.0841,4.71,3.8755,4.1195,3382640.13,1603065599999.0,14426057.054696,60607.0,1650557.71,7058955.51044,0.0
2020-10-19,4.1371,4.4904,3.6925,4.1479,2678477.67,1603670399999.0,11090864.932567,55364.0,1280327.36,5301970.733976,0.0
2020-10-26,4.1409,4.4897,3.5521,3.6814,3227322.57,1604275199999.0,12585861.362209,57891.0,1560040.82,6083590.403295,0.0
2020-11-02,3.6851,3.9193,3.0,3.4754,4384096.45,1604879999999.0,15162959.20502,73567.0,2027264.24,7020675.839264,0.0
2020-11-09,3.4674,3.82,3.2619,3.5453,3188143.31,1605484799999.0,11183518.138726,71399.0,1566535.53,5507317.557297,0.0
2020-11-16,3.5348,4.0983,3.455,3.8892,3843752.25,1606089599999.0,14543614.264998,104319.0,1882382.98,7129662.785267,0.0
2020-11-23,3.9066,4.3989,3.28,3.7013,4104069.28,1606694399999.0,15938089.925551,109161.0,2075746.69,8090485.551235,0.0
2020-11-30,3.7124,3.8966,3.4501,3.6055,1874903.84,1607299199999.0,6907906.960295,57906.0,896979.64,3310431.612199,0.0
2020-12-07,3.6036,3.6096,2.8001,3.3405,5915167.71,1607903999999.0,19093896.50655,161874.0,2772238.85,8942939.157497,0.0
2020-12-14,3.3401,3.6076,3.06,3.304,4800979.6,1608508799999.0,15840700.482986,106579.0,2383794.06,7867751.855074,0.0
2020-12-21,3.3041,3.6937,2.7501,2.9026,7014390.78,1609113599999.0,21728467.004379,126285.0,3642314.64,11321783.341126,0.0
2020-12-28,2.9168,3.939,2.78,3.4691,9642998.09,1609718399999.0,32221573.346231,178476.0,4977868.0,16653135.029372,0.0
2021-01-04,3.477,7.4969,3.2283,6.5416,17006266.14,1610323199999.0,89378418.062948,395801.0,8987447.73,47445064.830607,0.0
2021-01-11,6.541,14.69,5.72,13.1746,18924390.58,1610927999999.0,185345171.940902,566412.0,9832166.03,96491349.590474,0.0
2021-01-18,13.1748,14.0,10.673,12.4801,10772636.78,1611532799999.0,134076022.029037,427008.0,5407810.15,67443538.119879,0.0
2021-01-25,12.4801,15.3728,10.77,13.4704,10930555.36,1612137599999.0,138744438.009411,434411.0,5689943.46,72435673.511963,0.0
2021-02-01,13.4704,24.4268,12.5741,23.705,13573217.32,1612742399999.0,235905325.725498,595733.0,7007089.38,122237481.41422,0.0
2021-02-08,23.7374,60.3035,23.55,39.1711,30396330.19,1613347199999.0,1295673705.033966,2153468.0,15457242.0,657774741.563246,0.0
2021-02-15,39.17,44.98,31.9376,36.1855,19629075.32,1613951999999.0,759082960.43241,1456015.0,10030992.0,388417090.21011,0.0
2021-02-22,36.1932,36.2941,22.1237,23.9566,17605227.46,1614556799999.0,496630673.977578,1028244.0,9013828.73,254153128.790645,0.0
2021-03-01,23.9698,31.99,23.5269,26.6863,20265528.54,1615161599999.0,543342483.96306,1056898.0,10578449.5,283602750.722287,0.0
2021-03-08,26.6884,35.8,23.4102,28.8423,37978290.32,1615766399999.0,1135976405.128442,1920945.0,19282713.07,577606401.248375,0.0
2021-03-15,28.8383,39.3,27.0,32.8117,24562621.59,1616371199999.0,812081405.865332,1477110.0,12545188.35,415338914.915606,0.0
2021-03-22,32.8109,33.5892,24.3291,28.7167,16501857.3,1616975999999.0,471422821.191495,1000502.0,8254425.87,235835960.852369,0.0
2021-03-29,28.7392,32.8727,25.9,29.1573,14560119.67,1617580799999.0,429652782.889894,913290.0,7304353.66,215783949.926327,0.0
2021-04-05,29.174,34.5578,28.5455,31.5976,19927925.44,1618185599999.0,631165901.309759,1310610.0,10200803.51,323481251.875953,0.0
2021-04-12,31.5853,40.759,22.5473,29.3348,31472040.61,1618790399999.0,1079614673.745472,1965563.0,15592702.22,536174068.212032,0.0
2021-04-19,29.323,30.5796,19.8,21.624,21630837.915,1619395199999.0,540264751.459856,1050688.0,10616489.169,265792063.092106,0.0
2021-04-26,21.628,35.68,21.39,31.28,19332994.633,1619999999999.0,566607366.349202,1077314.0,9916885.471,290661970.639361,0.0
2021-05-03,31.262,43.885,29.501,38.969,31033635.578,1620604799999.0,1128228076.3357122,1996015.0,15631644.011,569538001.3734992,0.0
2021-05-10,38.988,41.8,29.69,36.6,29969986.361,1621209599999.0,1088805947.718195,1925096.0,14993205.788,545706356.184229,0.0
2021-05-17,36.597,38.535,12.086,15.606,32851010.122,1621814399999.0,858178500.753561,1735583.0,15831303.429,417185923.03304,0.0
2021-05-24,15.603,21.453,15.034,16.518,16934108.79,1622419199999.0,311512034.977252,781613.0,8771883.358,161698945.727606,0.0
2021-05-31,16.504,20.7,15.671,17.383,10152981.774,1623023999999.0,186191875.603505,438394.0,5015849.549,92086855.757783,0.0
2021-06-07,17.38,18.053,12.638,14.761,15994070.796,1623628799999.0,236718209.922663,535165.0,8221896.385,121814524.124401,0.0
2021-06-14,14.762,15.632,12.783,13.917,10644825.016,1624233599999.0,154226966.126861,358202.0,5323655.415,77229678.081032,0.0
2021-06-21,13.914,14.069,9.325,10.941,12064247.984,1624838399999.0,133554867.443701,361495.0,6117077.609,67751997.336815,0.0
2021-06-28,10.953,12.9,10.572,12.345,7344001.671,1625443199999.0,84771840.792176,224801.0,3713478.56,42901611.441003,0.0
2021-07-05,12.342,14.226,11.519,12.433,9986801.087,1626047999999.0,127805479.943482,337252.0,4936817.435,63199763.607721,0.0
2021-07-12,12.437,12.841,10.65,10.69,5885185.049,1626652799999.0,68449308.148525,193362.0,2893036.083,33693036.564622,0.0
2021-07-19,10.69,11.447,9.327,11.247,5408511.085,1627257599999.0,57062083.269893,196789.0,2716537.969,28698907.676608,0.0
2021-07-26,11.247,14.077,11.175,12.853,10861897.635,1627862399999.0,135888004.328728,384357.0,5624307.713,70444941.81283,0.0
2021-08-02,12.846,16.1,12.325,14.826,10519615.802,1628467199999.0,148279066.452956,395602.0,5269389.892,74304916.784128,0.0
2021-08-09,14.83,18.855,14.424,18.762,12552778.979,1629071999999.0,211632628.909058,537988.0,6350048.382,107090540.051169,0.0
2021-08-16,18.762,50.27,18.418,43.663,68969134.056,1629676799999.0,2274905351.668398,4710782.0,35394560.247,1170600136.981342,0.0
2021-08-23,43.682,58.977,40.3,47.39,68638169.02,1630281599999.0,3320994311.125199,5365074.0,34527206.407,1669318689.70892,0.0
2021-08-30,47.43,51.66,38.17,48.15,49064752.093,1630886399999.0,2213208876.585076,3949972.0,24669137.924,1113010355.453742,0.0
2021-09-06,48.14,64.9,32.23,59.22,88087280.996,1631491199999.0,4216894889.564413,7736641.0,44171823.67,2118985156.767462,0.0
2021-09-13,59.21,76.27,47.66,70.07,78073244.328,1632095999999.0,4806198382.91238,7685197.0,39320431.303,2424543390.47306,0.0
2021-09-20,70.06,79.8,52.55,66.77,78562443.41,1632700799999.0,5233477651.979167,7390667.0,39342875.953,2622289333.354607,0.0
2021-09-27,66.77,73.41,61.11,68.69,40583814.39,1633305599999.0,2735166120.9478,4179362.0,20613122.14,1389131421.7769,0.0
2021-10-04,68.69,68.76,55.39,56.51,27382161.69,1633910399999.0,1708903118.0874,2870885.0,13402508.35,836436940.1633,0.0
2021-10-11,56.5,62.11,51.04,56.1,23123012.98,1634515199999.0,1297819550.7787,2101183.0,11442216.82,642273249.683,0.0
2021-10-18,56.11,69.18,54.05,64.53,20779518.36,1635119999999.0,1296410853.1195,2638488.0,10323684.49,644203418.362,0.0
2021-10-25,64.53,73.01,57.02,64.5,17396408.49,1635724799999.0,1138845000.3505,2325728.0,8730195.61,571832909.1754,0.0
2021-11-01,64.5,88.88,62.19,87.57,22389240.571,1636329599999.0,1687056170.319278,4318375.0,11615114.657,877354424.947228,0.0
2021-11-08,87.56,99.9,78.31,95.4,25371399.668,1636934399999.0,2298474806.446755,5400663.0,12838113.994,1163916530.128115,0.0
2021-11-15,95.4,147.0,83.5,128.47,39385128.983,1637539199999.0,4306969481.273169,9949798.0,20260068.104,2222955106.196089,0.0
2021-11-22,128.52,145.0,100.57,110.42,30816578.94,1638143999999.0,3737498357.8834,7597632.0,15523472.8,1881591744.7153,0.0
2021-11-29,110.42,127.41,76.57,86.35,25271961.91,1638748799999.0,2668362784.6568,5386133.0,12654411.74,1336479399.0851,0.0
2021-12-06,86.34,96.62,77.0,88.0,19830099.67,1639353599999.0,1731586288.8486,3145382.0,9987803.09,873417814.9218,0.0
2021-12-13,88.01,117.39,75.5,107.61,29757733.51,1639958399999.0,2956624178.8364,5587582.0,14943360.56,1484508432.6344,0.0
2021-12-20,107.61,127.32,100.96,115.02,19338064.18,1640563199999.0,2246320884.2908,4316511.0,9718594.04,1129517684.9793,0.0
2021-12-27,115.06,120.96,98.25,113.03,13275394.01,1641167999999.0,1451420203.744,3049667.0,6644287.61,726804791.1193,0.0
2022-01-03,113.02,114.13,79.18,89.33,13955032.11,1641772799999.0,1323131167.212,2603743.0,6977633.61,661196432.7744,0.0
2022-01-10,89.32,97.26,80.1,92.24,10536559.2,1642377599999.0,946166938.6227,1893380.0,5331453.09,479137231.6731,0.0
2022-01-17,92.25,92.5,52.95,64.83,16162585.54,1642982399999.0,1139479705.6044,2190885.0,8185065.31,577573550.1167,0.0
2022-01-24,64.8,73.58,55.14,67.96,17084448.87,1643587199999.0,1117208282.7292,2201641.0,8741607.32,572015899.3402,0.0
2022-01-31,67.94,80.93,64.25,78.93,12807062.07,1644191999999.0,919661309.3188,1692170.0,6472719.19,464854347.955,0.0
2022-02-07,78.91,95.5,77.44,77.91,17318967.91,1644796799999.0,1497344831.7795,2924037.0,8634229.66,746969982.1145,0.0
2022-02-14,77.93,98.77,76.14,77.37,15688659.81,1645401599999.0,1371966498.3828,2725018.0,7766913.68,679650580.5539,0.0
2022-02-21,77.34,84.95,64.45,75.07,27942205.69,1646006399999.0,2099689939.8595,3362756.0,13986794.17,1051209631.1783,0.0
2022-02-28,75.06,90.8,71.76,72.51,22215647.42,1646611199999.0,1797679387.6318,2807205.0,10989801.92,890527079.4918,0.0
2022-03-07,72.51,80.44,67.21,67.94,16911453.27,1647215999999.0,1251579320.523,1831176.0,8369417.2,619735728.4802,0.0
2022-03-14,67.92,74.72,65.55,73.54,7797422.78,1647820799999.0,540766225.5867,849071.0,3861116.36,267717755.2214,0.0
Loading

0 comments on commit 8518b68

Please sign in to comment.