{"text_format":"1","workbook":"xlsx","n_sheets":22,"sheets":["Chart1","Gain_Prob","Pegging","Discretion","Bid-Ask-Vwap","Bid-Ask","Microsoft_eg","VWAP","Pegging+Discretion","Pegging+Discretion_Sell","Guerilla","Defns","TTH","Algo1","Algo2_Stub","EV of modifying_1","EV of modifying_2","Pegging with Threshold","Pegging with Threshold_sign siz","DR_tips","Post only","Sheet1"],"not_rendered":{"charts":6,"images":0,"macros":1,"external_links":0,"defined_names":0,"comments":0,"pivot_tables":0},"unopened":[{"sheet":"Chart1","index":0,"reason":"not_a_worksheet"},{"sheet":"Bid-Ask-Vwap","index":4,"reason":"not_a_worksheet"},{"sheet":"Bid-Ask","index":5,"reason":"not_a_worksheet"}],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"Gain_Prob","index":1,"n_rows":25,"n_cols":8,"rows_kept":25,"cut":false,"hidden":false,"merged":[]}
[]
[null,"Order Book"]
["Level","Bid ","Ask","Fair price (Assumed)","Bid-ask spread"]
[1,100,100.5,100.25,{"$f":"C4-B4","v":0.5},null,null,"Best bid @100 and best ask at 100.5"]
[2,99.5,101.25,100.25,null,null,null,"I will earn 50 cents"]
[3,99,101.5,100.25]
[4,98.25,102.5,100.25,null,null,null,"Best bid @99.5 and best ask at 101"]
[5,98,103,100.25,null,null,null,"I will earn 150 cents"]
[]
[]
[]
["Level","Gains","Probability","of getting a fill"]
[1,{"$f":"D4-B4","v":0.25},0.51110862262038104]
[2,{"$f":"D5-B5","v":0.75},0.25036954087345997]
[3,1.25,0.11422172452407615]
[4,2,6.7189249720044794E-2]
[5,2.25,5.7110862262038077E-2]
[]
[]
["Level","EV"]
[1,{"$f":"B13*C13","v":0.12777715565509526}]
[2,{"$f":"B14*C14","v":0.18777715565509498}]
[3,0.14277715565509519]
[4,0.13437849944008959]
[5,0.12849944008958566]

{"sheet":"Pegging","index":2,"n_rows":48,"n_cols":12,"rows_kept":48,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,"At the buy side"]
[null,"Order Book",null,"Pegging order: is a limit order where the price of the order is dependent on the price of a particluar level of the Order book"]
["Level","Bid ","Ask"]
[1,100,100.5]
[2,99.5,101]
[3,99,101.5]
[4,98.25,102.5]
[5,98,103]
[]
[]
["An order that is pegged at say Level 1"]
["Whatever the best bid is: I will fire an order 1 tick (5 cents more than the best bid), I will not consider my own bid when evaluating the best bid"]
["My order is pegged at level 1 bid"]
[]
["Example 1"]
["I will therefore fire my order at 100.05!!"]
["If the order at 100 moves to 100.05, then I would modify my order to 100.1!!"]
[]
["Example 2"]
["An order that is pegged at say Level 2"]
["Whatever the second best bid is: I will fire an order 1 tick (5 cents more than the second best bid)"]
["My order is pegged at level 2 bid"]
[]
[]
["My order was pegged to Level 2 (5 cents above the 2nd Level)"]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100,100.5]
[2,99.55,101]
[3,99.5,101.5]
[4,99,102.5]
[5,98.25,103]
[null,98]
[]
["A tick is fired at 100.2, how will I modify my order?"]
[null,"Order Book",null,null,null,null,null,null,null,"Order Book"]
["Level","Bid ","Ask",null,null,null,null,null,"Qty","Bid ","Ask","Qty"]
[1,100.2,100.5,null,null,null,null,null,100,100.2,100.5,200]
[2,100,101,null,null,null,null,null,50,100.05,101,300]
[3,99.55,101.5,null,null,null,null,null,150,100,102,400]
[4,99.5,102.5]
[5,99,103,null,null,null,null,"Ques","Fires a Sell order for 100 with a QTY of 200"]
[null,98.25,null,null,null,null,null,null,"What would be the price of the fills that he will get?"]
[null,98,null,null,null,null,null,"Answer","Qty","Price"]
[null,null,null,null,null,null,null,null,100,100.2]
["Here I will fire an order at 100.05",null,null,null,null,null,null,null,50,100.05]
[null,null,null,null,null,null,null,null,50,100]

