PINE LIBRARY

WebHook Message Generator

Library "WebHook_Message_Generator"

Goal: Simplify the order ticket generation for webhook message

This library has been created in order to simplify the webhook message generation process.
Instead of having to fidget around with string concatenations this method allows you to generate a JSON based message that contains the required information to automte your trades.

How to use?
1) import the library
2) Call the method: GenerateOT () (OT = OrderTicket)
3) Declare your orders:
3.1) Create instances for the buy/sell/close order tickets - store each one in a variable
3.2) Call the variable inside the strategy's function as a alert message: (). You can use the appropriate strategy function depending on your order ticket exemple: or or or ...

4) Set up the alerts to your webhook
5) IMPORTANT to set the alert's message :

DONE! You will now have a dynamic webhook message that will send the correct information to your automation service.

Got Questions, Modifications, Improvements?
Comment below or Private message me!

The method you can import:

GenerateOT(license_id, symbol, action, order_type, trade_type, size, price, tp, sl, risk, trailPrice, trailOffset)
  CreateOrderTicket: Establishes a order ticket following appropriate guidelines.
  Parameters:
    license_id (string): Provide your license id
    symbol (string): Symbol on which to execute the trade
    action (string): Execution method of the trade : "MRKT" or "PENDING"
    order_type (string): Direction type of the order: "BUY" or "SELL"
    trade_type (string): Is it a "SPREAD" trade or a "SINGLE" symbol execution?
    size (float): Size of the trade, in units
    price (float): If the order is pending you must specify the execution price
    tp (float): (Optional) Take profit of the order [price, ticks, percent]
    sl (float): (Optional) Stop loss of the order [price, ticks, percent]
    risk (float): Percent to risk for the trade, if size not specified
    trailPrice (float): (Optional) Price at which trailing stop is starting
    trailOffset (float): (Optional) Amount to trail by [percent, ticks]
  Returns: Return Order string

免責聲明