Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{cryptoQuotes} v1.3.2 🚀 #40

Merged
merged 29 commits into from
Nov 7, 2024
Merged

{cryptoQuotes} v1.3.2 🚀 #40

merged 29 commits into from
Nov 7, 2024

Conversation

serkor1
Copy link
Owner

@serkor1 serkor1 commented Nov 7, 2024

Partially fixes issue #39

serkor1 and others added 29 commits June 15, 2024 01:39
The following exchanges have been addded

* crypto.com (spot, futures, fundingrate)
* huobi (spot, futures)
* MEXC (spot, futures, fundingrate)

Minor changes

get_quote()-function needed small changes in order to return the data in OHLC-V format
due to Huobi API specifics.

NOTE:
crypto.com US compliant and can therefore run on US resident computers without VPN.
Huobi API documentation is huge - this still needs work, and confirmation on what it can return
other than what is provided already. The funding rate for cryto.com is hourly, as opposed to 4 hour and 8 hours for Binance and bybit.

All devtool::check() have passed locally.

Footnote:

{cryptoQuotes} is not going to be updated for a long while - unless there is any serious bugs,
or any submission considerations.
The following exchanges have been addded

* crypto.com (spot, futures, fundingrate)
* huobi (spot, futures)
* MEXC (spot, futures, fundingrate)

Minor changes

get_quote()-function needed small changes in order to return the data in OHLC-V format
due to Huobi API specifics.

NOTE:
crypto.com US compliant and can therefore run on US resident computers without VPN.
Huobi API documentation is huge - this still needs work, and confirmation on what it can return
other than what is provided already. The funding rate for cryto.com is hourly, as opposed to 4 hour and 8 hours for Binance and bybit.

All devtool::check() have passed locally.

Footnote:

{cryptoQuotes} is not going to be updated for a long while - unless there is any serious bugs,
or any submission considerations.
Forgot `git add` on important changes pre `push` and `merge` - These errors wont
get caught via Github Actions because they are skipped on CI/CD.

Lesson: Don't code while drunk. Or don't forget the full check after each change, even though it works in the sandbox.
* Fixed Bugs and Updated Tests

This commit closes #13 🚀

Additional Fix:

The random sampling of tickers in the kraken-tests forced the failure of the tests. A seed of 1903 has been added to each unit test.

Added test indicators on the get_quote unit tests as it would fail for Bitmart in the 1h. This is due to a rounding error; this requires further investigation at a later point.

The chart unittests has been updated to make sure it runs without any conditions at all to avoid the same errors as in #13.

Note:

All checks have passed locally, and NEWS.md has been updated accordingly

* Chart layout changes 🚀

The chart now has a higher top-margin to prevent modebar from overlaying the title and subtitle.

The modebar now includes drawrect, drawline and eraseshape to create and remove support and resistance lines.

The chart title and subtitle can also be customized interactively. See Discussion #19

All charts are now exported in 4k as .svg-files.

The modebar is always visible by default, but can be removed within the options.

The charts now has custom color-palettes via hcl.pals()

Known Issues:

The exported charts has really small font sizes, so it is barely visible.

* Update Chart Options 😍

The chart-function now has the following options:

* scale: scales the font-size.
* static: a logical value FALSE by default. If TRUE it act as a regular static plot a la ggplot.

The chart function now asserts the size being between 0 and 1, and checks for valid hcl.palettes with ignore.case set to TRUE.

All subcharts have had annotations multiplied by args from the chart funciton.

NOTE: All checks have passed locally 🚀
Package name has to be followed by version.
* Updated Documentation 📚

* All pkg have been changed to {pkg}.
* Description of {pkgdown} changed to be more SEO friendly.
* Fancy-pants blockquotes created.

* Updated {pkgdown} and NEWS.md 🚀

The documentation on {pkgdown} has been rewritten to remove various {tidyverse} related bugs and to align the website to the new {pkg} syntax.
The code coverage now covers all exchanges that can be run in the US. A minor bug-fix on Huobi FUTURES have been fixed in the process.
* Expanded Test and bug-fix 🔥 🔥

The code coverage now covers all exchanges that can be run in the US. A minor bug-fix on Huobi FUTURES have been fixed in the process.

* Bug-fixes and Test-Expansion  🔧

The test-getQuote.R has been expanded to include ALL intervals. The get_quote()-function
has been wrapped in try() as testthat doesn't capture the error per se.

Various bugs have been captured in this process:

1. Binance Futures doesn't have a 1s interval.
2. Bitmart doesn't have a 3m, 6h or 3d interval. However, the
documentation clearly states that it has. The URLs have been pasted directly
into the browser to verify this - its a but on their side.

Note:

This commit closes #26
This error occurs for tickers that were listed recently, and therefore doesn't have daily data yet. The random sampling of tickers have to change.
* Filter power-up 🔼 🔼

All get_*-family of function are usings stats::window() instead of {xts}-syntax. Local tests shows that {stats} is faster. About 5-10 times faster.

Bug-fix:

If interval were incorrectly specificed the error-message werent rendering properly. This were due to a missing quotation-mark.

* Binance, Assertand Fetch Power-Ups ⬆️ ⬆️

Assert:

The assert function has been reworked so it only evaluates all statements if any of the values are FALSE. The update is twice as fast as before in cases where all statements are TRUE.

Fetch:

The fetch()-function is now less defensive and uses only a single try-catch statement.

GET:

The GET()-function is now less defensive

Binance:

All possible parameters have been vectorized and/or simplified where possible.

General:

All ifelse()-functions have been replaced with if () else as these are faster.
For cases where more than two if statements are needed, a switch-function is used instead (with default values)

