tf-redfree / PHP-btce-api

BTC-e API Class
MIT License
44 stars 41 forks source link

What is the bets way to get the respons of a buy/sell #1

Closed Wilcodejongh closed 10 years ago

Wilcodejongh commented 10 years ago

i want to try your code but i see tah you use $btc_usd['fee'] = $BTCeAPI->getPairFee('btc_usd');

then i get a arry back but is this the same on a buy/sell $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100); so i know that it whas buyed/selled?

Can you help me. Thanks

tf-redfree commented 10 years ago

Hello,

The function call for $BTCeAPI->getPairFee('btc_usd'); will retrieve the fee imposed by btc-e. For btc_usd at the moment this is 0.2%.

The call to: $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100);

will buy a bitcoin for 100 USD. If you wish to sell you would need to use BTCeAPI::DIRECTION_SELL. $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_SELL, 100);

When this is executed you will get a response from btc-e's API. This will be in a form that PHP can understand as opposed to the JSON which is returned from the API. You can look at this response to determine if the buy/sell went onto the exchange. If the request was invalid, an exception will be thrown instead.

Hope this helps, Tony

On Tue, Mar 18, 2014 at 7:17 PM, Wilcodejongh notifications@github.comwrote:

i want to try your code but i see tah you use $btc_usd['fee'] = $BTCeAPI->getPairFee('btc_usd');

then i get a arry back but is this the same on a buy/sell $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100); so i know that it whas buyed/selled?

Can you help me. Thanks

Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1 .

Wilcodejongh commented 10 years ago

Thanks I will try it.

Als er vragen zijn dan hoor ik het graag.

Met vriendelijke groet,

Wilco de Jongh

Van: Anthony Free notifications@github.com Beantwoorden - Aan: marinu666/PHP-btce-api <reply+i-29675863-1f14525878ae7481a4219d0beba7e6620eead356-4491076@reply.git hub.com> Datum: dinsdag 18 maart 2014 22:19 Aan: marinu666/PHP-btce-api PHP-btce-api@noreply.github.com CC: wilco wilco@softlink.nl Onderwerp: Re: [PHP-btce-api] What is the bets way to get the respons of a buy/sell (#1)

Hello,

The function call for $BTCeAPI->getPairFee('btc_usd'); will retrieve the fee imposed by btc-e. For btc_usd at the moment this is 0.2%.

The call to: $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100);

will buy a bitcoin for 100 USD. If you wish to sell you would need to use BTCeAPI::DIRECTION_SELL. $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_SELL, 100);

When this is executed you will get a response from btc-e's API. This will be in a form that PHP can understand as opposed to the JSON which is returned from the API. You can look at this response to determine if the buy/sell went onto the exchange. If the request was invalid, an exception will be thrown instead.

Hope this helps, Tony

On Tue, Mar 18, 2014 at 7:17 PM, Wilcodejongh notifications@github.comwrote:

i want to try your code but i see tah you use $btc_usd['fee'] = $BTCeAPI->getPairFee('btc_usd');

then i get a arry back but is this the same on a buy/sell $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100); so i know that it whas buyed/selled?

Can you help me. Thanks

Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1 .

‹ Reply to this email directly or view it on GitHub https://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-37989893 .

Wilcodejongh commented 10 years ago

Tony,

If I try try { $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, 430); } catch(BTCeAPIInvalidParameterException $e) { echo $e->getMessage(); } catch(BTCeAPIException $e) { echo $e->getMessage(); }

I don¹t get a message back.

If I use
try { $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, $aankoop); } catch(BTCeAPIInvalidParameterException $e) { echo $e->getMessage(); } catch(BTCeAPIException $e) { echo $e->getMessage(); }

And I don¹t fill in the $aankoop then I get a error back.

Can I get a message if its a good buy action?

Or do I have something wrong?

Van: Anthony Free notifications@github.com Beantwoorden - Aan: marinu666/PHP-btce-api <reply+i-29675863-1f14525878ae7481a4219d0beba7e6620eead356-4491076@reply.git hub.com> Datum: dinsdag 18 maart 2014 22:19 Aan: marinu666/PHP-btce-api PHP-btce-api@noreply.github.com CC: wilco wilco@softlink.nl Onderwerp: Re: [PHP-btce-api] What is the bets way to get the respons of a buy/sell (#1)

Hello,

The function call for $BTCeAPI->getPairFee('btc_usd'); will retrieve the fee imposed by btc-e. For btc_usd at the moment this is 0.2%.

The call to: $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100);