{"sheet":"Discretion","index":3,"n_rows":44,"n_cols":10,"rows_kept":44,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,null,"Discretion order"]
[null,"Order Book",null,null,"You would give your broker/code a discretion: that it can modify the price of an order by a certain amount if it can get traded!"]
["Level","Bid ",null,"Ask","Example:"]
[1,100,null,100.5,"You fire a Buy limit order at 100, with a discretion range of 10 cents"]
[2,99.5,null,101]
[3,99,null,101.5]
[4,98.25,null,102.5]
[5,98,null,103]
[]
[]
[]
["10:00am",null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask",null,"With a discretion range of 10 cents"]
[null,1,null,100,100.5,null,"Your code knows that it can modify the price till 100.1, if there is an ask at that price!!"]
[null,2,null,99.75,100.5]
[null,3,null,99.5,101]
[null,4,null,99,101.5]
[null,5,null,98.25,102.5]
[null,null,null,98,103]
["10:05:00"]
[null,null,null,"Order Book",null,"Then your discretion range will be used, and your order will be modfied to 100.1, so that it gets executed!"]
[null,"Level",null,"Bid ","Ask"]
[null,1,null,100,100.1]
[null,2,null,99.75,100.5]
[null,3,null,99.5,101]
[null,4,null,99,101.5]
[null,5,null,98.25,102.5]
[null,null,null,98,103]
[]
["Think in term of Expected Value"]
[]
["Case 1: No discretion range is used."]
[]
["Case 2: Discretion range of 10 cents is used.",null,null,null,null,null,"Given:"]
[null,null,null,null,null,null,"Fair price is 100.25"]
[]
["EV for Case 1: ",null,null,null,null,null,"0.5 is the prob of getting a trade at best bid"]
["EV = prob of getting traded * profit of trade",null,null,null,null,null,"profit= fair price - traded price",null,null,"(buy )"]
["=0.5 * 0.25",null,"=0.125"]
[]
["EV for Case 2: "]
["EV = prob of getting traded * profit of trade",null,null,null,null,null,"profit = 100.25-100.1"]
["=1 * 0.15",null,"=0.15",null,null,null,{"$f":"0.15","v":0.15}]

{"sheet":"Microsoft_eg","index":6,"n_rows":30,"n_cols":9,"rows_kept":30,"cut":false,"hidden":false,"merged":[]}
["Client calls you at 10:00am, and says he wants you to buy 30,000 shares of Microsoft at the best possbile price today!!!"]
["Objective: Buy 30,000 shares of Microsoft by 3:00pm"]
[]
[null,null,null,null,null,"=D6*E6","=SUM($F$6:F6)/SUM($D$6:D6)"]
["Time","Bid","Ask","Total Qty traded in mkt","Avg TRADE Price","TP*Vol traded","VWAP",null,"So the traders buys 6000 qty each hour "]
["10:00:00",920,921.3,5000,{"$f":"AVERAGE(B6:C6)","v":920.65},{"$f":"D6*E6","v":4603250},{"$f":"SUM($F$6:F6)/SUM($D$6:D6)","v":920.65},null,"and gets the avg price of $925"]
[{"$f":"A6+15/24/60","v":"10:15:00"},920.4,921.5,15000,{"$f":"AVERAGE(B7:C7)","v":920.95},{"$f":"D7*E7","v":13814250},{"$f":"SUM($F$6:F7)/SUM($D$6:D7)","v":920.875}]
[{"$f":"A7+15/24/60","v":"10:30:00"},921.2,922.3,7500,921.75,{"$f":"D8*E8","v":6913125},{"$f":"SUM($F$6:F8)/SUM($D$6:D8)","v":921.11363636363637}]
["10:45:00",920,921,10000,920.5,9205000,{"$f":"SUM($F$6:F9)/SUM($D$6:D9)","v":920.95},null,"3:00pm "]
["11:00:00",922.8,923.5,50000,923.15,46157500,{"$f":"SUM($F$6:F10)/SUM($D$6:D10)","v":922.20714285714291},null,"Buy the shares @ avg of $925"]
["11:15:00",923.4,924.7,150000,924.05,138607500,{"$f":"SUM($F$6:F11)/SUM($D$6:D11)","v":923.37105263157889},null,"Is it a good buy or a bad buy?"]
["11:30:00",924,924.7,5000,924.35,4621750,{"$f":"SUM($F$6:F12)/SUM($D$6:D12)","v":923.3912371134021},null,"What is the criteria?"]
["11:45:00",924.8,925.5,125000,925.15,115643750,{"$f":"SUM($F$6:F13)/SUM($D$6:D13)","v":923.98945578231292}]
["12:00:00",923.2,923.6,10000,923.40000000000009,9234000,{"$f":"SUM($F$6:F14)/SUM($D$6:D14)","v":923.97384105960271}]
["12:15:00",924.2,924.5,17000,924.35,15713950,{"$f":"SUM($F$6:F15)/SUM($D$6:D15)","v":923.99005069708494}]
["12:30:00",925,925.5,150000,925.25,138787500,{"$f":"SUM($F$6:F16)/SUM($D$6:D16)","v":924.33714416896237}]
["12:45:00",926.7,927,2500000,926.85,2317125000,{"$f":"SUM($F$6:F17)/SUM($D$6:D17)","v":926.40058301855811}]
["13:00:00",928.2,928.9,5000000,928.55,4642750000,{"$f":"SUM($F$6:F18)/SUM($D$6:D18)","v":927.73653738579151}]
["13:15:00",927,927.1,500000,927.05,463525000,{"$f":"SUM($F$6:F19)/SUM($D$6:D19)","v":927.6963631575868}]
["13:30:00",926.5,927,650000,926.75,602387500,{"$f":"SUM($F$6:F20)/SUM($D$6:D20)","v":927.62946054706617}]
["13:45:00",926,926.7,15000000,926.35,13895250000,{"$f":"SUM($F$6:F21)/SUM($D$6:D21)","v":926.83622620843585}]
["14:00:00",927.5,928,1500000,927.75,1391625000,{"$f":"SUM($F$6:F22)/SUM($D$6:D22)","v":926.8895707252525}]
["14:15:00",929,929.2,25000,929.1,23227500,{"$f":"SUM($F$6:F23)/SUM($D$6:D23)","v":926.89171931802719}]
["14:30:00",930.2,930.5,5000000,930.35,4651750000,{"$f":"SUM($F$6:F24)/SUM($D$6:D24)","v":927.45459968423961}]
["14:45:00",931.1,931.5,150000,931.3,139695000,{"$f":"SUM($F$6:F25)/SUM($D$6:D25)","v":927.47328511961643}]
["15:00:00",930.5,930.8,10000,930.65,9306500,{"$f":"SUM($F$6:F26)/SUM($D$6:D26)","v":927.47431386518565}]
[null,null,null,{"$f":"SUM(D6:D26)","v":30879500},null,{"$f":"SUM(F6:F26)","v":28639943075}]
[]
[]
[null,null,null,null,null,{"$f":"F27/D27","v":927.47431386518565}]

{"sheet":"VWAP","index":7,"n_rows":26,"n_cols":11,"rows_kept":26,"cut":false,"hidden":false,"merged":[]}
[]
["Client calls you at 10:00am, and says he wants you to buy 30,000 shares of Microsoft at the best possbile price today!!!"]
[null,null,"Vol. Wt avg hourly Price","No. of shares traded at that price in the market",null,null,null,null,null,"VWAP"]
[null,"10:00am ",920,50000,null,null,null,null,null,{"$f":"D4*C4","v":46000000}]
[null,"11:00am",923,25000,null,null,null,null,null,{"$f":"D5*C5","v":23075000}]
[null,"12:00noon",925,20000,null,null,null,null,null,18500000]
[null,"2:00pm",928,100000,null,null,null,null,null,92800000]
[null,"3:00pm",930,75000,null,null,null,null,null,69750000,"Total Volume"]
[null,null,null,null,null,null,null,null,"Cumm Price*Vol",{"$f":"SUM(J4:J8)","v":250125000},{"$f":"SUM(D4:D8)","v":270000}]
[null,"You got an average price of $925!!"]
[null,null,null,null,null,null,null,null,"VWAP",{"$f":"J9/K9","v":926.38888888888891}]
[]
[]
[]
[]
[]
[]
[]
[]
[]
["One way to compare if the price was good/bad is VWAP"]
[]
[]
[null,null,"VWAP = ","=D4*C4","+D6*C6","and so on…",null,"divide it by total amount of shares traded!!"]
[]
[null,null,null,{"$f":"SUMPRODUCT(C4:C8,D4:D8)/SUM(D4:D8)","v":926.38888888888891}]

{"sheet":"Pegging+Discretion","index":8,"n_rows":65,"n_cols":7,"rows_kept":65,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,null,null,"Blending Pegging order and Discretion order"]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100,100.5]
[2,99.5,101]
[3,99,101.5]
[4,98.25,102.5]
[5,98,103]
[]
[]
[]
["Example:"]
["I will peg my Buy limit order at Best bid + 10 cents, with a discretion range of 20 cents"]
[]
[]
[null,"10:00am",null,"Order Book"]
[null,null,"Level","Bid ","Ask",null,"With a discretion range of 20 cents"]
[null,null,1,100.1,100.5,null,"Your code knows that it can modify the price till 100.3, if there is an ask at that price!!"]
[null,null,2,100,100.5]
[null,null,3,99.5,101]
[null,null,4,99,101.5]
[null,null,5,98.25,102.5]
[null,null,null,98,103]
["Case 1","10:05:00"]
["A sell order comes @100.3"]
[null,null,null,"Order Book",null,null,"Then your discretion range will be used, and your order will be modfied to 100.3, so that it gets executed!"]
[null,null,"Level","Bid ","Ask"]
[null,null,1,100.1,100.3]
[null,null,2,100,100.5]
[null,null,3,99.5,101]
[null,null,4,99,101.5]
[null,null,5,98.25,102.5]
[null,null,null,98,103]
["Case 2"]
["If a new  buy order comes at 100.2"]
[null,"10:05am",null,"Order Book"]
[null,null,"Level","Bid ","Ask"]
[null,null,1,100.2,100.5]
[null,null,null,100.1,100.5]
[null,null,2,100,101]
[null,null,3,99.5,101.5]
[null,null,4,99,102.5]
[null,null,5,98.25,103]
[null,null,null,98]
[]
["I will modify my buy order at 100.1 to 100.3 (10 cents better than the best bid)"]
[100.3]
["I will use my discretion range to fire an order at 100.5!!"]
[]
["Because of pegging we will fire an order at 100.3"]
["Case 2","10:05am",null,"Order Book"]
[null,null,"Level","Bid ","Ask"]
[null,null,1,100.3,100.5]
[null,null,2,100.2,100.5]
[null,null,3,100,101]
[null,null,4,99.5,101.5]
[null,null,5,99,102.5]
[null,null,null,98.25,103]
[null,null,null,98]
[]
["Now the discretion range will come into play!"]
["Discretion order will be fired, which means we will modify our order at 100.3 to 100.5"]
[]
["The check for discretion range would be: The price after using discretion range should not be above the FAIR Price"]

