Skip to content

Bincentive/python-trader-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  1. Clone this project from the git repo.
  2. At project root, install this package by running
    $ pip install .

Usage

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 Client Methods

Bincentive Trader Client

bincentiveClient.set_position(self, strategy_id, Ratio, LimitPrice, timeout=None)

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)

Position ratio

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

About

Bincentive trader client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages