Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting Error in place_order in alphatrade 1.0 #63

Open
vinaydde opened this issue Aug 19, 2023 · 4 comments
Open

getting Error in place_order in alphatrade 1.0 #63

vinaydde opened this issue Aug 19, 2023 · 4 comments

Comments

@vinaydde
Copy link

I am getting following error respsonse while placing order.
Code:
print(
sas.place_order(transaction_type = TransactionType.Buy,
instrument = sas.get_instrument_by_symbol('NSE', 'INFY'),
quantity = 1,
order_type = OrderType.Market,
product_type = ProductType.Delivery,
price = 0.0,
trigger_price = 0.0,
stop_loss = None,
square_off = None,
trailing_sl = None,
is_amo = False)
)

Error:
HTTPError: {"data":{},"error_code":44000,"message":"order_side can't be blank","status":"error"}

@jrdinesh
Copy link

jrdinesh commented Nov 15, 2023

order = {'exchange': instrument.exchange,
'order_type': order_type.value,
'instrument_token': instrument.token,
'quantity': quantity,
'disclosed_quantity': 0,
'price': price,
'transaction_type': transaction_type.value,
'trigger_price': trigger_price,
'validity': 'DAY',
'product': prod_type,
'source': 'web',
'order_tag': order_tag}

transaction_type needs to be replaced with order_side in place_order method

@PushkarSaxena
Copy link

PushkarSaxena commented Feb 13, 2024

this is not working. I tried making changes as suggested in alphatrade.py but still getting same error:

image

@nevatia
Copy link

nevatia commented Feb 13, 2024

Plz try n check solution provided above
transaction_type needs to be replaced with order_side in place_order method.

Or check here
T e l e g r a m /sasonlineunofficial

@coolprafulpl
Copy link

coolprafulpl commented Jul 2, 2024

open alphatrade.py find and replace all transaction_type with order_side

and change this code

    order = {'exchange': instrument.exchange,
             'order_type': order_type.value,
             'instrument_token': instrument.token,
             'quantity': quantity,
             'disclosed_quantity': 0,
             'price': price,
             'transaction_type': transaction_type.value,
             'trigger_price': trigger_price,
             'validity': 'DAY',
             'product': prod_type,
             'source': 'web',
             'order_tag': order_tag}

with this

    order = {'exchange': instrument.exchange,
             'order_type': order_type.value,
             'instrument_token': instrument.token,
             'quantity': quantity,
             'disclosed_quantity': 0,
             'price': price,
             'order_side': order_side.value,
             'trigger_price': trigger_price,
             'validity': 'DAY',
             'product': prod_type,
             "device": 'web',
             "market_protection_percentage":0,
             "user_order_id": order_tag}

and in

def place_order(self, order_side, instrument, quantity, order_type,
                product_type, price=0.0, trigger_price=None,
                stop_loss=None, square_off=None, trailing_sl=None,
                is_amo=False,
                order_tag=10001):

change order_tag value instead of 'python' to numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants