PINE LIBRARY
업데이트됨 StocksDeveloper_AutoTraderWeb

Library "StocksDeveloper_AutoTraderWeb"
AutoTrader Web trading API functions implementation for Trading View.
preparePlaceOrderJson(account, symbol, group, variety) Prepare a place order json
Parameters:
account: Pseudo or group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true to use group account (Default: false)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
Returns: A json message for the given order data
preparePlaceOrderAlertUsingOrderJson(orderJsonArray) Prepare a place order alert message using order json array
Parameters:
orderJsonArray: Order json can contain one or more orders
Returns: A complete alert message to place orders
preparePlaceOrderAlertMessage(account, symbol, group, variety, validity) Prepare a place order alert json message
Parameters:
account: Pseudo or group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true to use group account (Default: false)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
validity: Validity [DAY, IOC] (Default: DAY)
Returns: A complete alert message to place orders
AutoTrader Web trading API functions implementation for Trading View.
preparePlaceOrderJson(account, symbol, group, variety) Prepare a place order json
Parameters:
account: Pseudo or group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true to use group account (Default: false)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
Returns: A json message for the given order data
preparePlaceOrderAlertUsingOrderJson(orderJsonArray) Prepare a place order alert message using order json array
Parameters:
orderJsonArray: Order json can contain one or more orders
Returns: A complete alert message to place orders
preparePlaceOrderAlertMessage(account, symbol, group, variety, validity) Prepare a place order alert json message
Parameters:
account: Pseudo or group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true to use group account (Default: false)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
validity: Validity [DAY, IOC] (Default: DAY)
Returns: A complete alert message to place orders
릴리즈 노트
v2Added:
preparePlaceOrderAlertMessageForTwoOrders(account, symbol, tradeType, group, exchange, quantity, price, orderType, productType, triggerPrice, account2, symbol2, tradeType2, group2, exchange2, quantity2, price2, orderType2, productType2, triggerPrice2) Prepare a place order alert json message for 2 orders
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
tradeType: Trade type [BUY, SELL]
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
quantity: Quantity (Default: 1)
price: Price (Default: 0)
orderType: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET)
productType: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY)
triggerPrice: Trigger price (Default: 0)
account2: Pseudo or Group account number [for order 2]
symbol2: AutoTrader Web's stock/derivative symbol [for order 2]
tradeType2: Trade type [BUY, SELL] [for order 2]
group2: Set it to true if you are using a group account (Default: false) [for order 2]
exchange2: Symbol's exchange [NSE, BSE, MCX] (Default: NSE) [for order 2]
quantity2: Quantity (Default: 1) [for order 2]
price2: Price (Default: 0) [for order 2]
orderType2: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET) [for order 2]
productType2: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY) [for order 2]
triggerPrice2: Trigger price (Default: 0) [for order 2]
Returns: A complete alert message to place 2 orders
calcClosestStrike(underlierPrice, gap) Calculates the closest option strike price as per the given underlier price
Parameters:
underlierPrice: The underlier's price
gap: The gap between option strikes
Returns: the closest option strike price
Updated:
preparePlaceOrderJson(account, symbol, tradeType, group, exchange, quantity, price, orderType, productType, triggerPrice, variety, validity, disclosedQuantity, target, stoploss, trailingStoploss, amo) Prepare a place order json
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
tradeType: Trade type [BUY, SELL]
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
quantity: Quantity (Default: 1)
price: Price (Default: 0)
orderType: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET)
productType: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY)
triggerPrice: Trigger price (Default: 0)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
validity: Validity [DAY, IOC] (Default: DAY)
disclosedQuantity: Disclosed quantity (Default: 0)
target: Target (for Bracket order only) (Default: 0)
stoploss: Stoploss (for Bracket order only) (Default: 0)
trailingStoploss: (for Bracket order only) Trailing Stoploss (Default: 0)
amo: Set it to true for AMO (After Market Order) (Default: false)
Returns: A json message for the given order data
preparePlaceOrderAlertMessage(account, symbol, tradeType, group, exchange, quantity, price, orderType, productType, triggerPrice, variety, validity, disclosedQuantity, target, stoploss, trailingStoploss, amo) Prepare a place order alert json message
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
tradeType: Trade type [BUY, SELL]
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
quantity: Quantity (Default: 1)
price: Price (Default: 0)
orderType: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET)
productType: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY)
triggerPrice: Trigger price (Default: 0)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
validity: Validity [DAY, IOC] (Default: DAY)
disclosedQuantity: Disclosed quantity (Default: 0)
target: Target (for Bracket order only) (Default: 0)
stoploss: Stoploss (for Bracket order only) (Default: 0)
trailingStoploss: (for Bracket order only) Trailing Stoploss (Default: 0)
amo: Set it to true for AMO (After Market Order) (Default: false)
Returns: A complete alert message to place orders
릴리즈 노트
v3Added:
preparePlaceOrderAlertUsingJson(orderJsonArray) Prepare a place order alert message using order json array
Parameters:
orderJsonArray: Order json (can contain one or more orders)
Returns: A complete alert message to place orders
prepareSqOffPositionJson(account, symbol, group, exchange, category, type) Prepare a square-off position json
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
category: Position category [NET, DAY]
type: Position type [MIS, CNC, NRML, BO, CO]
Returns: A json message for the square-off position request
prepareSqOffPositionAlertUsingJson(posJsonArray) Prepare a square-off position alert message using positions json array
Parameters:
posJsonArray: Position json (can contain one or more positions)
Returns: A complete alert message to square-off position
prepareSqOffPositionAlertMessage(account, symbol, group, exchange, category, type) Prepare a square-off position alert json message
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
category: Position category [NET, DAY]
type: Position type [MIS, CNC, NRML, BO, CO]
Returns: A complete alert message to square-off position
prepareSqOffPositionAlertMessageForTwoPositions(account, symbol, group, exchange, category, type, account2, symbol2, group2, exchange2, category2, type2) Prepare a square-off position alert json message for two positions
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
category: Position category [NET, DAY]
type: Position type [MIS, CNC, NRML, BO, CO]
account2: Pseudo or Group account number [for order 2]
symbol2: AutoTrader Web's stock/derivative symbol [for order 2]
group2: Set it to true if you are using a group account (Default: false) [for order 2]
exchange2: Symbol's exchange [NSE, BSE, MCX] (Default: NSE) [for order 2]
category2: Position category [NET, DAY] [for order 2]
type2: Position type [MIS, CNC, NRML, BO, CO] [for order 2]
Returns: A complete alert message to square-off of two positions
prepareFutureSymbol(underlier, expiry) Prepares future symbol for AutoTrader Web
Parameters:
underlier: Underlier symbol (Ex. BANKNIFTY, USDINR, CRUDEOIL)
expiry: Expiry date in (DD-MMM-YYYY) format
Returns: future symbol as per AutoTrader Web's format
prepareOptionSymbol(underlier, expiry, optionType, strike) Prepares option symbol for AutoTrader Web
Parameters:
underlier: Underlier symbol (Ex. BANKNIFTY, USDINR, CRUDEOIL)
expiry: Expiry date in (DD-MMM-YYYY) format
optionType: Option type [CE, PE]
strike: Strike price
Returns: option symbol as per AutoTrader Web's format
Removed:
preparePlaceOrderAlertUsingOrderJson(orderJsonArray) Prepare a place order alert message using order json array
릴리즈 노트
v4Added:
timeIST() Returns current time (HH:mm:ss) in Indian timezone
Returns: current time (HH:mm:ss) in Indian timezone
prepareAdditionalProperties(comments) Additional properties like ticker, price, time etc.
Parameters:
comments: Comments
Returns: additional properties like ticker, time etc.
Updated:
preparePlaceOrderAlertUsingJson(orderJsonArray, comments) Prepare a place order alert message using order json array
Parameters:
orderJsonArray: Order json (can contain one or more orders)
comments: Comments
Returns: A complete alert message to place orders
preparePlaceOrderAlertMessage(account, symbol, tradeType, group, exchange, quantity, price, orderType, productType, triggerPrice, variety, validity, disclosedQuantity, target, stoploss, trailingStoploss, amo, comments) Prepare a place order alert json message
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
tradeType: Trade type [BUY, SELL]
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
quantity: Quantity (Default: 1)
price: Price (Default: 0)
orderType: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET)
productType: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY)
triggerPrice: Trigger price (Default: 0)
variety: Variety [REGULAR, BO, CO] (Default: REGULAR)
validity: Validity [DAY, IOC] (Default: DAY)
disclosedQuantity: Disclosed quantity (Default: 0)
target: Target (for Bracket order only) (Default: 0)
stoploss: Stoploss (for Bracket order only) (Default: 0)
trailingStoploss: (for Bracket order only) Trailing Stoploss (Default: 0)
amo: Set it to true for AMO (After Market Order) (Default: false)
comments: Comments
Returns: A complete alert message to place orders
preparePlaceOrderAlertMessageForTwoOrders(account, symbol, tradeType, group, exchange, quantity, price, orderType, productType, triggerPrice, account2, symbol2, tradeType2, group2, exchange2, quantity2, price2, orderType2, productType2, triggerPrice2, comments) Prepare a place order alert json message for 2 orders
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
tradeType: Trade type [BUY, SELL]
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
quantity: Quantity (Default: 1)
price: Price (Default: 0)
orderType: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET)
productType: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY)
triggerPrice: Trigger price (Default: 0)
account2: Pseudo or Group account number [for order 2]
symbol2: AutoTrader Web's stock/derivative symbol [for order 2]
tradeType2: Trade type [BUY, SELL] [for order 2]
group2: Set it to true if you are using a group account (Default: false) [for order 2]
exchange2: Symbol's exchange [NSE, BSE, MCX] (Default: NSE) [for order 2]
quantity2: Quantity (Default: 1) [for order 2]
price2: Price (Default: 0) [for order 2]
orderType2: Order type [MARKET, LIMIT, STOP_LOSS, SL_MARKET] (Default: MARKET) [for order 2]
productType2: Product type [INTRADAY, DELIVERY, NORMAL] (Default: INTRADAY) [for order 2]
triggerPrice2: Trigger price (Default: 0) [for order 2]
comments: Comments
Returns: A complete alert message to place 2 orders
prepareSqOffPositionAlertUsingJson(posJsonArray, comments) Prepare a square-off position alert message using positions json array
Parameters:
posJsonArray: Position json (can contain one or more positions)
comments: Comments
Returns: A complete alert message to square-off position
prepareSqOffPositionAlertMessage(account, symbol, group, exchange, category, type, comments) Prepare a square-off position alert json message
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
category: Position category [NET, DAY]
type: Position type [MIS, CNC, NRML, BO, CO]
comments: Comments
Returns: A complete alert message to square-off position
prepareSqOffPositionAlertMessageForTwoPositions(account, symbol, group, exchange, category, type, account2, symbol2, group2, exchange2, category2, type2, comments) Prepare a square-off position alert json message for two positions
Parameters:
account: Pseudo or Group account number
symbol: AutoTrader Web's stock/derivative symbol
group: Set it to true if you are using a group account (Default: false)
exchange: Symbol's exchange [NSE, BSE, MCX] (Default: NSE)
category: Position category [NET, DAY]
type: Position type [MIS, CNC, NRML, BO, CO]
account2: Pseudo or Group account number [for order 2]
symbol2: AutoTrader Web's stock/derivative symbol [for order 2]
group2: Set it to true if you are using a group account (Default: false) [for order 2]
exchange2: Symbol's exchange [NSE, BSE, MCX] (Default: NSE) [for order 2]
category2: Position category [NET, DAY] [for order 2]
type2: Position type [MIS, CNC, NRML, BO, CO] [for order 2]
comments: Comments
Returns: A complete alert message to square-off of two positions
릴리즈 노트
v5 Using ticker only as tickerid gave weird data for some underlier which caused json error ("ticker": "={"session":"extended","symbol":"NSE:BANKNIFTY"}")릴리즈 노트
v6Bug fix in prepareSqOffPositionAlertUsingJson
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.