-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add first example that will place simple Smart Trade
- Loading branch information
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# Idea | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# trading-bot-example | ||
# trading-bot-example | ||
|
||
Simple example of own trading bot running on your computer or own cloud, using Cryptocurrencies.AI for more advanced execution | ||
|
||
### Installation | ||
|
||
``` | ||
$ git clone [email protected]:Cryptocurrencies-AI/trading-bot-example.git | ||
$ cd trading-bot | ||
$ pip3 install -r requirements.txt | ||
$ python3 trade.py | ||
``` | ||
|
||
### Deployment | ||
|
||
// todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ccai-client==0.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from ccai.client import Client | ||
|
||
def test_create_smart_order(): | ||
# create simple smart order that will entry by market and exit with 15% profit | ||
# or exit at 10% loss | ||
|
||
client = Client('SECRET', | ||
'KEYID') | ||
smart_order = { | ||
"marketType": 1, # 0 - spot, 1 - futures | ||
"pair": "BTC_USDT", | ||
"stopLoss": 10.0, # 7% loss | ||
"stopLossType": "market", # will place stop-limit or stop-market | ||
"leverage": 30, # leverage | ||
"entryOrder": { | ||
"side": "buy", | ||
"orderType": "limit", | ||
"price": 6300, | ||
"type": 0, # not using yet, just place 0 | ||
"amount": 0.001 # btc amount | ||
}, | ||
"exitLevels": [ | ||
{ | ||
"price": 15, # 15% profit | ||
"amount": 100, # 70% from entry | ||
"type": 1, # 1 - means amount and price is in percentage | ||
"orderType": "limit" | ||
} | ||
] | ||
} | ||
response = client.create_order(params=smart_order) | ||
print(response) | ||
|
||
def test_get_balances(): | ||
client = Client('SECRET', | ||
'KEID') | ||
response = client.get_balances() | ||
print(response) | ||
|
||
#test_create_smart_order() | ||
#test_get_balances() | ||
test_create_smart_order() |