Skip to main content

Http

A very simple and basic interface for retrieving or posting content via HTTP.

Http.get#

Retrieves a content given a URL. Only very basic HTTP GET requests are supported at this time. It won’t work with more sophisticated requests as there is no way to add custom headers to the request. For now that is. I'll have to see if there is even a need for this feature.

var content = Http.get("https://www.google.com");
Log.info(content);

Http.postSignal#

Sometimes we would like to notify external services about what our server or our algorithms are doing. Algodab provides a way to submit a small chunk of data to an external URL (via a basic HTTP POST). The values submitted are very arbitrary and it is up to the receiving end (which was created by you, the user) to decide how to interpret the values, what to do with them, and how to utilize them.

curl -X POST http://my.server.address/post.php -d "data={\"type\":\"trade-signal\",\"name\":\"HODL\",\"ticker\":\"AMC\",\"qty\":100,\"price\":694.20,\"info\":\"this is a test\",\"ts\":1660437400,\"domain\":\"mine\",\"source\":\"algodab\",\"author\":\"mg\"}"
ParameterTypeDescription
typeStringThe type of a signal. For instance "trade-signal" or "trade-alert", etc. etc.
nameStringThe name identifying this signal.
infoStringAdditional information about this signal.
symbolStringA symbol (ticker) associated with this signal.
quantityNumbera numeric value (integer) that indicates a quanity
priceNumbera numeric value (float) that indicates a price
  • Despite their nomenclature, all values and their meaning are up to you, the user to define and interpret.
  • The URL to call is specified in Preferences under ''Settings''.
  • This feature can be disabled and enabled at any time by using the toggle next to "Callback URL".

Algo trading callback URL

Http.postSignal("trade-signal", "BUY", "Diamond-hand this thing", "AMC", 100, 694.20);