Hello everyone!
I created a new type of machine learning based on what could be best described as a biosynthetic model.
That aside I created an API anyone can use (of course their paper id and secret… don’t give me the live stuff :)).
Here goes… all calls are GET so can be executed from a web browser, postman, or even a spreadsheet. It runs on a very small server with limited capabilities so more like a proof of concept but at least it could wriggle some correlation.
Endpoint is:
To start a prediction run the following below which is pretty self explanatory:
ENDPOINT/security?payload={“id”:"…",“secret”:"…",“commodity”:“TRIL”,“window”:500,“rate”:“day”}
Returns a token: {“token”:"…"}
window is how many units of rate from now you look in the past to infer the next bar. Capped at 500 per Alpaca API.
“rate” is: minute or 1Min, 5Min, 15Min, day or 1D
If it can’t get data it will give out an error.
The token used can be used to query for a prediction. You have to make a query at least once every 3 minutes or the prediction process dies.
ENDPOINT/prediction?payload={“token”:"…"}
which returns a JSON object of the format:
{“result”:[[{“cycle”:…,“error”:…,“id”:"…",“result”:[13.08],“token”:"…"},{“cycle”:…,“error”:…,“id”:"…",“result”:[12.38],“token”:"…"}]]}
Basically an array of 2 sub-objects giving you an upper and lower band to expect next from the previous bars. Here high is 13.08 and low is 12.38.
error is the quadratic sum of all the errors between the computed predictions and the backtesting.
The run will automatically stop after a while, or if not queried within 3 minutes, or explicitly stopped using:
ENDPOINT/stop?payload={“token”:"…"}
Thats’ it… feedback welcome! Eager to know if this works at all.