Skip to content

Commit

Permalink
Roll Back Update + Improvements
Browse files Browse the repository at this point in the history
Some improvements to the import structure since I have changed where the modules are located. 

Also rolled back Ed's most recent commit as it broke market orders on Bitmex for me.
  • Loading branch information
Dave-Vallance committed Aug 5, 2018
1 parent 1dc6e07 commit 6039e82
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Empty file removed bt-ccxt/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions ccxtbt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .ccxtbroker import *
from .ccxtfeed import *
from .ccxtstore import *
6 changes: 3 additions & 3 deletions bt-ccxt/ccxtbroker.py → ccxtbt/ccxtbroker.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
from backtrader.position import Position
from backtrader import BrokerBase, OrderBase, Order
from backtrader.utils.py3 import queue
from backtrader.stores.ccxtstore import CCXTStore
from .ccxtstore import CCXTStore

class CCXTOrder(OrderBase):
def __init__(self, owner, data, ccxt_order):
self.owner = owner
self.data = data
self.ccxt_order = ccxt_order
self.ordtype = self.Buy if ccxt_order['info']['side'] == 'buy' else self.Sell
self.size = float(ccxt_order['info']['original_amount']
self.ordtype = self.Buy if ccxt_order['side'] == 'buy' else self.Sell
self.size = float(ccxt_order['amount'])

super(CCXTOrder, self).__init__()

Expand Down
4 changes: 2 additions & 2 deletions bt-ccxt/ccxtfeed.py → ccxtbt/ccxtfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
from datetime import datetime
import backtrader as bt
from backtrader.feed import DataBase
from backtrader.stores.ccxtstore import CCXTStore
from .ccxtstore import CCXTStore
import time

class CCXT(DataBase):
class CCXTFeed(DataBase):
"""
CryptoCurrency eXchange Trading Library Data Feed.
Params:
Expand Down
File renamed without changes.

0 comments on commit 6039e82

Please sign in to comment.