{"sheet":"Pegging+Discretion_Sell","index":9,"n_rows":74,"n_cols":7,"rows_kept":74,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,null,null,"Blending Pegging order and Discretion order"]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100,100.5]
[2,99.5,101]
[3,99,101.5]
[4,98.25,102.5]
[5,98,103]
[]
[]
[]
["Example:"]
["I will peg my SELL limit order at Best Ask - 10 cents, with a discretion range of 20 cents"]
[]
[]
[null,"10:00am",null,"Order Book"]
[null,null,"Level","Bid ","Ask",null,"With a discretion range of 20 cents"]
[null,null,1,100,100.4,null,"Your code knows that it can modify the price till 100.2, if there is a bid at that price!!"]
[null,null,2,99.5,100.5]
[null,null,3,99,101]
[null,null,4,98.25,101.5]
[null,null,5,98,102.5]
[null,null,null,null,103]
["Case 1","10:05:00"]
["A buy order comes @100.2"]
[null,null,null,"Order Book",null,null,"Then your discretion range will be used, and your order will be modfied to 100.2, so that it gets executed!"]
[null,null,"Level","Bid ","Ask"]
[null,null,1,100.2,100.4]
[null,null,2,100,100.5]
[null,null,3,99.5,101]
[null,null,4,99,101.5]
[null,null,5,98.25,102.5]
[null,null,null,98,103]
["Case 2"]
["If a new  sell order comes at 100.3"]
[null,"10:05am",null,"Order Book"]
[null,null,"Level","Bid ","Ask"]
[null,null,1,100,100.3]
[null,null,null,99.5,100.4]
[null,null,2,99,100.5]
[null,null,3,98.25,101]
[null,null,4,98,101.5]
[null,null,5,null,102.5]
[null,null,null,null,103]
[]
["I will modify my sell order at 100.4 to 100.2 (10 cents better than the best ASK)"]
[]
["I will use my discretion range to fire a SELL order at 100!!"]
[]
["Because of pegging we will fire an order at 100"]
["Case 2","10:05am",null,"Order Book"]
[null,null,"Level","Bid ","Ask"]
[null,null,1,100,100.2]
[null,null,2,99.5,100.3]
[null,null,3,99,100.5]
[null,null,4,98.25,101]
[null,null,5,98,101.5]
[null,null,null,null,102.5]
[null,null,null,null,103]
[]
["Now the discretion range will come into play!"]
["Discretion order will be fired, which means we will modify our order at 100.2 to 100.0"]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
["The check for discretion range would be: The price after using discretion range should not be above the FAIR Price"]

