Skip to 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.

content = Http.get("https://algodab.com/lookup?AMC")
Log.info(content)
var content = Http.get("https://algodab.com/lookup?AMC"); 
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\"}"
Parameter Type Description
type String The type of a signal. For instance "trade-signal" or "trade-alert", etc. etc.
name String The name identifying this signal.
info String Additional information about this signal.
symbol String A symbol (ticker) associated with this signal.
quantity Number a numeric value (integer) that indicates a quanity
price Number a 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)
Http.postSignal("trade-signal", "BUY", "Diamond-hand this thing", "AMC", 100, 694.20);