Group Details Private

Global Moderators

Forum wide moderators

  • Angel one is no more a zero broker now
    5 rs per delivery transaction is too high !

    it is difficult to reactance in smallcase portfolio
    Per devilry order per script we need to invest above 5k pulse to workout the brokerage !!!

    read more
  • D

    TSL Order Update होने पर भी पहला SL Modify/Cancel न होने की समस्या के समाधान हेतु अनुरोध

    महोदय,

    सविनय निवेदन है कि मैं SmartAPI (Angel One) का उपयोग करके एक Python-based Trading Script चला रहा हूँ।
    मेरी Script Entry Order एवं Initial Stop Loss (SL-M) Order को सही प्रकार से place कर रही है।

    परंतु समस्या यह आ रही है कि जब Trailing Stop Loss (TSL) Update होता है, तब भी पुराना SL Order Cancel या Modify नहीं हो रहा।
    इसके परिणामस्वरूप Order Book में एक से अधिक SL-M Orders pending दिखाई दे रहे हैं, जो कि गलत execution का कारण बन सकता है।

    समस्या के स्पष्ट विश्लेषण हेतु मैं निम्नलिखित संलग्न कर रहा हूँ:

    • Order Book एवं TSL Update से संबंधित screenshots
    • पूरी Python Trading Script (PDF format)

    आपसे विनम्र अनुरोध है कि कृपया इस व्यवहार की गहन जाँच करें और यह स्पष्ट करें कि:

    TSL Update के समय पुराने SL Order को Cancel/Modify करने की सही API approach क्या है

    क्या SmartAPI में SL-M Orders के लिए कोई विशेष handling या limitation है

    इस समस्या का recommended solution / best practice क्या रहेगा

    आपके सहयोग एवं मार्गदर्शन के लिए मैं आभारी रहूँगा।

    धन्यवाद।

    सादर,
    Diwakar Singh KushwahaOrder Book Screenshot.png ```

    ====================== Order Placement (DUPLICATE SL-M FIX) ======================

    def place_order(transaction_type, trigger_price=None, retries=3):
    global obj, sl_order_id, current_tradingsymbol, current_symboltoken

    if trigger_price is None: base_params = { "variety": "NORMAL", "tradingsymbol": current_tradingsymbol, "symboltoken": current_symboltoken, "transactiontype": transaction_type, "exchange": EXCHANGE, "ordertype": "MARKET", "producttype": PRODUCT_TYPE, "duration": "DAY", "price": "0", "quantity": QUANTITY } else: base_params = { "variety": "STOPLOSS", "tradingsymbol": current_tradingsymbol, "symboltoken": current_symboltoken, "transactiontype": transaction_type, "exchange": EXCHANGE, "ordertype": "STOPLOSS_MARKET", "producttype": PRODUCT_TYPE, "duration": "DAY", "price": "0", "triggerprice": str(trigger_price), "quantity": QUANTITY } attempt = 0 while attempt < retries: try: # TSL Modify if sl_order_id exists if trigger_price is not None and sl_order_id: base_params["orderid"] = sl_order_id response = obj.modifyOrder(base_params) print(f"TSL MODIFIED → Trigger: {trigger_price:.2f} | Resp: {response}") return response # Place new order response = obj.placeOrder(base_params) print(f"{'ENTRY' if trigger_price is None else 'SL-M'} PLACED → {transaction_type} @ {trigger_price or 'MARKET'} | Resp: {response}") if trigger_price is not None and isinstance(response, dict) and response.get('status') == True: sl_order_id = response['data']['orderid'] print(f"SL Order ID Saved: {sl_order_id}") return response except Exception as e: print(f"Order Error (Attempt {attempt+1}): {e}") attempt += 1 time.sleep(1) print("Order Failed after retries!") return None ====================== Cancel SL ======================

    def cancel_sl_order():
    global sl_order_id
    if sl_order_id:
    try:
    response = obj.cancelOrder(sl_order_id, "STOPLOSS")
    print(f"Old SL Canceled | Resp: {response}")
    sl_order_id = None
    except Exception as e:
    print(f"Cancel SL Error: {e}")

    read more
  • W

    I am trying to fetch oi data for a particular symbol
    my function:

    async getHistoricalOI({ symbolToken, interval, from, to }) {
    if (!this.sessionData?.jwtToken) {
    throw new Error('Not authenticated');
    }

    const token = this.getFuturesToken(symbolToken); console.log(token); const response = await axios.post( 'https://apiconnect.angelone.in/rest/secure/angelbroking/historical/v1/getOIData', { exchange: 'NFO', symboltoken: token, interval, fromdate: from, todate: to }, { headers: { 'Authorization': `Bearer ${this.sessionData.jwtToken}`, 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-PrivateKey': CONFIG.API_KEY, 'X-UserType': 'USER', 'X-SourceID': 'WEB', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '127.0.0.1', 'X-MACAddress': '00:00:00:00:00:00' } } ); console.log(response); if (!response.data?.status) { throw new Error(response.data?.message || 'OI API failed'); } return { success: true, interval, data: response.data.data || [] };

    }

    response
    data: {
    message: 'Something Went Wrong, Please Try After Sometime',
    errorcode: 'AB1004',
    status: false,
    data: null
    }

    token used: 1114606 (which is for TCS25DECFUT)
    interval: 'ONE_DAY',
    from: '2025-12-01 09:15',
    to: '2025-12-19 15:30'

    also tried for :
    interval: 'THREE_MINUTE',
    from: '2025-12-19 09:15',
    to: '2025-12-19 15:30'

    read more
  • A

    Hi @brijeshbriji16

    Which API are you using to Login ?

    read more