{"sheet":"Guerilla","index":10,"n_rows":46,"n_cols":10,"rows_kept":46,"cut":false,"hidden":false,"merged":[]}
["Guerilla bots"]
[null,null,"Bid","Ask","Fair Price",null,"Loss coz of a market order"]
[null,null,100,101,100.5,null,0.5]
[]
[]
[]
["Our Strategy",null,"Peg your order at best bid + 10 cents"]
[]
["Your order",null,"Bid","Ask"]
[null,null,100.1,101]
[]
["Another player who has pegged  his order at 5 cents above the best bid"]
["2nd player order"]
[null,null,"Bid","Ask"]
[null,null,100.15,101]
[]
["Because the Best Bid has changed our strategy will now fire another order"]
["Your order",null,"Bid","Ask"]
[null,null,100.25,101]
[]
["How can a Guerilla algo game you?"]
[]
["If your pegging logic is only to be 5 cents better than the best bid:"]
[null,null,"Bid ","Ask"]
[null,null,100,101]
[null,null,"You fire an order at 100.05 for 1000 qty"]
[]
[]
["Guerilla algo: fire an order for 100.2 with qty 10 shares"]
[null,null,"Bid","Ask"]
[null,null,100.2,101]
[]
["You fire an order at 100.25 for 1000qty"]
[null,null,"Bid","Ask"]
[null,null,100.25,101]
[]
["Guerilla algo: fire an order for 100.8 with qty 1 shares"]
[null,null,"You fire an order at 100.85 for 1000qty"]
[]
["Guerilla algo: fire a Sell order for 100.85 with qty 1000 shares"]
[]
[null,null,"You get a buy at 100.85 and he gets a sell at 100.85",null,null,null,null,null,null,"Guerilla will fire a sell for 1000 shares at 100.85 "]
[null,"Market comes back to its original price"]
[null,null,"Bid ","Ask"]
[null,null,100,101]
[null,"Guerilla algo: fire a Buy order for 100.5 with qty 1000 shares to sq off his position"]

