Giter Club home page Giter Club logo

alpaca-trade-api-cpp's Introduction

Hello! My name is Mike ๐Ÿ‘‹

Work

I'm Managing Partner & CTO at Moonfire Ventures ๐ŸŒ—๐Ÿ”ฅ

Previously, I was:

Osquery

Kubernetes

  • Iโ€™ve been using Kubernetes in production since 2016.
  • I was a member of the Kubernetes core contributor team from 2018 until 2021 where I served on the Release Team for four releases as well as participated in several Working Groups and SIGs.
  • I led my team at Kolide to build and operate what was one of the largest Kubernetes clusters in Google Cloudโ€™s GKE at the time.

alpaca-trade-api-cpp's People

Contributors

marpaia 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alpaca-trade-api-cpp's Issues

Empty Clock Response

I am getting the following error

Error getting clock information: Call to /v2/clock returned an empty response [1] + Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-k00k1zob.c59" 1>"/tmp/Microsoft-MIEngine-Out-vh4w1njx.atz"

when running the cpp alpaca template.

I assume it is just a setup mistake on my end - my environment variables are defined as
APCA_API_KEY_ID = <my_key> APCA_API_SECRET_KEY = <my_secret_key> APCA_API_BASE_URL =https://paper-api.alpaca.markets APCA_API_DATA_URL =https://data.alpaca.markets

Build issue

$ bazel build //alpaca                                                         
INFO: Analyzed target //alpaca:alpaca (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/vanush/.cache/bazel/_bazel_vanush/dbee3e231e55c20865ee60e0bcbc3a02/external/com_github_google_boringssl/BUILD:131:1: undeclared inclusion(s) in rule '@com_github_google_boringssl//:crypto':
this rule is missing dependency declarations for the following files included by 'external/com_github_google_boringssl/src/crypto/bytestring/cbb.c':
  '/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h'
  '/usr/lib/gcc/x86_64-linux-gnu/9/include/stdint.h'
  '/usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h'
  '/usr/lib/gcc/x86_64-linux-gnu/9/include/syslimits.h'
  '/usr/lib/gcc/x86_64-linux-gnu/9/include/stdarg.h'
  '/usr/lib/gcc/x86_64-linux-gnu/9/include/stdalign.h'
Target //alpaca:alpaca failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.494s, Critical Path: 0.41s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
gcc (Ubuntu 9.3.0-10ubuntu2~16.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compilation error caused by missing functional header

Plz see the error message below. The solution is to add #include <functional> into alpaca/streaming.h.

./alpaca/json.h:55:120: warning: backslash-newline at end of file
 #define PARSE_VECTOR_UINT64(var, name)                                                                                 \
                                                                                                                         
ERROR: /home/ubuntu/alpaca-trade-api-cpp/alpaca/BUILD:3:1: C++ compilation of rule '//alpaca:alpaca' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 76 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from alpaca/streaming.cpp:1:0:
alpaca/streaming.h:57:24: error: expected ')' before '<' token
   Handler(std::function<void(DataType)> on_trade_update, std::function<void(DataType)> on_account_update)
                        ^
alpaca/streaming.h:67:8: error: 'function' in namespace 'std' does not name a template type
   std::function<void(DataType)> on_trade_update_;
        ^~~~~~~~
alpaca/streaming.h:68:8: error: 'function' in namespace 'std' does not name a template type
   std::function<void(DataType)> on_account_update_;
        ^~~~~~~~
alpaca/streaming.cpp: In lambda function:
alpaca/streaming.cpp:174:7: error: 'on_trade_update_' was not declared in this scope
       on_trade_update_(reply.data);
       ^~~~~~~~~~~~~~~~
alpaca/streaming.cpp:174:7: note: suggested alternative: 'TradeUpdates'
       on_trade_update_(reply.data);
       ^~~~~~~~~~~~~~~~
       TradeUpdates
alpaca/streaming.cpp:177:7: error: 'on_account_update_' was not declared in this scope
       on_account_update_(reply.data);
       ^~~~~~~~~~~~~~~~~~
alpaca/streaming.cpp:177:7: note: suggested alternative: 'AccountUpdates'
       on_account_update_(reply.data);
       ^~~~~~~~~~~~~~~~~~
       AccountUpdates
alpaca/streaming.cpp: In function 'std::__cxx11::string alpaca::stream::streamToString(alpaca::stream::StreamType)':
alpaca/streaming.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Build error with latest version

I put

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_github_marpaia_alpaca_trade_api_cpp",
    strip_prefix = "alpaca-trade-api-cpp-master",
    urls = ["https://github.com/marpaia/alpaca-trade-api-cpp/archive/master.tar.gz"],
)
load("@com_github_marpaia_alpaca_trade_api_cpp//bazel:deps.bzl", "alpaca_deps")
alpaca_deps()

