How to Use EXECUTE, EXIT, CANCEL, and MODIFY in Different Scenarios

📌 How to Use EXECUTE, EXIT, CANCEL, and MODIFY in Different Scenarios

Your trading system supports various execution methods, including:
Market & Limit Orders (Above/Below Buy & Sell)
Order Modification (Changing price, quantity)
Order Cancellation (Cancel before execution)
Exit Methods (Stoploss, Target, Manual Exit)
Trailing Stoploss (Dynamically adjusting SL as price moves)

I’ll break down each scenario with detailed examples. 🚀


🔹 1️⃣ EXECUTE Order (New Trade Entry)

This places a BUY or SELL order in different conditions.

✅ Scenario 1: Execute a Market Order (Immediate Buy/Sell)

Order Placed:

broker.execute(
instrument="NIFTY50",
transaction_type="BUY",
product_type="MIS",
limit_price=0, # 0 means Market Order
quantity=1
)

This will place an instant market order at the current price.


✅ Scenario 2: Execute a Limit Order (Buy Below or Sell Above)

Buy NIFTY at 19750 when price drops

broker.execute(
instrument="NIFTY50",
transaction_type="BUY",
product_type="MIS",
limit_price=19750,
quantity=1,
below_or_above="BELOW"
)

Sell BANKNIFTY at 44200 when price rises

broker.execute(
instrument="BANKNIFTY",
transaction_type="SELL",
product_type="MIS",
limit_price=44200,
quantity=1,
below_or_above="ABOVE"
)

These orders wait until the price hits the specified level before executing.


🔹 2️⃣ MODIFY Order (Change Price or Quantity)

Modify an existing order before execution.

✅ Scenario 1: Modify Order Price

Change NIFTY order price from 19750 → 19740

broker.modify_order(
instrument_name="NIFTY50",
transaction_type="BUY",
product_type="MIS",
limit_price=19740, # New Price
quantity=1,
order_id="ORDER12345"
)

This updates the pending order’s price.


✅ Scenario 2: Modify Quantity

Increase quantity of an open order from 1 to 2

broker.modify_order(
instrument_name="BANKNIFTY",
transaction_type="SELL",
product_type="MIS",
limit_price=44200,
quantity=2, # New Quantity
order_id="ORDER67890"
)

This updates the order size.


🔹 3️⃣ CANCEL Order (Stop a Pending Order)

Cancel an open order before execution.

✅ Scenario 1: Cancel a Pending Order

broker.cancel_order(order_id="ORDER12345")

If the order hasn’t executed yet, it gets removed.


🔹 4️⃣ EXIT Order (Close an Open Position)

Exit an already executed trade.

✅ Scenario 1: Exit Manually

broker.exit_order(
instrument="NIFTY50",
row_id=5,
exit_price=19800
)

This closes the trade at the current market price.


✅ Scenario 2: Exit When Stoploss is Hit

If an active trade hits stoploss, it automatically exits.

Example:

  • Buy NIFTY at 19800 with Stoploss 19750
broker.execute(
instrument="NIFTY50",
transaction_type="BUY",
product_type="MIS",
limit_price=19800,
quantity=1,
stoploss=19750
)

If the price falls to 19750, the trade exits automatically.


✅ Scenario 3: Exit When Target is Hit

If an active trade hits target, it automatically exits.

Example:

  • Buy BANKNIFTY at 44100 with Target 44200
broker.execute(
instrument="BANKNIFTY",
transaction_type="BUY",
product_type="MIS",
limit_price=44100,
quantity=1,
target=44200
)

If the price reaches 44200, the trade exits automatically.


🔹 5️⃣ Trailing Stoploss (TSL)

Trailing Stoploss adjusts dynamically as price moves in favor.

✅ Scenario 1: Set Trailing SL for a Buy Trade

  • Buy NIFTY at 19800
  • Trailing Stoploss moves up every 10 points
broker.execute(
instrument="NIFTY50",
transaction_type="BUY",
product_type="MIS",
limit_price=19800,
quantity=1,
trailing_sl="YES",
trailing_points=10
)

How it works:

Price Stoploss Moves To
19800 19750
19810 19760
19820 19770

If price drops to the trailing stoploss, it exits automatically.


✅ Scenario 2: Set Trailing SL for a Sell Trade

  • Sell BANKNIFTY at 44200
  • Trailing Stoploss moves down every 20 points
broker.execute(
instrument="BANKNIFTY",
transaction_type="SELL",
product_type="MIS",
limit_price=44200,
quantity=1,
trailing_sl="YES",
trailing_points=20
)

How it works:

Price Stoploss Moves To
44200 44250
44180 44230
44160 44210

If price rises to the trailing stoploss, it exits automatically.


🎯 Summary of All Scenarios

Action Example Status
EXECUTE (Market Order) Buy NIFTY at Market Price
EXECUTE (Limit Order BELOW) Buy NIFTY at 19750
EXECUTE (Limit Order ABOVE) Sell BANKNIFTY at 44200
MODIFY Order Change price from 19750 → 19740
MODIFY Quantity Increase from 1 to 2
CANCEL Order Remove pending order before execution
EXIT Manually Close trade at market price
EXIT at Stoploss Exit Buy at 19750
EXIT at Target Exit Buy at 44200
Trailing Stoploss (BUY) SL moves up every 10 points
Trailing Stoploss (SELL) SL moves down every 20 points

Leave a Reply

STOP LOOSING your hard earned money
Subscribe now to get free demo ID of our software.
Learn Best Intraday Trading Tricks Now !!
    Get Free Demo ID Now
    I agree with the term and condition
    Verified by MonsterInsights