mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 23:16:53 +00:00
* Add initial workflows config * Add PSQL service * Add 32bit and frontend jobs * Add gcc-multilib and fix typo * Fix backtester test for linux/unix filesystem errors and npm commands * 32-bit Add -race to purposefully throw an error to ensure envs are set correctly (will revert) * Revert "32-bit Add -race to purposefully throw an error to ensure envs are set correctly (will revert)" This reverts commit b97e66c49fca859f8738e01107f96f9ca4040b2e. * Bump workers count for orderbook processing * Remove comments to trigger 32-bit cache hit after job success * Cancel addition plus version bump, spawn more overlords * Update build badge to Github Actions * Brach -> Branch
35 lines
771 B
Go
35 lines
771 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/okex"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
|
|
)
|
|
|
|
func main() {
|
|
var o okex.OKEX
|
|
o.SetDefaults()
|
|
|
|
o.API.Credentials.Key = "your_key"
|
|
o.API.Credentials.Secret = "your_secret"
|
|
o.API.Credentials.ClientID = "your_clientid"
|
|
|
|
ord := &order.Submit{
|
|
Pair: currency.NewPair(currency.BTC, currency.USDT),
|
|
Side: order.Buy,
|
|
Type: order.Limit,
|
|
Price: 50000,
|
|
Amount: 0.1,
|
|
AssetType: asset.Spot,
|
|
}
|
|
resp, err := o.SubmitOrder(ord)
|
|
if err != nil {
|
|
log.Printf("Unable to place order: %s", err)
|
|
}
|
|
fmt.Println(resp.OrderID)
|
|
}
|