will buy a bitcoin for 100 USD. If you wish to sell you would need to use BTCeAPI::DIRECTION_SELL. $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_SELL, 100);

When this is executed you will get a response from btc-e's API. This will be in a form that PHP can understand as opposed to the JSON which is returned from the API. You can look at this response to determine if the buy/sell went onto the exchange. If the request was invalid, an exception will be thrown instead.

Hope this helps, Tony

On Tue, Mar 18, 2014 at 7:17 PM, Wilcodejongh notifications@github.comwrote:

i want to try your code but i see tah you use $btc_usd['fee'] = $BTCeAPI->getPairFee('btc_usd');

then i get a arry back but is this the same on a buy/sell $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100); so i know that it whas buyed/selled?

Can you help me. Thanks

Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1 .

‹ Reply to this email directly or view it on GitHub https://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-37989893 .

tf-redfree commented 10 years ago

Ik verontschuldig me, mijn nederlands is slecht!

Een opdracht vereist. Zoals ik al zei, zal de functie het bericht als een array terug. Daarom, om toegang te krijgen tot de boodschap: U moet het resultaat toe te wijzen aan een variabele. bijvoorbeeld:

Code:

$inleg = 1; // 1 bitcoin $aankoop = 430; // bepalen de prijs tot 430 $bericht = $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, $aankoop); // krijgen het resultaat van de api query en sla het op in de variabele

var_dump($bericht); // informatie: $bericht

End

Hoop dat dit kan van hulp voor u, Tony

On Wed, Mar 19, 2014 at 6:31 PM, Wilcodejongh notifications@github.comwrote:

Tony,

If I try try { $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, 430); } catch(BTCeAPIInvalidParameterException $e) { echo $e->getMessage(); } catch(BTCeAPIException $e) { echo $e->getMessage(); }

I don¹t get a message back.

If I use try { $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, $aankoop); } catch(BTCeAPIInvalidParameterException $e) { echo $e->getMessage(); } catch(BTCeAPIException $e) { echo $e->getMessage(); }

And I don¹t fill in the $aankoop then I get a error back.

Can I get a message if its a good buy action?

Or do I have something wrong?

Als er vragen zijn dan hoor ik het graag.

Met vriendelijke groet,

Wilco de Jongh

Softlink ICT

Wilco de Jongh

Tel: 0418 653576

Fax: 0418 653635

Mob: 06 28948600

Email: wilco@softlink.nl

Website: www.softlink.nl

Is uw website veilig? - Controleren van uw website: Ons vak!

Voor meer informatie: http://www.softlinksecurity.nl http://www.softlinksecurity.nl/

Van: Anthony Free notifications@github.com Beantwoorden - Aan: marinu666/PHP-btce-api

<reply+i-29675863-1f14525878ae7481a4219d0beba7e6620eead356-4491076@reply.git hub.com> Datum: dinsdag 18 maart 2014 22:19 Aan: marinu666/PHP-btce-api PHP-btce-api@noreply.github.com CC: wilco wilco@softlink.nl Onderwerp: Re: [PHP-btce-api] What is the bets way to get the respons of a buy/sell (#1)

Hello,

The function call for $BTCeAPI->getPairFee('btc_usd'); will retrieve the fee imposed by btc-e. For btc_usd at the moment this is 0.2%.

The call to: $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100);

will buy a bitcoin for 100 USD. If you wish to sell you would need to use BTCeAPI::DIRECTION_SELL. $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_SELL, 100);

When this is executed you will get a response from btc-e's API. This will be in a form that PHP can understand as opposed to the JSON which is returned from the API. You can look at this response to determine if the buy/sell went onto the exchange. If the request was invalid, an exception will be thrown instead.

Hope this helps, Tony

On Tue, Mar 18, 2014 at 7:17 PM, Wilcodejongh notifications@github.comwrote:

i want to try your code but i see tah you use $btc_usd['fee'] = $BTCeAPI->getPairFee('btc_usd');

then i get a arry back but is this the same on a buy/sell $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100); so i know that it whas buyed/selled?

Can you help me. Thanks

Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1 .

‹ Reply to this email directly or view it on GitHub https://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-37989893 .

— Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-38089196 .

Wilcodejongh commented 10 years ago

Top

Dank je wel. Mag ik vragen waar je vandaan komt omdat je nu nl praat?

Ik had vannacht al een aanpassing gedaan zodat ik een bericht terug krijg. Ik had ook een if loop gemaakt als melding succes=1 dat hij dan de gegevens in de database plaatst.

Maar het lijkt er op dat hij vaak geen melding terug krijg maar wel gekocht heeft. dus moet ik nog een controle maken om te kijken of hij wel gekocht heeft.

Andere vraag heb jij een bot draaien met deze gegevens?

Dank je voor de info.

Wilco de Jongh Softlink ICT

Op 20 mrt. 2014 om 03:38 heeft "Anthony Free" notifications@github.com het volgende geschreven:

Ik verontschuldig me, mijn nederlands is slecht!

Een opdracht vereist. Zoals ik al zei, zal de functie het bericht als een array terug. Daarom, om toegang te krijgen tot de boodschap: U moet het resultaat toe te wijzen aan een variabele. bijvoorbeeld:

Code: ------

$inleg = 1; // 1 bitcoin $aankoop = 430; // bepalen de prijs tot 430 $bericht = $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, $aankoop); // krijgen het resultaat van de api query en sla het op in de variabele

var_dump($bericht); // informatie: $bericht

End -----

Hoop dat dit kan van hulp voor u, Tony

On Wed, Mar 19, 2014 at 6:31 PM, Wilcodejongh notifications@github.comwrote:

Tony,

If I try try { $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, 430); } catch(BTCeAPIInvalidParameterException $e) { echo $e->getMessage(); } catch(BTCeAPIException $e) { echo $e->getMessage(); }

I don¹t get a message back.

If I use try { $BTCeAPI->makeOrder("$inleg", 'btc_eur', BTCeAPI::DIRECTION_BUY, $aankoop); } catch(BTCeAPIInvalidParameterException $e) { echo $e->getMessage(); } catch(BTCeAPIException $e) { echo $e->getMessage(); }

And I don¹t fill in the $aankoop then I get a error back.

Can I get a message if its a good buy action?

Or do I have something wrong?

Als er vragen zijn dan hoor ik het graag.

Van: Anthony Free notifications@github.com Beantwoorden - Aan: marinu666/PHP-btce-api

<reply+i-29675863-1f14525878ae7481a4219d0beba7e6620eead356-4491076@reply.git hub.com> Datum: dinsdag 18 maart 2014 22:19 Aan: marinu666/PHP-btce-api PHP-btce-api@noreply.github.com CC: wilco wilco@softlink.nl Onderwerp: Re: [PHP-btce-api] What is the bets way to get the respons of a buy/sell (#1)

Hello,

The function call for $BTCeAPI->getPairFee('btc_usd'); will retrieve the fee imposed by btc-e. For btc_usd at the moment this is 0.2%.

The call to: $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100);

will buy a bitcoin for 100 USD. If you wish to sell you would need to use BTCeAPI::DIRECTION_SELL. $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_SELL, 100);

When this is executed you will get a response from btc-e's API. This will be in a form that PHP can understand as opposed to the JSON which is returned from the API. You can look at this response to determine if the buy/sell went onto the exchange. If the request was invalid, an exception will be thrown instead.

Hope this helps, Tony

On Tue, Mar 18, 2014 at 7:17 PM, Wilcodejongh notifications@github.comwrote:

i want to try your code but i see tah you use $btc_usd['fee'] = $BTCeAPI->getPairFee('btc_usd');

then i get a arry back but is this the same on a buy/sell $BTCeAPI->makeOrder(1, 'btc_usd', BTCeAPI::DIRECTION_BUY, 100); so i know that it whas buyed/selled?

Can you help me. Thanks

Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1 .

‹ Reply to this email directly or view it on GitHub https://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-37989893 .

— Reply to this email directly or view it on GitHubhttps://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-38089196 .

— Reply to this email directly or view it on GitHub.

tf-redfree commented 10 years ago

Ik kom uit Engeland. Mijn nederlands is niet erg goed, mijn Duits is veel beter. Ik heb gewerkt voor een bedrijf in Venlo, Nederland (aan de Duitse grens).

Door het gebruik van 'makeOrder', dan moet altijd een resultaat te retourneren. Als het niet, dan weet ik niet wat er gebeurt. Misschien een bug?

hoe dan ook: Het resultaat moet van dit formaat zijn (maar json_decode in PHP door mij): { "success":1, "return":{ "received":0.1, "remains":0, "order_id":0, "funds":{ "usd":325, "btc":2.498, "sc":121.998, "ltc":0, "ruc":0, "nmc":0 } } }

