Test Author: Taha
If it breaks: Taha 

When the lean order is placed, it takes a snapshot of the opposite inside market. If the quantity
at that level falls below the "Cross Threshold" it crosses into it.
(cross means take an order working on the bid and 'cross' by buying into the asks.  This is also called 'paying up')


0. This needs sim market data **not** to be merged with replay (or
cert), so we can create our own markets. Use the following key to set
market data up:

ExchangeSim {
  value {
    merge_with_md: false 
    forward_implied: false 
  }
}

1. Bring up a ladder, lets say in SIN1 (does not matter which security)

2. Create the ask side of the market by sending a 10 lot sell limit order at 20.050
(if there are no markets use the M View and the ticket to enter, if you already had left over
orders cancel them)

Basics:
3. Enter a 1 lot buy lean order at 20.025 with the following parameters
Cross Threshold = Absolute:5
Max Chase Ticks = 2
On Toward = No Change
Child = Limit
Verify that the Lean order along with the Child order shows up

4. Now since the threshold = 5, decrease the ask market to 5 and verify that the lean does NOT cross yet.
Now decrease it to 4 and the lean will force its child it to cross and get filled at 20.050.

5. Repeat 2 and 3. Now in the OrderBook select this lean order and change its Cross Threshold to 15. This
should cause Lean order to cross and filled.

"On Toward":
This is when the market moves towards the order, in the case of a buy order that is the ask market 
price decreasing.
Lean can repond with No Change, Reprice, Cancel or Detach.

6. No Change :
a. Repeat 2 and 3
b. Move the ask market toward your lean order. Since the On Toward is No Change, the observed market remains at 20.05. 
Now decrease the ask qty to 4 and the lean should cross the market at 20.050 (it will get filled at 20.045)
Reprice:

7. Reprice
a. Repeat 2 and 3
b. Move the ask market toward your lean order. Since the On Toward is Reprice, the Lean resets the
observed market to new top of book (20.045). Now decrease the ask qty to 4
and the lean should cross the market at 20.045.

8. Cancel
a. Repeat 2 and 3
b. Move the ask market toward your lean order. This should cancel the lean and its child.

8. Detach
a. Repeat 2 and 3
b. Move the ask market toward your lean order. Make sure the child order is detached (the child continues
to work, and the algo is gone)