* ByBit Power-Ups ⬆️ ⬆️

The ByBit API has been upgraded to reduce overhead on if-statements and
interval look-up times.

See commit 8373bee for more details if there is any interest.

> [!NOTE]
>
> All tests have passed locally.

* Bitmart Power-Ups ⬆️ ⬆️

The Bitmart API has been upgraded to reduce overhead on if-statements and
interval look-up times.

See commit 8373bee for more details if there is any interest.

> [!NOTE]
>
> All tests have passed locally.

* Crypto.com Power-Ups ⬆️ ⬆️

The Crypto.com API has been upgraded to reduce overhead on if-statements and
interval look-up times.

See commit 8373bee for more details if there is any interest.

> [!NOTE]
>
> All tests have passed locally.

* MEXC Power-Ups + Bugfix ⬆️ ⬆️

MEXC API have been reworked and vectorized. See commit 8373bee
for more infor.

Bugfix 🔧

There was a small bug in the SPOT market where values to dates would
be passed as scientific values.

* Kraken Power-Ups ⬆️ ⬆️

Kraken API have been reworked and vectorized. See commit 8373bee for more information.

> [!NOTE]
>
> All tests have passed locally.

* KuCoin Power-Ups ⬆️ ⬆️

MEXC API have been reworked and vectorized. See commit 8373bee
for more information.

Possible bug has been fixed 🔧 (See commit 5a02a40, its similar)

* Huobi (HTX) Power-Ups ⬆️ ⬆️

Huobi API have been reworked and vectorized. See commit 5a02a40
for more information.

> [!NOTE]
>
> All tests have passed locally.

* Endpoint Power-Ups ⬆️ ⬆️

The available_*-family of functions have been reworked (slightly) and has really minor performance gain. At this stage there is no room for improvement on the coding side - however there are places where redundant codes could be removed, but they act as a defensive measure. These will be addressed at a way later stage.

* {cryptoQuotes} Power-Ups  ⬆️ ⬆️

New feature:
------------

Reading and writing xts-objects using read.zoo and write.zoo under the hood.
See the read_xts()- and write_xts()-functions for more details.

Added unit tests and updated NEWS.md

This function is dedicated to @gokberkcan7 🔥

* Updated README ⬆️ ⬆️

The README.md now uses data.table for the most part - all checks passes despite not being imported.
The exchanges have been recoded, and the available endpoints are being updated dynamically.

* Updated description and version bump ⬆️ ⬆️

The package has a more suitable title and description to reflect it's actual purpose and usecase.

* Removed redundant operators ⬆️

These include, but are not limited to, c(1) and c(foo). In cases like these the values ahve been chaged to 1 and foo.

Minor typos and such have been fixed in the README.me

* Updated vignette ⬆️ ⬆️

The custom chart vignette is now more user-friendly. It was targeted developers before
{pkgdown} has been updated. During the update a few minor changes have been implemented to the documentation.

1. frontpage has been reworked
2. theme has been changed to default (the update seems to have broken the original setup)
3. alt text has been added to article 5

Note: At some point the alt text has to be reworked completely.
* Accessibility upgrade of chart()-function

* The chart()-function now has a new option  which controls the overall width of the chart.

NEWS has been updated

* MEXC Bugfix 🔧

PR #31 failed the checks. The source of the error:

* MEXC has changed the response-object on available tickers. This has been fixed.

All checks have passed.
* Update custom_indicators.Rmd

The duplicated x-axis have been removed from the custom indicators in the Vignette.

* Update custom_indicators.Rmd

* Removed `dplyr`
* Removed whitespace
* added namespaced qualified `layout`-call

---------
Co-authored-by: Serkan Korkmaz <[email protected]>
In the excellent PR #32 by @stavralf, I made a small error during the review, which have now been fixed.
The BitMart exchange have updated their futures API to V2. V1 will stop
working 11/30/2024.
The BitMart exchange have updated their futures API to V2. V1 will stop
working 11/30/2024.

* Updated workflow file.
* Updated NEWS.md
* The Kraken API responds to tickers not returned by `available_tickers()` (See #37).
* Fix 🔨: Prior to version 1.3.2 the returned tickers were based on the array names from Kraken; this has been changed to altnames which is also more simple.

Thank you @Opt33 for reporting the issue.
* The `get_fgi()`-function returned 199 observations when no arguments were passed. Explicitly passed a `length`-argument to mitigate this.
* The unit-test for `infer_interval()` fails around daylight saving times. This has been fixed by increasing the
number of observations from 2 to 200.
* /playground interferes with the git-history
* cryptoQuotes.Rproj is an artefact of RStudio. This project have moved to Positron for the development.
* Positron uses rmarkdown::render() and it requires time to adapt to this. So redundant files
will start to flow and get removed as we go.
* Moved to Roxygen 7.3.2
* Updaed codemeta.json
* Added pkg-anchors (were missing, and CRAN checks did not pass)
* The function were throwing an error:

Found the following files/directories:
  ‘Rtmpx3Ay8DBTC.csv’

Added `unlink()` to the end of the test, which fixes everything locally 🔥
* All references to other packages should be single quoted - get rekt otherwise...
@serkor1 serkor1 added the release Upcoming release label Nov 7, 2024
@serkor1 serkor1 changed the title {cryptoQuotes} v1.3.2 {cryptoQuotes} v1.3.2 🚀 Nov 7, 2024
@serkor1 serkor1 self-assigned this Nov 7, 2024
@serkor1 serkor1 merged commit 31d92e2 into main Nov 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants