Closed itsikg closed 3 years ago
Thank you for opening this issue, I'll test on my side and keep you updated.
I tried the same command and it seems to work fine on my side.
2021-08-03 11:01:32:debug:exchanges|BinanceFutures - ETH/USDT ticker successfully fetched. -> {"symbol":"ETH/USDT","timestamp":1627981291483,"datetime":"2021-08-03T09:01:31.483Z","high":2666.91,"low":2441,"vwap":2571.33,"open":2574.54,"close":2481,"last":2481,"change":-93.54,"percentage":-3.633,"baseVolume":4034721.247,"quoteVolume":10374617202.96,"info":{"symbol":"ETHUSDT","priceChange":"-93.54","priceChangePercent":"-3.633","weightedAvgPrice":"2571.33","lastPrice":"2481.00","lastQty":"3.000","openPrice":"2574.54","highPrice":"2666.91","lowPrice":"2441.00","volume":"4034721.247","quoteVolume":"10374617202.96","openTime":"1627894860000","closeTime":"1627981291483","firstId":"902161797","lastId":"906283309","count":"4121301"}} 2021-08-03 11:01:32:debug:trading|Calculated 0.008061265618702136 ETH/USDT equivalent for 20 $US. 2021-08-03 11:01:32:info:trading|BinanceFutures/BINAF - ^^^ Opening long position / buying ETH/USDT (~ 20.00 $US).
If you've just created your API key please ensure that you have checked the Enable Futures option under Binance > Dashboard > Settings > API Management.
I tried the same command and it seems to work fine on my side.
2021-08-03 11:01:32:debug:exchanges|BinanceFutures - ETH/USDT ticker successfully fetched. -> {"symbol":"ETH/USDT","timestamp":1627981291483,"datetime":"2021-08-03T09:01:31.483Z","high":2666.91,"low":2441,"vwap":2571.33,"open":2574.54,"close":2481,"last":2481,"change":-93.54,"percentage":-3.633,"baseVolume":4034721.247,"quoteVolume":10374617202.96,"info":{"symbol":"ETHUSDT","priceChange":"-93.54","priceChangePercent":"-3.633","weightedAvgPrice":"2571.33","lastPrice":"2481.00","lastQty":"3.000","openPrice":"2574.54","highPrice":"2666.91","lowPrice":"2441.00","volume":"4034721.247","quoteVolume":"10374617202.96","openTime":"1627894860000","closeTime":"1627981291483","firstId":"902161797","lastId":"906283309","count":"4121301"}} 2021-08-03 11:01:32:debug:trading|Calculated 0.008061265618702136 ETH/USDT equivalent for 20 $US. 2021-08-03 11:01:32:info:trading|BinanceFutures/BINAF - ^^^ Opening long position / buying ETH/USDT (~ 20.00 $US).
If you've just created your API key please ensure that you have checked the Enable Futures option under Binance > Dashboard > Settings > API Management.
It's this only work with ETH? or All pairs in the exchange what do you mean only work work USD you mean in Uniated State binance?
I provided this example with ETH because this is the pair @itsikg used in the command.
Trading works for all USD based markets, this means that you can trade as many pairs you want as long as the quote is USDT, BUSD or USD itself for both perpetuals / futures or spot trading.
For now I've just not implemented trading for Coin based markets yet like ETH/BTC, LINK/BTC and so on, price conversion is different for those since you're providing a size in dollars in your requests and the exchange need another format.
I tried the same command and it seems to work fine on my side.
2021-08-03 11:01:32:debug:exchanges|BinanceFutures - ETH/USDT ticker successfully fetched. -> {"symbol":"ETH/USDT","timestamp":1627981291483,"datetime":"2021-08-03T09:01:31.483Z","high":2666.91,"low":2441,"vwap":2571.33,"open":2574.54,"close":2481,"last":2481,"change":-93.54,"percentage":-3.633,"baseVolume":4034721.247,"quoteVolume":10374617202.96,"info":{"symbol":"ETHUSDT","priceChange":"-93.54","priceChangePercent":"-3.633","weightedAvgPrice":"2571.33","lastPrice":"2481.00","lastQty":"3.000","openPrice":"2574.54","highPrice":"2666.91","lowPrice":"2441.00","volume":"4034721.247","quoteVolume":"10374617202.96","openTime":"1627894860000","closeTime":"1627981291483","firstId":"902161797","lastId":"906283309","count":"4121301"}} 2021-08-03 11:01:32:debug:trading|Calculated 0.008061265618702136 ETH/USDT equivalent for 20 $US. 2021-08-03 11:01:32:info:trading|BinanceFutures/BINAF - ^^^ Opening long position / buying ETH/USDT (~ 20.00 $US).
If you've just created your API key please ensure that you have checked the Enable Futures option under Binance > Dashboard > Settings > API Management.
Hey, thanks for checking this out. I re-checked my API settings and it is enabled for trading Futures (see screenshot). If it's not a step-size issue than I'm puzzled what can cause this command to fail.
Not works for me i try as per your documention but not working haveing faild error on CURL testing.
Not works for me i try as per your documention but not working haveing faild error on CURL testing.
That's actually a simple one :) You created an account called MAIN, but the order was issued to account TEST which does not exist. Simply replace "stub":"TEST" with "stub":"MAIN" on your order command.
Not works for me i try as per your documention but not working haveing faild error on CURL testing.
I see multiple issues here :
Try to avoid posting your keys or all sensitive informations like ip addresses.
I tried the same command and it seems to work fine on my side.
2021-08-03 11:01:32:debug:exchanges|BinanceFutures - ETH/USDT ticker successfully fetched. -> {"symbol":"ETH/USDT","timestamp":1627981291483,"datetime":"2021-08-03T09:01:31.483Z","high":2666.91,"low":2441,"vwap":2571.33,"open":2574.54,"close":2481,"last":2481,"change":-93.54,"percentage":-3.633,"baseVolume":4034721.247,"quoteVolume":10374617202.96,"info":{"symbol":"ETHUSDT","priceChange":"-93.54","priceChangePercent":"-3.633","weightedAvgPrice":"2571.33","lastPrice":"2481.00","lastQty":"3.000","openPrice":"2574.54","highPrice":"2666.91","lowPrice":"2441.00","volume":"4034721.247","quoteVolume":"10374617202.96","openTime":"1627894860000","closeTime":"1627981291483","firstId":"902161797","lastId":"906283309","count":"4121301"}} 2021-08-03 11:01:32:debug:trading|Calculated 0.008061265618702136 ETH/USDT equivalent for 20 $US. 2021-08-03 11:01:32:info:trading|BinanceFutures/BINAF - ^^^ Opening long position / buying ETH/USDT (~ 20.00 $US).
If you've just created your API key please ensure that you have checked the Enable Futures option under Binance > Dashboard > Settings > API Management.
Hey, thanks for checking this out. I re-checked my API settings and it is enabled for trading Futures (see screenshot). If it's not a step-size issue than I'm puzzled what can cause this command to fail.
You can check your debugging logs while you're logged into your instance with this command :
cat ./docker/logs/debug.log
Have you tried trading other pairs ? Removing and adding back the account ? Do you have any limitation in your configuration ? (balance, leverage, margin)
If you really want to use this tool I can give you faster support on Discord, you can reach me here : thibaultyou#0885 and also on the Jackrabbit Discord server where there's a lot of strategies to mix with this tool.
Should be fixed here, this was probably due to the position structure update made by Binance on Futures.
Please update you tool with the following command :
sudo docker-compose stop && sudo docker-compose pull && sudo docker-compose up -d
Running it using docker on Ubunto server. When launching command using CURL:
curl -d '{"stub": "MAIN", "symbol": "ETH/USDT", "size": "20", "direction": "long" }' -X POST http://MYIPADDRESS/trades -H 'Content-Type: application/json; charset=utf-8'
Getting the following error on debug log:
{"message":"exchanges|BinanceFutures - ETH/USDT ticker successfully fetched. -> {\"symbol\":\"ETH/USDT\",\"timestamp\":1627931284759,\"datetime\":\"2021-08-02T19:08:04.759Z\",\"high\":2699,\"low\":2506.11,\"vwap\":2602.7,\"open\":2592.1,\"close\":2662.24,\"last\":2662.24,\"change\":70.14,\"percentage\":2.706,\"baseVolume\":4477545.437,\"quoteVolume\":11653695521.96,\"info\":{\"symbol\":\"ETHUSDT\",\"priceChange\":\"70.14\",\"priceChangePercent\":\"2.706\",\"weightedAvgPrice\":\"2602.70\",\"lastPrice\":\"2662.24\",\"lastQty\":\"0.246\",\"openPrice\":\"2592.10\",\"highPrice\":\"2699.00\",\"lowPrice\":\"2506.11\",\"volume\":\"4477545.437\",\"quoteVolume\":\"11653695521.96\",\"openTime\":\"1627844880000\",\"closeTime\":\"1627931284759\",\"firstId\":\"899416357\",\"lastId\":\"903834469\",\"count\":\"4418010\"}}","level":"debug","timestamp":"2021-08-02T19:08:06.170Z"} {"message":"trading|Calculated 0.0075124707013642655 ETH/USDT equivalent for 20 $US.","level":"debug","timestamp":"2021-08-02T19:08:06.171Z"} {"details":{"name":"ExchangeError"},"level":"error","message":"trading|BinanceFutures/MAIN - Failed to open buy position on ETH/USDT.","timestamp":"2021-08-02T19:08:06.685Z"}
My guess is the trade value cannot contain more than 3 digits after the decimal point (for ETH). It has to be rounded according to the "step size" specific to the symbol.