BTCTrader / broker-api-docs

The documentation for BTCTrader's white label exchange platform API. Use this documentation to access the APIs of BTCTurk other BTCTrader partners.
110 stars 32 forks source link

Alım ve Satım Post olarak neleri göndermem gerekiyor? #25

Closed kadirgunhiz closed 2 years ago

kadirgunhiz commented 6 years ago

Merhaba,

`function authPost($uri) { $url=$GLOBALS['baseURL'].$uri; $nonce=time(); $headers=array( 'X-PCK: '.$GLOBALS['APIKey'], 'X-Stamp: '.$nonce, 'X-Signature: '.$GLOBALS['signature'] );

        $post = "OrderMethod=1&OrderType=1";
        $ch=null;
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        $result=curl_exec($ch);
        curl_close($ch);
        return json_decode($result);
}`

Fonksiyonunu kullarak alış ve satış yapmaya çalışıyorum fakat alış ve satış yaparken hangi parametreleri göndermem gerekiyor ekstra, döküman üzerinden anlayamadım. Yardımcı olursanız sevinirim.

nepnesomao commented 6 years ago
curl_setopt($ch, CURLOPT_POSTFIELDS, 'OrderMethod=1&'.
                                              'OrderType=1&'.
                                              'total=1000&'.
                                              'totalPrecision=00&'.
                                              'amount='0'&'.
                                              'amountPrecision=01&'.
                                              'price='1000&'.
                                              'pricePrecision=00&'.
                                              'triggerPrice=0&'.
                                              'triggerPricePrecision=00&'.
                                              'DenominatorPrecision=2&'.    
                                              'PairSymbol=BTCTRY');

OrderType 0 Alım, 1 Satış, OrderMethod 0 = Limit, 1 = Market, 2 = Stop Limit ve 3 = Stop Market

Precision olarak geçen parametreler ise gireceğiniz fiyat/miktar da '.' dan sonrasıdır.

kadirgunhiz commented 6 years ago

Anlık kur üzerinden btc alacak isem; amount ve amountPrecision a alacağım BTC miktarını price ve pricePrecision miktarınıda anlık BTC kuruna göre yapmalıyım o halde değil mi ? AyrıcaOrderType 0 OrderMethod 1 olması gerekiyor?

nepnesomao commented 6 years ago

Örnek siz piyasa fiyatından 0.001 BTC almak istiyorsunuz, piyasa fiyatımız da 30,744.00 TL olsun. parametreler şöyle olmalı;

amount = 0,
amountPrecision = 001,
price = 30744,
pricePrecision = 00,
triggerPrice = 0,
triggerPricePrecision=00,
total = 30,
totalPrecision = 00
DenominatorPrecision = 2,
PairSymbol = BTCTRY,
OrderMethod = 1,
OrderType = 0,
kadirgunhiz commented 6 years ago

Anladım sağolun satarken de sadece satacağımız btc rakamını, btc kurunu, order type ı değiştirerek yapabilirim. Teşekkürler.