Shoonya-Dev / ShoonyaApi-py

139 stars 130 forks source link

AttributeError: 'ShoonyaApiPy' object has no attribute '_NorenApi__username' Please help me to solve this issue #180

Open abhaypatil1 opened 1 week ago

abhaypatil1 commented 1 week ago

i am using the below code for testing purpose and i am getting the error as if prompt1 == 'p': ret = api.place_order(buy_or_sell='B', product_type='C', exchange='NSE', tradingsymbol='CANBK-EQ', quantity=1, discloseqty=0,price_type='SL-LMT', price=200.00, trigger_price=199.50, retention='DAY', remarks='my_order_001') print(ret)

while debuhgging i notice below code is causing the issue from NorenApi.py

prepare the uri

    url = f"{config['host']}{config['routes']['placeorder']}" 
    reportmsg(url)
    #prepare the data
    values              = {'ordersource':'API'}
    values["uid"]       = self.__username
    values["actid"]     = self.__accountid
SHIVANIUM-GIT commented 3 days ago
           ret = api.place_order(
            buy_or_sell="S",
            product_type="I",
            exchange="NFO",
            tradingsymbol=Strike,
            quantity=LOTSIZE,
            discloseqty=0,
            price_type="LMT",
            price=SL_point,
            trigger_price=SL_point,
            retention="DAY",
            remarks="order_sl",
        )
        info(ret)

try this code