in my workspace file, attempted to build, and got this error:

DEBUG: Rule 'com_github_marpaia_alpaca_trade_api_cpp' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "856e4a05cf41c8d1f669db45e8bd56ef7b7bc485355ea7e836035af4842817a2"
DEBUG: Repository com_github_marpaia_alpaca_trade_api_cpp instantiated at:
  /home/christopher/prog/cpp/eve2/WORKSPACE:3:13: in <toplevel>
Repository rule http_archive defined at:
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Repository com_github_unetworking_uwebsockets instantiated at:
  /home/christopher/prog/cpp/eve2/WORKSPACE:9:12: in <toplevel>
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/com_github_marpaia_alpaca_trade_api_cpp/bazel/deps.bzl:83:21: in alpaca_deps
Repository rule http_archive defined at:
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Repository 'com_github_unetworking_uwebsockets' used the following cache hits instead of downloading the corresponding file.
 * Hash '663a22b521c8258e215e34e01c7fcdbbd500296aab2c31d36857228424bb7675' for https://github.com/uNetworking/uWebSockets/archive/v0.14.8.tar.gz
If the definition of 'com_github_unetworking_uwebsockets' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'com_github_unetworking_uwebsockets':
   Traceback (most recent call last):
	File "/home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/http.bzl", line 120, column 28, in _http_archive_impl
		workspace_and_buildfile(ctx)
	File "/home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 58, column 41, in workspace_and_buildfile
		ctx.file("BUILD.bazel", ctx.read(ctx.attr.build_file))
Error in read: Unable to load package for //bazel/third_party/uwebsockets:BUILD: BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /home/christopher/prog/cpp/eve2/bazel/third_party/uwebsockets
ERROR: Error fetching repository: Traceback (most recent call last):
	File "/home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/http.bzl", line 120, column 28, in _http_archive_impl
		workspace_and_buildfile(ctx)
	File "/home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 58, column 41, in workspace_and_buildfile
		ctx.file("BUILD.bazel", ctx.read(ctx.attr.build_file))
Error in read: Unable to load package for //bazel/third_party/uwebsockets:BUILD: BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /home/christopher/prog/cpp/eve2/bazel/third_party/uwebsockets
INFO: Repository com_github_yhirose_cpp_httplib instantiated at:
  /home/christopher/prog/cpp/eve2/WORKSPACE:9:12: in <toplevel>
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/com_github_marpaia_alpaca_trade_api_cpp/bazel/deps.bzl:45:21: in alpaca_deps
Repository rule http_archive defined at:
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Repository com_github_google_boringssl instantiated at:
  /home/christopher/prog/cpp/eve2/WORKSPACE:9:12: in <toplevel>
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/com_github_marpaia_alpaca_trade_api_cpp/bazel/deps.bzl:55:21: in alpaca_deps
Repository rule http_archive defined at:
  /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
ERROR: /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/com_github_marpaia_alpaca_trade_api_cpp/alpaca/BUILD:3:11: @com_github_marpaia_alpaca_trade_api_cpp//alpaca:alpaca depends on @com_github_unetworking_uwebsockets//:uwebsockets in repository @com_github_unetworking_uwebsockets which failed to fetch. no such package '@com_github_unetworking_uwebsockets//': Unable to load package for //bazel/third_party/uwebsockets:BUILD: BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /home/christopher/prog/cpp/eve2/bazel/third_party/uwebsockets
ERROR: Analysis of target '//src:main' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.798s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
    Fetching @com_github_tencent_rapidjson; fetching
    Fetching ...idjson; Extracting /home/christopher/.cache/bazel/_bazel_christopher/6f248f731ec5030a6b7570c92efc53dd/external/com_github_tencent_rapidjson/temp17542727\
275593451699/v1.1.0.tar.gz

This problem does not happen with

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_github_marpaia_alpaca_trade_api_cpp",
    strip_prefix = "alpaca-trade-api-cpp-0.0.3",
    urls = ["https://github.com/marpaia/alpaca-trade-api-cpp/archive/v0.0.3.tar.gz"],
    sha256 = "db9efe3dc92f4e1d7eb69d76cb807af6bcf61ea14fe73f30e22830002b34f81a",
)
load("@com_github_marpaia_alpaca_trade_api_cpp//bazel:deps.bzl", "alpaca_deps")
alpaca_deps()

in my workspace file. I can't use 0.0.3 because I need the Client::getLastTrade function which is not present in that version. Any advice for how to fix this problem?

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.