geek-at / phptrader

A simple php powered Bitcoin and Ethereum trading bot
143 stars 41 forks source link

Missing data in new List command #5

Closed vanclute closed 7 years ago

vanclute commented 7 years ago

I see this when I do a List:

ID: 1 SELL order for when ETH will reach a price of 1 USD ID: 2 SELL order for when ETH will reach a price of 49 USD ID: 3 SELL order for when ETH will reach a price of 4 USD

Trouble is... first all 3 orders are missing the $ amount of the order, and second... I have no order to sell at 1 or 4 USD, and it's missing my buy order. My correct current (correct) orders as reported by watchdog are:

[#1] Watching BUY order for 5 USD. Will buy when ETH price reaches 48.50. [#2] Watching SELL order for 6 USD. Will sell when ETH price reaches 49 ETH. [#3] Watching BUY order for 20 USD. Will buy when ETH price reaches 46.

vanclute commented 7 years ago

As far as I can tell the problem is here

$sellat = $td['sellat']+$eur;

$sellat is being defined, but $td['sellat'] is never defined anywhere that I can see.

Same problem with $eur:

    $eur = $td['eur'];

$td['eur'] is never defined anywhere. Also for the sake of code readbility they probably shouldn't be variables called "eur" and "btc" since it also supports USD and ETH. Should maybe be "$fiat" and "$coin" or something.