The default way to send external signals to Mudrex is via Webhooks. Below is more info on how the Webhook call needs to be made on Mudrex.

1. API to send signals

Users need to use the following API to send signals

https://mudrex.com/api/v1/signals

 

2. Message in API

The actual message about what the signal is needed to be sent in as a JSON payload. Mudrex accepts POST only application/JSON calls to our webhook APIs. We accept the following parameters:

Parameter

Description

 "id"  

 Type: Mandatory

 This is the unique id of the signal strategy.   You can find it on the signal strategy page.

 Eg: "c373164f-2f3d-412f-b672-ba18cb2593a9"

 "action"  

 Type: Mandatory

 This is the action that you want the signal to take. more details below
 Eg: "long_entry"

 "stop_loss_exact_price"  

 Type: Optional

 This is an optional parameter that can be used to set the stop loss as a price value. You need to submit an exact price for this type.
 Eg: "10110"

 "stop_loss_exact_percentage"

 Type: Optional

 This is an optional parameter that can be used to set the Stop Loss as a %. You need to submit a percentage value for this type. No need to include a '%' sign
 Eg: "30" 

"stop_loss_trailing_enabled"

Type: Optional

 This is an optional parameter that is used to define if the Stop Loss type is a trailing stop loss. You need to submit "true" or  "false" as inputs for this.

When this is true, the value in the "stop_loss_exact_percentage" field will be used as the trailing value. Learn more about how trailing SL works here

Eg: "True"

 "take_profit_exact_price"  

 Type: Optional

 This is an optional parameter that can be used to set the Take Profit as a price value. You need to submit an exact price for this Take profit.
Eg: 10200

 "take_profit_exact_percentage"  Type: Optional

 This is an optional parameter that can be used to set the Take Profit as a percentage. You need to submit a percentage value for this type. No need to include a '%' sign
 Eg: "25" 

 "take_profit_trailing_limit_value"  

 Type: Optional

 This is an optional parameter that is to be used when setting up a trailing take profit. This value determines the max % the price can dip once the trailing take profit is activated. Learn more about how trailing TP works here No need to include a '%' sign.
 Eg: "5" 

 "take_profit_trailing_enabled"  

 Type: Optional

 

 This is an optional parameter that is used to define if the Take Profit type is a trailing take profit. You need to submit "true" or  "false" as inputs for this.

 When this is true, the value in the "take_profit_exact_percentage" field will be used to trigger the trail and  "take_profit_trailing_limit_value" as the max dip from trigger. Learn more about how trailing TP works here

Eg: "True"

 

The action can take one of the below 7 values:

Value for action Description
 "long_entry"  Open a "long" position if no position is open
 "long_exit"    Close an open "long" positions
 "short_entry"  Open a "short" position if no position is open
 "short_exit"    Close an open "short" positions
 "reverse_long_to_short"    Closes any open "long" position and then opens a new "short" position. If no "long" position is present then simply opens a new "short" position
 "reverse_short_to_long"     Closes any open "short" position and then opens a new "long" position. If no "short" position is present then simply opens a new "long" position
 "test"  This is just to "test" the API. No actions are taken.

 

Sample message:

{
"id": "c373164f-2f3d-412f-b672-ba18cb2593a9",
"action": "long_entry",
"stop_loss_exact_price": 333,
"take_profit_trailing_enabled": true,
"take_profit_exact_percentage": "10",
"take_profit_trailing_limit_value": "5"
}

Common Mistakes:

  •  One of the most common mistakes is to not add quotes (i.e. sending id instead of "id"). Please make sure that this is added.
  • Leaving open commas ( "," )at the end 

Eg: Here.. the last comma "," is incorrect and will change the msg format to JSON

{
"id": "c373164f-2f3d-412f-b672-ba18cb2593a9",
"action": "long_entry",
}

This is the correct way

{
"id": "c373164f-2f3d-412f-b672-ba18cb2593a9",
"action": "long_entry"
}
  • Trading view alerts are set up for a limited time and they expire. Please make sure

If you need any help using Mudrex then please feel free to write to us at help@mudrex.com

Was this article helpful?
13 out of 16 found this helpful