Freak Trade

Benthomas
Hi,
is there any updates on
"Internal dynamic execution range at Zerodha".

Zerodha mentioned in the following link "To calculate this impact cost, the system will consider the best five bids and offers and the quantities available at those prices while placing the order".

How I can code those in Python. Do I need to get the best five Ask for buy or Bid for sell. But the freak trades still can appear in the Bid/Ask market depth.
Please help me giving the logic.

https://zerodha.com/z-connect/traders-zone/freak-trades-in-fo-removal-of-execution-range-the-importance-of-limit-orders-and-more

Thanks
Benny
  • themohammedfaisal
    @Benthomas ,
    We are testing this internally to ensure it smooth and fully accurate. Hoping to be live with this by this month.
    If you'd like to do your own basic version of it, you can calculate the weighted average price of Asks(for Buy) or Bid(for Sell) with the LTP or prev close and set an internal % of spread that you'd like to trade/not trade with.
  • Benthomas
    Thank you so much Faisal.
  • Benthomas
    Hi,
    Does freak trade appears in Bid/Ask market depth as it appears in High/Low prices.
    I just want to take the min(Bid/Ask market depth)*1.2 and pass it as a limit price for a buy order to cover a short position programmatically. Does this approach eliminate the risk of freak trades?
    Please give some logic.

    thanks



  • themohammedfaisal
    A freak trade happens when a market order of a large quantity ends up filing all the depth increasing(buy) or decreasing(sell) the price significantly. With the % you are setting you are ensuring that your orders dont cause a freak trade.
  • Benthomas
    Thank you.

  • Benthomas
    Hi Faisal,
    Sorry to ask you more doubts.
    Does a freak trade increase both Bid and Ask together or any one of them.

    Thanks

Sign In or Register to comment.