Skip to content

Commit

Permalink
Update version, README and example.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
forkcs committed May 8, 2020
1 parent 4c354b9 commit 63ba9af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ supervisor.position = 150
Create order:

```python
from decimal import Decimal
from supervisor.core.orders import Order

my_order = Order(order_type='Limit', qty=100, side='Buy', price=Decimal(6500), hidden=True, passive=True)
my_order = Order(order_type='Limit', qty=100, side='Buy', price=6500, hidden=True, passive=True)

supervisor.add_order(my_order)
```
Expand All @@ -133,7 +132,7 @@ You can attach any callback to order events.
Callback must retrieve *args and **kwargs attributes.

```python
order_with_callback = Order(order_type='Limit', qty=100, side='Buy', price=Decimal(6500))
order_with_callback = Order(order_type='Limit', qty=100, side='Buy', price=6500)

# for example, let's attach callback to order fill event
def callback(*args, **kwargs):
Expand Down
8 changes: 3 additions & 5 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from decimal import Decimal

from supervisor.core.interface import Exchange
from supervisor.core.orders import Order
from supervisor import Supervisor
Expand All @@ -14,9 +12,9 @@
supervisor = Supervisor(interface=exchange)

# create Order objects
stop_loss = Order(order_type='Stop', stop_px=Decimal(2000), qty=10, side='Sell')
tp1 = Order(order_type='Limit', price=Decimal(15000), qty=6, side='Sell', passive=True, reduce_only=True)
tp2 = Order(order_type='Limit', price=Decimal(20000), qty=4, side='Sell', hidden=True)
stop_loss = Order(order_type='Stop', stop_px=2000, qty=10, side='Sell')
tp1 = Order(order_type='Limit', price=15000, qty=6, side='Sell', passive=True, reduce_only=True)
tp2 = Order(order_type='Limit', price=20000, qty=4, side='Sell', hidden=True)

# set needed position price
supervisor.position_size = 10
Expand Down
2 changes: 1 addition & 1 deletion supervisor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from supervisor._supervisor import *

__version__ = '0.4.1'
__version__ = '0.4.2'

0 comments on commit 63ba9af

Please sign in to comment.