joeldg / bowhead

PHP trading bot framework
Apache License 2.0
801 stars 288 forks source link

Database Errors using Dockor #90

Open OlyRice opened 6 years ago

OlyRice commented 6 years ago

I am getting the following error when I run the system with within a container. I have I missed a step, I have tried migrating but it states there is nothing to migrate.

/var/www/bowhead # php artisan bowhead:test_strategies 
PRESS 'q' TO QUIT AND CLOSE ALL POSITIONS

In Connection.php line 647:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'basevVolume' in 'fi  
  eld list' (SQL:                                                              
                SELECT                                                         
                  bh_exchanges_id,                                             
                  SUBSTRING_INDEX(GROUP_CONCAT(CAST(bid AS CHAR) ORDER BY cre  
  ated_at), ',', 1 ) AS `open`,                                                
                  SUBSTRING_INDEX(GROUP_CONCAT(CAST(bid AS CHAR) ORDER BY bid  
   DESC), ',', 1 ) AS `high`,                                                  
                  SUBSTRING_INDEX(GROUP_CONCAT(CAST(bid AS CHAR) ORDER BY bid  
  ), ',', 1 ) AS `low`,                                                        
                  SUBSTRING_INDEX(GROUP_CONCAT(CAST(bid AS CHAR) ORDER BY cre  
  ated_at DESC), ',', 1 ) AS `close`,                                          
                  SUM(basevolume) AS volume,                                   
                  ROUND((CEILING(UNIX_TIMESTAMP(`created_at`) / 60) * 60)) AS  
   buckettime,                                                                 
                  round(AVG(bid),11) AS avgbid,                                
                  round(AVG(ask),11) AS avgask,                                
                  AVG(basevVolume) AS avgvolume                                
                FROM bh_tickers                                                
                WHERE symbol = 'USD_JPY'                                       
                AND UNIX_TIMESTAMP(`created_at`) > (1517252208)                
                GROUP BY bh_exchanges_id, buckettime                           
                ORDER BY buckettime DESC                                       
            )                                                                  

In PDOConnection.php line 79:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'basevVolume' in 'fi  
  eld list'                                                                    

In PDOConnection.php line 77:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'basevVolume' in 'fi  
  eld list'                                                                    
tdekergo commented 6 years ago

You have to change in /bowhead/app/Traits/OHLC.php : " AVG(basevVolume) AS avgvolume " by " AVG(basevolume) AS avgvolume "