je kunt controleren wanneer het werd voltooid. Als het is, dan "remains" moet 0 zijn. Als het wordt wachten of onvolledig, dan niet 0.

Ik denk dat het kan worden benaderd met behulp van x $resultaat->return->remains of $resultaat['return']['remains']. (Kan me niet precies herinneren, eens een kijkje op de var_dump).

Tony

Wilcodejongh commented 10 years ago

Nou ik vind je nl beter dan mijn Duits of Engels.

Heb je zelf ook nog iets draaien?

Je staat met je api ook op de site van btc-e wist je dat?

Wilco de Jongh

Op 20 mrt. 2014 om 08:04 heeft "Anthony Free" notifications@github.com het volgende geschreven:

Ik kom uit Engeland. Mijn nederlands is niet erg goed, mijn Duits is veel beter. Ik heb gewerkt voor een bedrijf in Venlo, Nederland (aan de Duitse grens).

Door het gebruik van 'makeOrder', dan moet altijd een resultaat te retourneren. Als het niet, dan weet ik niet wat er gebeurt. Misschien een bug?

hoe dan ook: Het resultaat moet van dit formaat zijn (maar json_decode in PHP door mij): { "success":1, "return":{ "received":0.1, "remains":0, "order_id":0, "funds":{ "usd":325, "btc":2.498, "sc":121.998, "ltc":0, "ruc":0, "nmc":0 } } }

je kunt controleren wanneer het werd voltooid. Als het is, dan "remains" moet 0 zijn. Als het wordt wachten of onvolledig, dan niet 0.

Ik denk dat het kan worden benaderd met behulp van x $resultaat->return->remains of $resultaat['return']['remains']. (Kan me niet precies herinneren, eens een kijkje op de var_dump).

Tony

— Reply to this email directly or view it on GitHub.

tf-redfree commented 10 years ago

Ik heb niets meer uitvoeren. Maar ik heb in het verleden.

Sorry, Ik begrijp het niet: "Je staat met je api ook op de site van btc-e wist je dat?" Bedoel je dat het is op hun website?

Tony

Wilcodejongh commented 10 years ago

Ja klopt.

https://btc-e.com/api/documentation

Staan er nu 2 met php code ook die van jou. Als voorbeeld dan.

Wilco de Jongh

Op 20 mrt. 2014 om 08:26 heeft "Anthony Free" notifications@github.com het volgende geschreven:

Ik heb niets meer uitvoeren. Maar ik heb in het verleden.

Sorry, Ik begrijp het niet: "Je staat met je api ook op de site van btc-e wist je dat?" Bedoel je dat het is op hun website?

Tony

— Reply to this email directly or view it on GitHub.

tf-redfree commented 10 years ago

Dat is vrij goed :)

Wilcodejongh commented 10 years ago

Haha. Ja toch.

Maar waarom ben je gestopt met handelen?

Wilco de Jongh Softlink ICT

Op 20 mrt. 2014 om 08:34 heeft "Anthony Free" notifications@github.com het volgende geschreven:

Dat is vrij goed :)

— Reply to this email directly or view it on GitHub.

Wilcodejongh commented 10 years ago

Was het ingewikkelde bot die je gemaakt had?

Wil je hem niet delen? ;-)

Wilco de Jongh

Op 20 mrt. 2014 om 08:34 heeft "Anthony Free" notifications@github.com het volgende geschreven:

Dat is vrij goed :)

— Reply to this email directly or view it on GitHub.

tf-redfree commented 10 years ago

het was niet ingewikkeld, maar ik heb niet de code voor het niet meer hebben. Ik maakte deze API-software voor dat project.

Tony

Wilcodejongh commented 10 years ago

Jammer.

Van: Anthony Free notifications@github.com Beantwoorden - Aan: marinu666/PHP-btce-api <reply+i-29675863-1f14525878ae7481a4219d0beba7e6620eead356-4491076@reply.git hub.com> Datum: donderdag 20 maart 2014 18:50 Aan: marinu666/PHP-btce-api PHP-btce-api@noreply.github.com CC: wilco wilco@softlink.nl Onderwerp: Re: [PHP-btce-api] What is the bets way to get the respons of a buy/sell (#1)

het was niet ingewikkeld, maar ik heb niet de code voor het niet meer hebben. Ik maakte deze API-software voor dat project.

Tony

‹ Reply to this email directly or view it on GitHub https://github.com/marinu666/PHP-btce-api/issues/1#issuecomment-38199212 .