Comments (6)
huh... now it works...
I got a 'order would trigger immediately' earlier when I tried...
Anyway, this now works like a charm 👍
$api->buy('NULSBTC', 20, 0.00018500, "STOP_LOSS_LIMIT", [ "stopPrice" => 0.00019000 ]);
Creates a stop-limit buy order for 20 NULS when the price goes above 19000 sats and from that moment on tries to buy it for 18500 sats.
Thanks for your reply and overall very handy library jaggedsoft!!
from php-binance-api.
None!
They are SELL orders. If you want to buy, use BUY LIMIT or BUY MARKET order.
Here is what I would do
$price = current market price;
if $price >= '8510';
then do a BUY LIMIT/MARKET order;
from php-binance-api.
Thanks 0dark0 for helping 👍
Yes, all you need is to place a 'limit' buy order for 8510.
A stop_loss_limit will sell something you own if the price drops below a certain point
A take_profit_limit will sell something you own if the price goes above a certain point
from php-binance-api.
Sorry to open this one up, but the answer has not really been given.
Although 'placing a limit buy when price >= x' sounds nice, it's not the automatic method like 'STOP_LOSS_LIMIT' is.
If I have a script which monitors every 5 minutes and places stop-limit markers for both BUY and SELL, you need a functionality such as 'STOP_LOSS_LIMIT' but for BUY.
If you look at the binance interface, these 'stop-limits' for buy can be placed there. Just haven't found a way to do those through the API / this lib.
Hope you can help!
from php-binance-api.
@RacingStatistics Hi there, most things that you can do from the binance interface are supported by this library.
$flags = ['stopPrice' => 7444.77, 'newOrderRespType' => 'FULL'];
$amount = 0.002;
$order = $api->order('SELL', 'BTCUSDT', $amount, 0, 'STOP_LOSS_LIMIT', $flags);
Just reverse the logic for buying.
Binance does not allow both a BUY and a SELL stoploss at the same time though.
from php-binance-api.
Hi @jaggedsoft
I am sorry to open this again, but I cannot understand how you create a STOP_LOSS_LIMIT sell order with a price of 0.
$flags = ['stopPrice' => 7444.77, 'newOrderRespType' => 'FULL']; $amount = 0.002; $order = $api->order('SELL', 'BTCUSDT', $amount, 0, 'STOP_LOSS_LIMIT', $flags);
I tried, but it just throws and "Invalid price" exception.
from php-binance-api.
Related Issues (20)
- The problem of buying a large number of wallets HOT 1
- Too much request weight used; current limit is 1200 request weight per 1 MINUTE.
- Spot Order with all the balance
- I need to use this API in laravel
- signedRequest error: API Key not set!
- How to hide warning of config file
- I have a problem MIN_NOTIONAL HOT 2
- How do I know if someone's API is correct or not?
- how to solve Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) HOT 1
- How to create User Data Stream for multiple binance accounts using php-binance-api HOT 2
- php8.1 Call to undefined function GuzzleHttp\Psr7\uri_for() HOT 2
- Can this be used to build a website like binance.com?
- How to get depthCache information without using WebSocket, is that possible?
- bug: Signature for this request is not valid.
- websockets are not working HOT 1
- CURL ERROR
- Curl error: SSL: no alternative certificate subject name matches target host name 'api.binance.com'
- Undefined array key "minQty" HOT 1
- FIXED minQty filter
- The websocket does not show. This is mistake?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-binance-api.