WebhookJsonMsgLibrary "WebhookJsonMsg"
This webhook json message library provides convenient functions for building JSON messages
Used to manage automatic transaction orders and positions
method buildWebhookJson(msg)
Builds the final JSON payload from a WebhookMessage type.
Namespace types: WebhookMessage
Parameters:
msg (WebhookMessage)
Returns: A JSON Payload.
Dict
Define some constant values
Fields:
OPEN_LONG (series string)
OPEN_SHORT (series string)
CLOSE_LONG (series string)
CLOSE_SHORT (series string)
LIMIT (series string)
MARKET (series string)
U_MARGIN (series string)
C_MARGIN (series string)
SPOT (series string)
WebhookMessage
Webhook message structure.
Fields:
strategyId (series string)
signalNo (series string)
symbol (series string)
symbolType (series string)
orderSide (series string)
price (series string)
orderType (series string)
takeProfitPrice (series string)
stopLossPrice (series string)
timestamp (series string)
accessKey (series string)
Jsonmessage
jsonLibrary "json"
Convert JSON strings to tradingview
▦ FEATURES ▦
█ Json to array █ Get json key names █ Get json key values █ Size of json
get_json_keys_names(raw_json) Returns string array with all key names
Parameters:
raw_json : (string) Raw JSON string
Returns: (string array) Array with all key names
get_values_by_id_name(raw_json, key_name) Returns string array with values of the input key name
Parameters:
raw_json : (string) Raw JSON string
key_name : (string) Name of the key to be fetched
Returns: (string array) Array with values of the input key name
size_of_json_string(raw_json) Returns size of raw JSON string
Parameters:
raw_json : (string) Raw JSON string
Returns: Size of n_of_values, size of n_of_keys_names