- Clone this project from the git repo.
- At project root, install this package by running
$ pip install .
from bincentive_trader.client import TraderClient
email = 'me@example.com'
password = 'super secret'
client = TraderClient(email, password, False)Available client methods are listed in the Bincentive Client Methods section.
Each method has a timeout parameter that will cause a bincentive_trader.exceptions.Timeout
exception if no response is received in the specified seconds.
Bincentive Trader Client
Set a position ratio for a specific strategy to send the order
Kind: instance method of BincentiveClient
| Param | Type |
|---|---|
| strategy_id | number |
| Ratio | number |
| LimitPrice | number |
sample code
stgy_id = your_strategy_id
r = 0.3
order_id = client.set_position(strategy_id=stgy_id, Ratio=r, LimitPrice=1)ex:
1. If you want to open a long position with 30% of your account margin. -> r = 0.3
2. But things have changed, you decide to short a position by 20%. -> r = -0.2 (In fact, you short 50% of your margin in this step.)
3. The market is going the right way, you decide to close your position. -> r = 0