{"sheet":"Defns","index":11,"n_rows":29,"n_cols":7,"rows_kept":29,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,null,"Order Book"]
["10:00am",null,"Level","Qty","Bid ","Ask","Qty"]
["Same side depth ","5 traders/5 orders@100 with 100 qty each",1,500,100,100.5,100]
[500,null,2,250,99.5,101,200]
["Same side depth till level 2",null,3,100,99,101.5,50]
[750,null,4,300,98.25,102.5,10]
[null,null,5,500,98,103,30]
[]
["10:15am","Trader1 fires an order of size 200 @100.1"]
[null,null,null,null,"Order Book"]
[null,null,"Level","Qty","Bid ","Ask","Qty"]
["ALONE ","1 trader/order @100.1 with 200 qty",1,200,100.1,100.5,100]
["Same side depth ",null,{"$f":"C13+1","v":2},500,100,101,200]
[200,null,{"$f":"C14+1","v":3},250,99.5,101.5,50]
[null,null,4,100,99,102.5,10]
[null,null,5,300,98.25,103,30]
[null,null,6,500,98]
[]
[null,"1 order will be assumed as a single trader!"]
[]
["Case 1"]
[null,"10:01am","Buy order @100.1 for 500 qty",null,null,null,"then I will say order is alone"]
[]
["Case 2","10:01am","Buy order @100.1 for 100 qty",null,null,null,"at this instant the order was alone"]
[null,"10:01.0001am","Buy order @100.1 for 100 qty",null,null,null,"FROM HERE ONWARDS THE ORDER IS NOT ALONE"]
[null,"10:01.0002am","Buy order @100.1 for 100 qty"]
[null,"10:01.0005am","Buy order @100.1 for 100 qty"]
[null,"10:01.0008am","Buy order @100.1 for 100 qty"]

{"sheet":"TTH","index":12,"n_rows":37,"n_cols":9,"rows_kept":37,"cut":false,"hidden":false,"merged":[]}
[]
[null,"Liquidity","Urgency"]
[null,null,"Liquidity/Urgency","Low","Medium","High",null,"Algo","Efficiency (in terms of volume traded)"]
[null,null,"Low","Y",null,null,null,"Y",0.01]
[null,null,"Medium",null,"Z",null,null,"Z",0.05]
[null,null,"High",null,null,"X",null,"X",0.15]
[]
[null,"Algorithm X to trade a very liquid stock with high urgency!!!!"]
[]
[]
["Example","Client wants you to buy 10000 shares of AXISBANK in a day!!"]
["Given based on historical data"]
["AXISBANK"," #of shares traded"]
[null,180000,"shares in a day"]
[null,{"$f":"B14/6","v":30000},"shares/hour"]
[]
[null,{"$f":"B15/60","v":500},"shares/min"]
[]
[]
["Given:Urgency of my client is HIGH"]
["I will use algorithm X to trade this order!!"]
["Based on my experience I know this"]
["The efficiency of this algorithm is 15% of total market volume!!"]
[]
["if 500 shares get traded in a min, I will be able to trade 500*15% in a min!!"]
["=500*0.15 ","shares/min through my algo X"]
[{"$f":"500*0.15","v":75},"shares/min through my algo X",null,"Shares to be traded",null,10000]
[null,null,null,null,null,{"$f":"F27/A27","v":133.33333333333334},"minutes",null,"133.33*75 shares per minute = 10000 shares"]
[]
[]
[null,"TTH =","Order shares/vol. ratio /Min vol"]
[null,"Theoretical Time Horizon"]
[null,"Client Order","Order shares",10000]
[null,null,"Vol ratio (Efficieny of algo)",0.15,"Urgency high",null,"X (algo)"]
[null,null,"Min vol",500,"/min"]
[null,null,null,null,null,null,{"$f":"500*0.15","v":75},"shares /min"]
[null,null,"TTH =",{"$f":"D33/D34/D35","v":133.33333333333334},"minutes",null,{"$f":"D33/G36","v":133.33333333333334},"minutes"]

{"sheet":"Algo1","index":13,"n_rows":62,"n_cols":7,"rows_kept":62,"cut":false,"hidden":false,"merged":[]}
[]
["EXCHANGE",null,"Order Router/Order Manager"]
[]
[]
["Market adaptor",null,"Strategy"]
[]
[]
[null,null,"Triggers for your algorithm"]
[null,"ON price level change","Price level change in the best Bid or best ASK/change in vwap"]
[null,"On Fill/trade","TRADE or FILL"]
[null,"ON ack","Acknowldgement"]
[]
[]
[]
[]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100,100.5]
[2,99.5,101]
[3,99,101.5]
[4,98.25,102.5]
[5,98,103]
[]
[null,"1. You will check if your order book is stable!!",null,null,null,null,"If there are atleast 5 levels in the order book"]
[null,"2. Yes there is a pegging logic at 5 cents above the best bid",null,null,null,null,"If the Bid-ask spread is not greater than 1% of the best bid"]
[null,"3. Discretion at 20 cents"]
[null,"4. The BUY order price should not be above the Fair Price",null,null,null,null,"The Fair Price in this example is say 100.3"]
["Step 1:","Fire a pegged order"]
[]
["10:00am"]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100.05,100.5]
[2,100,101]
[3,99.5,101.5]
[4,99,102.5]
[5,98.25,103]
[null,98]
["A sell order comes at 100.2"]
["10:05am"]
[]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100.05,100.2]
[2,100,101]
[3,99.5,101.5]
[4,99,102.5]
[5,98.25,103]
[null,98]
[]
["Step 2:","I will check if a Discretion order has been fired or not?"]
[null,"I will fire a modify from 100.05 to 100.2"]
["10:05.01am"]
[]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100.2,100.5,null,null,"Our Bid is the best market bid now, discretion price is the price at which I fired my order (because of discretion range)"]
[2,100,101]
[3,99.5,101.5]
[4,99,102.5]
[5,98.25,103]
[null,98]

