Giter VIP home page Giter VIP logo

phptrader's Introduction

Logo of Chris

Hi, I'm Chris

Blog Twitter Linkedin Visitors

  • Infosec wizard without a beard
  • Secops if they let me
  • Exposing insecure things
  • Sysadmin Windows + Linux servers (I just love servers of any kind)
  • Founder of Haschek Solutions
  • Co-Founder of E'ebo
  • Blogger at blog.haschek.at

phptrader's People

Contributors

daryledesilva avatar geek-at avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phptrader's Issues

[ERR] Could not find your BTC Wallet. Do you have one on Coinbase?

Installed and redownload a couple of times. Not working.
Renewed my API keys as well. Both running latest version of PHP and composer too.
Installed on Ubuntu 16.04, Windows 8.1 and Ubuntu MATE (Raspberry Pi 3), no luck.

When trying to use command: php trader.php buy

Terminal Error:
[i] Will use 'BTC Wallet' as crypto wallet :)
[ERR] Could not find your BTC Wallet. Do you have one on Coinbase?

Announcement: PHPtrader won't be maintaned any more, I'm making a better one

Thanks for your awesome support and your interest in the php trader bot.

The Bot has one major flaw: It uses coinbase.

Coinbase has usually a spread of about 6€ (~7$) which means no matter how much or little you give to bot to trade it has to wait for the amount to rise for 6€ just so you can break even.

Also the bot has only one real autotrading method so I'm going a different path:

Meet: Cryptotrader https://github.com/HaschekSolutions/cryptotrader

Cryptotrader uses the GDAX API (if you have a coinbase account, you have a GDAX account!) which has a much smaller spread.

Also the Cryptotrader won't be ONE script or ONE bot, it will be many of them. Implemented various trading algorithms and analysis programs.

Cryptotrader won't need external libraries (no composer needed) so it will be much slicker.

See you over at https://github.com/HaschekSolutions/cryptotrader

Undefined index in ptrader.php

the bot does not work propely i get the messages below:

PHP Warning: file_get_contents(): Filename cannot be empty in /home/pi/phptrader/trader.php on line 631
PHP Notice: Undefined index: btc in /home/pi/phptrader/trader.php on line 501
PHP Notice: Undefined index: buyprice in /home/pi/phptrader/trader.php on line 503

Rounding issue

I made one small change to my copy so the "Difference" price will be rounded properly:

        echo "[i] Difference buy/sell: ".round(abs($this->buyPrice-$this->sellPrice),2)."\n\n";

Log Permissions Not Allowing Script To Run

I have installed the script on two separated devices, a rpi3 & a rpi0w. On the rpi3 I installed composer globally & on my rpi0w I installed composer locally, both devices are running into the same permissions error when trying to run the command ''./start.sh" in terminal. Here is the error:

./start.sh: line 2: /var/log/phptrader.log: Permission denied

Can someone please explain to me how to get past this error & fix the issue, thank you in advance.

Coinbase API

Hey just wanted to check if I should enable permissions for V1 or V2 coinbase API? You might want to also add that it takes 48 hours for coinbase to enable a new API key.

Can't set the timezone before config has loaded

There is an option now in config for the user to set their timezone, but this option is called in the script before config has loaded, so I get an error:

Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /Users/J/Documents/phptrader/vendor/coinbase/coinbase/src/Mapper.php:627

Solved by moving the line that sets the timezone default, to just after the config file is loaded.

Missing data in new List command

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.

Keep getting Invalid Signature error when getting accounts

I'm getting an "Invalid Signature" error when I run the app. I have setup the key on CoinBase as per the instructions on the blog post. I'm running the app on a Raspberry Pi Zero W running Raspbian Jesse. I'm using PHP version 5.6.30. I've created a number of api key's on CoinBase and tried all of them with the same result. Any help would be appreciated.

Real buy amount is not the same with the input amount

Hi,
So i finally brave enough to turn off simulation for the trader.php and see how it operates with coinbase, but i ran into a serious issue. So i tried to buy 5 usd worth of eth using the trader.php and sell it after it reaches 6 usd in profit. Here's the command i used:

php trader.php buy 5 6

[i] Will use 'USD Wallet' as currency wallet :)             
[i] Will use 'ETH Wallet' as crypto wallet :)               
[i] Will use USD Wallet for payments                        
                                                            
[i] Buy price: 86.1 USD                                     
[i] Sell price: 84.42 USD                                   
[i] Spot price: 85.21 USD                                   
[i] Difference buy/sell: 1.68 USD                           
                                                            
[B #1] Buying 5 USD     =       0.058072009291521 ETH

But then i received an email from coinbase, stating that i initiated a buy for 99.13 USD (1.13892042 ETH). The amount that i bought is not the same with what I put in the command.
screen shot 2017-05-12 at 9 11 36 pm

Logs can get HUGE

I've modified my bash script so that it prepends today's date on the log file, so there is a new file generated for each day. Keeps the size manageable per-file for those who like to run it in the background 24/7. Would you like my change submitted? I've never contributed on github before so I'm not sure how to do so or what the best practices are, etc. But if you want me to "formally" contribute I'm happy to do so, could just use a few pointers. =)

Undefined index btc when running watchdog

I got this error of undefined index when running simulation of watchdog function

------                                                                                                                  
[i] Currently watching 1 transactions                                                                                   
[i] Buy price: 79.37 USD                                                                                                
[i] Sell price: 77.67 USD                                                                                               
[i] Spot price: 78.6 USD                                                                                                
[i] Difference buy/sell: 1.7 USD                                                                                        
                                                                                                                        
PHP Notice:  Undefined index: btc in /home/pi/Development/phptrader/trader.php on line 435                              
 [#1] Watching BUY order for    160 USD. Will buy when ETH price reaches 78.                                            
------  

Code redundancy

There's a little redundancy between 'list' and 'report' since both show the orders currently pending. Could condense that to a single block of code that is just called from both functions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.