Open a177177 opened 6 years ago
markOHLC was removed and it was for feeding the DB with data. For testing and playing with this comment out this line and you will see the data flowing in. This is not a long term solution.
Tried commenting out the markOHLC lines and got the result:
------------------------------------------------------------------
Set CBURL to api-public.sandbox.gdax.com before running this..
This will trade live otherwise, so be CAREFUL
PRESS ENTER TO CONTINUE
------------------------------------------------------------------
UPDATING RECENT Open, High, Low, Close data
Updating...
It keeps giving me "Updating..." but where is it doing so? I checked bowhead_OHLC and it shows empty set. Went ahead and uncommented markOHLC lines and added in:
public function markOHLC($ticker)
{
$last_price = $ticker[7];
$volume = $ticker[8];
$timeid = date('YmdHi'); // 201705301522 unique for date
$ins = \DB::insert("
INSERT INTO bowhead_ohlc
(`instrument`, `timeid`, `open`, `high`, `low`, `close`, `volume`)
VALUES
('ETH-USD', $timeid, $last_price, $last_price, $last_price, $last_price, $volume)
ON DUPLICATE KEY UPDATE
`high` = CASE WHEN `high` < VALUES(`high`) THEN VALUES(`high`) ELSE `high` END,
`low` = CASE WHEN `low` > VALUES(`low`) THEN VALUES(`low`) ELSE `low` END,
`volume` = VALUES(`volume`),
`close` = VALUES(`close`)
");
return true;
}
and this populated bowhead_OHLC but the data (open, high, low, close, volume) was being repeated and not updated. Not sure how to tweak the code for markOHLC to get the proper data feed. So close!
I have started to fix the issues and upgrade this in my own fork. There is a README file so check there where did I stop. Please note this is under progress project and there might be a lot of errors. DO NOT USE REAL API just demo for testing until all is resolved. Here is the forked version https://github.com/deakzsolt/bowhead
Assuming GdaxScalperCommand.php needs a tweak but not sure where/how.
Tried this:
Resulted in:
Relevant portion of GdaxScalperCommand.php:
I'm new to coding so it's possible I'm missing something stupidly obvious here...