{"sheet":"Algo2_Stub","index":14,"n_rows":31,"n_cols":12,"rows_kept":31,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
[null,null,null,"Order Book",null,null,null,null,null,null,null,"Say the client had asked us to trade 100,000 shares"]
[null,"Level",null,"Bid ","Ask"]
[null,1,1000,100,100.5,200,null,null,null,null,null,"We are firing a pegged + discretion order for 1000 qty!!"]
[null,2,400,99.95,101,500]
[null,3,300,99,101.5,500,null,null,null,null,null,"What can happen:"]
[null,4,300,98.25,102.5,500,null,null,null,null,null,"I can get a partial fill!!!!"]
[null,5,300,98,103,500,null,null,null,null,null,"And then I need to decide whether I have to modify my order or do nothing!!"]
[]
["You had fired an order at 100 for 1000 qty (because my algo was pegged at 5 cents better than the bid)"]
["and you got a partial fill at 100 for 400 shares!!!"]
[]
[]
[]
["10:00am",null,null,"Order Book"]
[null,"Level","Qty","Bid ","Ask","Qty"]
[null,1,600,100,100.5,200,null,null,"Whether I need to modify this order's qty to 1000 again!!"]
[null,2,400,99.95,101,500]
[null,3,300,99,101.5,600]
[null,4,300,98.25,102.5,500]
[null,5,300,98,103,50]
[]
[]
["CONDITION"]
["If my stub calculation is that I will consider an order as a stub order only if 20% of the original is remaning!!"]
[]
[]
["Logic: If stub remains----> Modify the order and replenish the QTY"]
["If stub doesn't remain---> then do nothing"]

{"sheet":"EV of modifying_1","index":15,"n_rows":35,"n_cols":9,"rows_kept":35,"cut":false,"hidden":false,"merged":[]}
[]
[]
["t=0",null,null,null,null,null,null,"Total shares to be BOUGHT",100000]
[null,"Qty","Order Book",null,null,null,null,"Shares bought till now",10000]
["Level",null,"Bid ","Ask","Qty",null,null,"Reserve Left",{"$f":"I3-I4","v":90000}]
[1,1000,100,100.2,500]
[2,100,99.5,101,100]
[3,500,99,101.5,300]
[4,10000,98.25,102.5,500]
[5,null,98,103,10000]
[]
["Step 1"]
["You are placing order of size 1000 at a particular price"]
["Step 2"]
["You need to add/modify your order depending upon fills and price changes"]
[]
["Say, you get a partial fill of 900 shares at $100"]
["And, a 3rd party order comes in for 1000 shares at the best bid"]
[]
[null,"Qty","Order Book"]
["Level",null,"Bid ","Ask","Qty"]
[1,1100,100,100.2,500]
[2,100,99.5,101,100]
[3,500,99,101.5,300]
[4,10000,98.25,102.5,500]
[5,null,98,103,10000]
[]
[]
["What will you do?"]
[]
["Case 1","If I find that a stub of my order remains, I add 900 qty at the same price level"]
["Case 2","If I find that a stub of my order remains I send a new pegged order (at best bid + 1 tick) for 1000 qty"]
["Case 3","If I find that a stub of my order remains I send a new pegged order (at best bid + 1 tick) for 900 qty and don't cancel the 100 qty at $100"]
["Known to us"]
["The prob of executing at the best level is 0.6 for the first 1000 qty and 0.1 for the next thousand"]

{"sheet":"EV of modifying_2","index":16,"n_rows":62,"n_cols":16,"rows_kept":62,"cut":false,"hidden":false,"merged":[]}
[]
[null,"Qty","Order Book",null,null,null,"Assumption",null,null,null,null,null,null,"Best Bid","Best Ask"]
["Level",null,"Bid ","Ask","Qty",null,"Fair price ",null,null,null,null,"Level 1",1700,100,101,2500]
[1,"1100 (100 shares of my order + 1000 shares of 3rd party)",100,100.2,500,null,100.1]
[2,100,99.5,101,100,null,null,null,null,null,null,null,null,"Best Bid"]
[3,500,99,101.5,300,null,null,null,null,null,null,"Order 1",500,100]
[4,10000,98.25,102.5,500,null,null,null,null,null,null,"Order 2",200,100]
[5,null,98,103,10000,null,null,null,null,null,null,"Order 3",300,100]
[null,null,null,null,null,null,null,null,null,null,null,"Order 4",700,100]
[]
["Case 1","If I find that a stub of my order remains, I add 900 qty at the same price level (at $100)"]
["Case 2","If I find that a stub of my order remains I send a new pegged order (at best bid + 1 tick), and cancel the 100 qty at $100"]
["Case 3","If I find that a stub of my order remains I send a new pegged order (at best bid + 1 tick) for 900 qty and don't cancel the 100 qty at $100"]
["Known to us"]
["The prob of executing the first 1000 qty at whichever level is 0.6 and 0.1 for the next two thousand qty"]
[]
["Fair price right now is 100.1"]
["Profit = Fair price - price of trade"]
["Expected value of profit from my trade!!"]
["Case 1","EV = 0.6*100*0.1 + 0.1*900*0.1","$15",null,"EV of profit for 100 shares",null,null,null,"EV of profit for 900 shares"]
[null,"prob of getting a trade*no of shares traded*profit",null,null,"Probability of 100 shares getting traded * profit * Qty",null,null,null,"Probability of 900 shares getting traded * profit * Qty"]
[null,null,null,null,"=0.6*0.1*100",null,null,null,"=0.1*0.1*900"]
["Case 2","If I peg it at 100.05"]
[null,"EV = 0.6*1000*0.05",{"$f":"0.6*1000*0.05","v":30}]
[]
["Case 3","EV = 100*0.6*0.1 + 900*0.6*0.05",{"$f":" 100*0.6*0.1 + 900*0.6*0.05","v":33}]
[]
[]
[]
[]
[]
[null,null,null,null,"Case 1"]
[null,null,null,null,"Qty","Bid ","Ask"]
[null,null,null,null,"100+1000+900",100,100.2]
[null,null,null,null,null,99.5,101]
[null,null,null,"Qty at Level 1"]
[null,null,null,"Priority"]
[null,null,null,1,"100 shares","Our orders"]
[null,null,null,2,"1000 shares","3rd party order"]
[null,null,null,3,"900 shares","Our orders"]
[null,null,"Known to us"]
[null,null,"The prob of executing the first 1000 qty at whichever level is 0.6 and 0.1 for the next two thousand qty"]
[]
[null,null,"the prob of 100 shares of our order and 900 shares of the 3rd party orders getting traded is 60%"]
[null,null,"the prob of 100 shares of the 3rd party and 900 shares of our order getting traded is 10%"]
[]
[null,null,null,null,"Case 3"]
[null,null,null,"Level","Qty","Bid ","Ask"]
[null,null,null,1,900,100.05,100.2]
[null,null,null,2,"100+1000",100,101]
[null,null,null,3,null,99.5]
[]
[]
[null,null,null,"Level","Qty","Bid ","Ask"]
[null,null,null,1,900,100.05,100.2]
[null,null,null,2,1100,100,101]
[null,null,null,3,1000,99.5]
[]
[null,null,null,"Probability of trading the first 900 shares at Level 1 is 60%"]
[null,null,null,"Probability of trading the next 100 shares at Level 2 is 60%"]
[null,null,null,"Probability of trading the next 1000 shares at Level 2 is 10%"]
[null,null,null,"Probability of trading the next 1000 shares at Level 3 is 10%"]

{"sheet":"Pegging with Threshold","index":17,"n_rows":77,"n_cols":9,"rows_kept":77,"cut":false,"hidden":false,"merged":[]}
["Pegging so that the market doesn't game you"]
[null,null,null,null,null,null,null,null,"Simple pegging logic--> 5 cents better than the best bid always!!"]
[null,null,null,null,"Order Book",null,null,null,"A simple pegging logic would make you fire an order at 100.45 if the best bid changes to 100.4 even with 1 qty"]
[null,null,"Level",null,"Bid ","Ask",null,null,", even if there is a sell order at 100.5!!"]
[null,null,1,100,99.95,100.5,200]
[null,null,2,400,99.5,101,500]
[null,null,3,300,99,101.5,500]
[null,null,4,300,98.25,102.5,500]
[null,null,5,300,98,103,500]
[]
["Pegging logic:"]
["Peg price = 5 cents"]
["Threshold = 30 cents!!",null,null,"Threshold limit should be more than 50% of the avg bid ask spread!!"]
[]
["Fire 1000 shares @100 (and you will note down the best bid when you fired your order = 99.95)"]
[]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,1000,100,100.5,200]
[null,2,100,99.95,101,500]
[null,3,400,99.5,101.5,500]
[null,4,300,99,102.5,500]
[null,5,300,98.25,103,500]
[null,6,300,98]
[]
["Say another order comes @100.1"]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.1,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]
[]
["You will check whether best bid - bid that you had noted < threshold!!"]
["If yes, then you will not move your order!!!"]
["100.1 - 99.95 < 30 cents, therefore you will not do anything!!!"]
["Now, another order comes at 100.2"]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.2,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]
[]
["You will check whether best bid - bid that you had noted < threshold!!"]
["If yes, then you will not move your order!!!"]
["100.2 - 99.95 < 30 cents, therefore you will not do anything!!!"]
["Now, another order comes at 100.3"]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.3,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]
[]
["You will check whether best bid - bid that you had noted < threshold!!"]
["If no, then I will modify my pegged order at 5 cents better than the bid!!"]
["100.3 - 99.95 > 30 cents, therefore you will FIRE!!"]
[]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,1000,100.35,100.5,200]
[null,2,200,100.3,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]

