GTT for option SL and Target

Hi,

I want to

  • Buy Nifty CE/PE using Python code [Done]
  • Place SL and Target immediately after buying [Pending]

My idea is to buy Nifty CE/PE with order slicing enabled (using Place Multi Order | Upstox Developer API ). Once the order is ‘completed’, I want to set stop loss and target at X% from average buy price. I was planning to use GTT API for this, so that I can see the same in chart 360.

However, it seems the current GTT APIs only allows GTT for BUY / SELL with target and SL operations.

Let me put my question this way:

Let’s say I have 48 lots of Nifty 25000 PE 30SEP2025. How do I programmatically set GTT SL and Target orders for the same using API?

Thanks,

Amit

@Pradeep_Jaiswar @MohitGolecha
Help, please :slight_smile:

This is not directly built in @Amit_Kumar_Sharma

We have a big order flow update coming up in a few months. Will probably bake this in then.

Meanwhile, what you can do is use the GTT “immediate” mode. This will send the order to the exchange immediately regardless of the price. Once executed, the SL and TG will automatically be set.

@MohitGolecha That’s not what I want.

Requirement:
I want to enter trade in Nifty options from Python code. Set GTT SL and Target orders so that rest of trade can be driven through Chart 360. Any workaround? Any hack to make it possible?

While buying options, order slicing will happen for sure. So need to stick to multi order API.

Ah understood now. I’ll try this from my end and check if it works if I just send a GTT immediate order with no SL/TG. Maybe then it should be adjustable on the Chart 360 interface.

I’ll try this week, if possible, send in a small order from your end and check na.. Use GTT immediate

Utla :slight_smile:
For a trade already in place, I want to set Target and SL using GTT API so that it shows in Chart 360

Oh acha sorry! My bad

Nope, this capability doesn’t exist yet. Will have that baked in the orderflow release happening in a couple of months!

1 Like

@MohitGolecha @shrini

Ability to set target and sl GTT orders via API can be very useful for algo traders.

Not only does it provide better risk control measure, but it can also help us leverage chart 360 better.

My idea is to programmatically take entry in options, immediately set sl and target gtt orders upon order completion and then switch to chart 360 for manual monitoring.

Hope this helps.

Regards,
Amit

Yep, noted.

Shall build this @Amit_Kumar_Sharma