Overview
Signals Position API
Overview
The Signals Position API allows users to start a trading position with
specified configurations. When a POST request is sent to this API, it
initiates the trade, with order management handled on our side. Users can
specify various parameters such as stop loss, target, and execution
configurations.
Endpoint
Live URL:
https://api.algotest.in/webhook/custom-position/execution/start/live?broker_id={broker_id}
Paper (Forward Testing) URL:
https://api.algotest.in/webhook/custom-position/execution/start/paper
Method: POST
Request URL Parameters:
broker_id: The broker id on which you want to trade the position. Copy it from the "Broker Setup" page.
Request Body
The request body should be in JSON format and include the following main components:
access_token: The access token for authentication. Copy it from the profile page.
-
alert_name: The name of the alert triggering the strategy. -
exit_time: The exit time of the strategy. -
strategy: The strategy configuration object.
Strategy Object
Within the strategy object, the following fields are defined:
Ticker: The underlying index or instrument symbol (e.g., NIFTY,
BANKNIFTY, FINNIFTY, MIDCPNIFTY, SENSEX, BANKEX or any NIFTY500
Stock).
Legs: An array of legs, each containing PositionConfig and
ExecutionConfig.
OverallSL: (Optional) Overall Stop Loss/Target configuration for the
entire strategy.
OverallSL
{
"OverallSL": {
"Type": "OverallTgtSLType.MTM",
"Value": 3000
}
}
Legs
Each element in the Legs array represents a specific position and how it
should be executed, defined by:
-
PositionConfig
-
ExecutionConfig
1. PositionConfig
Defines the position details such as instrument type, strike price, expiry, position type, lot size, and stop loss/target configurations.
{
"PositionConfig": {
"EntryType" : "EntryType.EntryByExactStrike",
"InstrumentKind": "LegType.CE",
"StrikeParameter": 23850,
"ExpiryKind": "ExpiryType.Weekly",
"PositionType": "PositionType.Sell",
"Lots": 1,
"LegStopLoss": {
"Type": "None",
"Value": 0
},
"LegTarget": {
"Type": "None",
"Value": 0
},
"LegTrailSL": {
"Type": "None",
"Value": {}
}
}
}
Key Fields:
-
EntryType: Type of the entry (e.g.,EntryType.EntryByExactStrike). -
InstrumentKind: Type of the instrument (e.g.,LegType.CE,LegType.PE,LegType.FUT). -
StrikeParameter: The strike price parameter. Keep it0in case of futures. -
ExpiryKind: The expiry type (e.g.,ExpiryType.Weekly,ExpiryType.NextWeekly,ExpiryType.Monthly). -
PositionType: The type of position (e.g.,PositionType.Buy,PositionType.Sell). -
Lots: Number of lots. -
LegStopLoss: Stop loss configuration for this leg.-
Type:
None, orLegTgtSLType.Points,LegTgtSLType.Percentage, etc. -
Value: Numeric value of the stop loss.
-
-
LegTarget: Target configuration for this leg.-
Type:
None, orLegTgtSLType.Points,LegTgtSLType.Percentage, etc. -
Value: Numeric value of the target.
-
-
LegTrailSL: Trailing stop loss configuration for this leg.-
Type:
None, orTrailStopLossType.Points, etc. -
Value: {
"InstrumentMove": , "StopLossMove":} (forPoints).
-
2. ExecutionConfig
Defines the execution details such as product type, entry/exit order configurations, and reference for stop loss/target calculations.
{
"ExecutionConfig": {
"ProductType": "ProductType.NRML",
"ReferenceForTgtSL": "PriceReferenceType.Trigger",
"EntryOrder": {
"Type": "OrderType.Limit",
"Value": {
"Buffer": {
"Type": "BufferType.Points",
"Value": {
"TriggerBuffer": 0,
"LimitBuffer": 3
}
},
"Modification": {
"MarketOrderAfter": 1
}
}
},
"ExitOrder": {
"Type": "OrderType.Limit",
"Value": {
"Buffer": {
"Type": "BufferType.Points",
"Value": {
"TriggerBuffer": 0,
"LimitBuffer": 3
}
},
"Modification": {
"MarketOrderAfter": 1
}
}
}
}
}
Key Fields:
-
ProductType: The product type (e.g.,ProductType.NRML,ProductType.MIS). -
ReferenceForTgtSL: Reference for target and stop loss (e.g.,PriceReferenceType.Trigger,PriceReferenceType.Trade). -
EntryOrder: Entry order configuration.-
Type:OrderType.MarketorOrderType.Limit. -
Value: Additional order parameters.-
Buffer: Used to define offsets for trigger or limit prices. -
Modification: Settings such asMarketOrderAfter(converts to market if not filled).
-
-
-
ExitOrder: Exit order configuration.-
Type:OrderType.MarketorOrderType.Limit. -
Value: Similar structure toEntryOrder.
-
Additional Configurations
You can add more parameters to fine-tune the strategy, for example:
-
Trigger/Limit Buffers using
BufferType.PointsorBufferType.Percentage. -
Modification parameters such as:
-
ContinuousMonitoringto continuously re-check the fill status. -
MarketOrderAfterto convert to a market order if not filled after the specified number of attempts. -
ModificationFrequencyto limit how frequently order modifications are made.
-
Example Request
Below is a minimal example that demonstrates a strategy on NIFTY with two short option legs and an overall MTM stop loss of 3000.
{
"access_token": "your-access-token",
"alert_name": "custom_strategy",
"exit_time": "2025-11-29T15:15:00",
"strategy": {
"Ticker": "NIFTY",
"Legs": [
{
"PositionConfig": {
"EntryType" : "EntryType.EntryByExactStrike",
"InstrumentKind": "LegType.CE",
"StrikeParameter": 23850,
"ExpiryKind": "ExpiryType.Weekly",
"PositionType": "PositionType.Sell",
"Lots": 1,
"LegStopLoss": { "Type": "None", "Value": 0 },
"LegTarget": { "Type": "None", "Value": 0 },
"LegTrailSL": { "Type": "None", "Value": {} }
},
"ExecutionConfig": {
"ProductType": "ProductType.NRML",
"ReferenceForTgtSL": "PriceReferenceType.Trigger",
"EntryOrder": {
"Type": "OrderType.Limit",
"Value": {
"Buffer": {
"Type": "BufferType.Points",
"Value": {
"TriggerBuffer": 0,
"LimitBuffer": 3
}
},
"Modification": {
"MarketOrderAfter": 1
}
}
},
"ExitOrder": {
"Type": "OrderType.Limit",
"Value": {
"Buffer": {
"Type": "BufferType.Points",
"Value": {
"TriggerBuffer": 0,
"LimitBuffer": 3
}
},
"Modification": {
"MarketOrderAfter": 1
}
}
}
}
},
{
"PositionConfig": {
"EntryType" : "EntryType.EntryByExactStrike",
"InstrumentKind": "LegType.PE",
"StrikeParameter": 23350,
"ExpiryKind": "ExpiryType.Weekly",
"PositionType": "PositionType.Sell",
"Lots": 1,
"LegStopLoss": { "Type": "None", "Value": 0 },
"LegTarget": { "Type": "None", "Value": 0 },
"LegTrailSL": { "Type": "None", "Value": {} }
},
"ExecutionConfig": {
"ProductType": "ProductType.NRML",
"ReferenceForTgtSL": "PriceReferenceType.Trigger",
"EntryOrder": {
"Type": "OrderType.Limit",
"Value": {
"Buffer": {
"Type": "BufferType.Points",
"Value": {
"TriggerBuffer": 0,
"LimitBuffer": 3
}
},
"Modification": {
"MarketOrderAfter": 1
}
}
},
"ExitOrder": {
"Type": "OrderType.Limit",
"Value": {
"Buffer": {
"Type": "BufferType.Points",
"Value": {
"TriggerBuffer": 0,
"LimitBuffer": 3
}
},
"Modification": {
"MarketOrderAfter": 1
}
}
}
}
}
],
"OverallSL": {
"Type": "OverallTgtSLType.MTM",
"Value": 3000
}
}
}
Response Examples
200 - Success
{
"id": "6788c4fb6be04cb2210e9c10"
}
503 - Service Unavailable
{
"msg": "You can only activate strategies during 08:15 IST to 15:29 IST on trading days"
}
API Documentation: Signals API Square-Off
Overview
This API allows users to stop a running position. By sending a POST request to the endpoint with the position ID, you can specify the access token to square off the position.
Endpoint
URL:
https://api.algotest.in/webhook/custom-position/execution/square-off/{position_id}
Method: POST
Request Body
The request body should be in JSON format and include the following main components:
access_token: Your API access token.
Example Request
{
"access_token": "your-access-token"
}