Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Only 1 quantity squared off

    Python SDK
    0
    1
    2
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      st2024 last edited by

      netpos = obj.position()
      
      if netpos['data'] != None : 
          for o in netpos['data'] :
              if int(o['netqty']) != 0 : 
                  transactiontype = "SELL" if int(o['netqty']) > 0 else "BUY"
                  place_order(o['symboltoken'],o['tradingsymbol'],o['lotsize'],transactiontype,'MARKET',0,'NORMAL',o['exchange'],int(o['netqty'])
                  time.sleep(0.2)
      

      Hey @admin , in the above code, if i have more than 1 quantity of a position, then too only 1 quantity is squared off.
      can you please check??

      1 Reply Last reply Reply Quote 0
      • First post
        Last post