Skip to content

Commit

Permalink
Update README.md, example.py and version.
Browse files Browse the repository at this point in the history
  • Loading branch information
forkcs committed May 11, 2020
1 parent ac6a809 commit 618cc1b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

This is a library-like application, which operates with orders and positions on your account.

*Current version:* **0.5.2**
*Current version:* **0.5.3**
#### Features:
* Creating an cancelling orders on your account. Stop-loss, Limit, passive, reduce-only, close-only, hidden orders supported.
* Preventing these orders for being lost, cancelled or rejected: Supervisor will place them anew.
* Supervisor closes all orders, which are not supervised.
* When the supervised order has been filled, Supervisor will not try to place it.
* Put callbacks on supervised orders, which are called when order has been filled, partially executed or cancelled.
* Set and maintain the position size.
#### In develop:
* Various market-price or limit entries in position.
#### In develop:
* Enter position with rebate by tracking last market price and moving limit order up.

## Getting Started
Expand Down Expand Up @@ -117,6 +117,14 @@ Set necessary position size, Supervisor will fix it:
supervisor.position = 150
```

If Supervisor is already running, you can use on of provided entry methods

```python
supervisor.stop_cycle()
supervisor.enter_by_market_order(150)
supervisor.run_cycle()
```

Create order:

```python
Expand Down
9 changes: 5 additions & 4 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@

# create Order objects
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)
tp1 = Order(order_type='Limit', price=15000, qty=6, side='Sell', passive=True)
tp2 = Order(order_type='Limit', price=20000, qty=4, side='Sell', hidden=True)

# set needed position price
supervisor.position_size = 10

# attach some callbacks to stop-loss, note that events starts with "_"
# DO NOT USE stop_cycle() method into callbacks!!! It causes the deadlock
stop_loss._on_reject = lambda: print('Rejected')
Expand All @@ -35,5 +32,9 @@
supervisor.add_order(stop_loss)
supervisor.add_order(tp1)
supervisor.add_order(tp2)
input('Enter to enter position')
supervisor.stop_cycle()
supervisor.enter_by_market_order(10)
supervisor.run_cycle()
input('Enter to exit cycle')
supervisor.exit_cycle()
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.5.2'
__version__ = '0.5.3'

0 comments on commit 618cc1b

Please sign in to comment.