{"sheet":"Pegging with Threshold_sign siz","index":18,"n_rows":77,"n_cols":11,"rows_kept":77,"cut":false,"hidden":false,"merged":[]}
["Pegging so that the market doesn't game you"]
[null,null,null,null,null,null,null,null,"Simple pegging logic--> 5 cents better than the best bid always!!"]
[null,null,null,null,"Order Book",null,null,null,"A simple pegging logic would make you fire an order at 100.45 if the best bid changes to 100.4 even with 1 qty"]
[null,null,"Level",null,"Bid ","Ask",null,null,", even if there is a sell order at 100.5!!"]
[null,null,1,100,99.95,100.5,200]
[null,null,2,400,99.5,101,500]
[null,null,3,300,99,101.5,500]
[null,null,4,300,98.25,102.5,500]
[null,null,5,300,98,103,500]
[null,null,null,null,null,null,null,null,null,null,"Pegging logic + Threshold and Sign Size"]
["Pegging logic:",null,null,null,null,null,null,null,null,null,"I will Check if the order ahead of me has a sign size!!"]
["Peg price = 5 cents"]
["Threshold = 30 cents!!",null,null,"Threshold limit should be more than 50% of the avg bid ask spread!!"]
[]
["Fire 1000 shares @100 (and you will note down the best bid when you fired your order = 99.95)"]
[]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,1000,100,100.5,200]
[null,2,100,99.95,101,500]
[null,3,400,99.5,101.5,500]
[null,4,300,99,102.5,500]
[null,5,300,98.25,103,500]
[null,6,300,98]
[]
["Say another order comes @100.1"]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.1,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]
[]
["You will check whether best bid - bid that you had noted < threshold!!"]
["If yes, then you will not move your order!!!"]
["100.1 - 99.95 < 30 cents, therefore you will not do anything!!!"]
[]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.2,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]
[]
["You will check whether best bid - bid that you had noted < threshold!!"]
["If yes, then you will not move your order!!!"]
["100.2 - 99.95 < 30 cents, therefore you will not do anything!!!"]
[]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.3,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]
[]
["You will check whether best bid - bid that you had noted < threshold!!"]
["If no, then I will modify my pegged order at 5 cents better than the bid!!"]
["100.3 - 99.95 > 30 cents, therefore I will check for sig size ahead"]
["I will check the order size of the order ahead of me---(if this is greater than 50% of my order size I will fire)"]
[null,null,null,"Order Book"]
[null,"Level",null,"Bid ","Ask"]
[null,1,200,100.3,100.5,200]
[null,2,1000,100,101,500]
[null,3,100,99.95,101.5,500]
[null,4,400,99.5,102.5,500]
[null,5,300,99,103,500]
[null,6,300,98.25]
[null,null,300,98]

