StopLoss When Entering Order

Hi,

I found this article about various order types. I tried to use the below to place BUY order and simultaneously put StopLoss

self.broker.OrderRegular(instrument=instrument, order_transaction_type=action, quantity=quantity, order_variety=BrokerOrderVarietyConstants.STOPLOSS_LIMIT, price=price, trigger_price=trigger_price)

But it doesn’t consider trigger_price as StopLoss but considers it to be trigger price to enter the position.

How do I apply StopLoss while entering the order itself?

Hi @Rutul_Patel,

I believe you mean to exit the order if a particular stoploss is hit.

In case my assumption is correct, kindly place a proper entry order, and then apply corresponding stoploss exit order to it,

Kindly reply with further clarification in case I have misunderstood your query.

Thanks,
`Akhil

Thanks for the reply.

Do you I need to put to separate orders?

  1. One for entry
    2 Another for exit once my code decides that stop loss is hit? Or while placing entry order only this stoploss order can be set?

Hi @Rutul_Patel,

You are correct. These are 2 separate orders: one for entry, and another for exit when your logic determines that stoploss has been hit.

`Akhil

Hi @Rutul_Patel,

For Python Build related queries, kindly join our Slack channel.

This community is for marketplace clients only.

We are trying to streamline our support services to maximize client satisfaction, and therefore our team recommends that you join us on Slack for enhanced support with respect to Python Buils queries.

Warm Regards,
`Akhil