Added a -k to the command to make curl ignore invalid results about the site
(alpaca paper trading site) .
Then, I had to escape the double slashes at the command line from " to \"
This is my entire command, PS: I wrapped it for clarity…
So I am not using your usual Visual studio or python dev, and while I do C++, I don’t do it in Linux. I am using C++ Builder for windows, I am happy the order ‘filled’ so quickly with curl, I guess the stories about TLS1.3 speed is true.
I use C++ Builder, and now I can wrap this in a process launcher with I/O redirection - code I wrote years ago to do the fill and get the results.
Thanks, LOL, totally forgot to escape my backslash for the web, so this is what it will look like.
(had to add \\ to get a single \ to appear)
curl -k
-H “Content-Type: application/json”
-H “APCA-API-KEY-ID: PK**********************”
-H “APCA-API-SECRET-KEY: wB*********************************************”
-d “{\“symbol\”:\“AAPL\”,\“qty\”:\“1\”,\“side\”:\“buy”,\“type\”:\“market\”,\“time_in_force\”:\“gtc\”}”
“https://paper-api.alpaca.markets/v2/orders”
Now remember this escapement is really because of the command-line in Windows.
In that a dbl quote is how windows sees a way to group parameters with spaces
so hi mom will be seen as 2 parameters but “hi mom” will be seen as one.
Seeing the JSON query has a dbl quote as part of the parameter and not a separator
you’ll then need to escape it.
I will be wrapping this is an I/O engine in a C++ windows app, so I will let you know how that goes.