{"sheet":"DR_tips","index":19,"n_rows":19,"n_cols":3,"rows_kept":19,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
[]
[]
[]
[null,null,"A whipsaw logic:"]
[]
[null,null,"If Significant size (>80%) ahead of you has moved say 2-3 ticks down, then you can lower your bid"]
[]
[]
[]
[null,null,"Setting Discretion Range(DR):"]
[]
[null,null,"a) The expected spread between the best Bid and the best Ask for the asset. Say the average \nspread for the contract is 50 cents. Then the DR can be set at say half the average spread (25cents). \nThis would mean whenever we can trade at a spread of 25 cents we will fire our order."]
[]
[null,null,"b) Price Trend can also be used as a variable to determine the DR. If the price is trending \nthen the DR can be higher because it's possible that the current price would increase \nin the near future. If the market is reverting then we can keep a smaller DR because then\n we have a higher probability of getting a trade at the current prices."]
[]
[null,null,"c) Liquidity at the opposite side: If say we want to buy an asset and the liquidity at Ask side \nis quite low. In this case we can have a higher DR so that the probability of getting a trade\n is higher. "]

{"sheet":"Post only","index":20,"n_rows":31,"n_cols":5,"rows_kept":31,"cut":false,"hidden":false,"merged":[]}
[]
[]
[null,"Order Book",null,null,"at t=0sec"]
["Level","Bid ","Ask",null,"Buy Post only order fired at 100.4 for 100 shares"]
[1,100,100.5]
[2,99.5,101]
[3,99,101.5]
[4,98.25,102.5]
[5,98,103]
["CASE 1"]
["t=1millisec"]
[null,"Order Book"]
["Level","Bid ","Ask"]
[1,100.4,100.5]
[2,100,101]
[3,99.5,101.5]
[4,99,102.5]
[5,98.25,103]
[null,98]
[]
[]
[]
["CASE 2"]
["t=1millisec"]
[null,"Order Book",null,null,"The BUY post only order @100.4 will get cancelled"]
["Level","Bid ","Ask"]
[1,100,100.3]
[2,99.5,101]
[3,99,101.5]
[4,98.25,102.5]
[5,98,103]

{"sheet":"Sheet1","index":21,"n_rows":14,"n_cols":7,"rows_kept":14,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
[]
[]
[null,null,null,"t=0",null,"Fair Price"]
[null,null,null,null,null,100]
[null,null,null,null,"Bid Price",null,"Ask Price"]
[null,null,null,null,99.5,null,100.5]
[]
[null,null,null,"t = 100 mics",null,"Fair Price"]
[null,null,null,null,null,99.8]
[null,null,null,null,"Bid Price",null,"Ask Price"]
[null,null,null,null,99.3,null,100.3]