calculation if a trade was on bid or ask.
Code: Select all
if Close <= InsideBid then
Bid[Index] = Bid[Index] + MyVol - VolTmp
else if Close >= InsideAsk then
Ask[Index] = Ask[Index] + MyVol - VolTmp
else
begin
// Last tick was between bid/ask
if Close <= LastTick then
Bid[Index] = Bid[Index] + MyVol - VolTmp
else
Ask[Index] = Ask[Index] + MyVol - VolTmp;
end;
My problem is that the calculation comes after the fact. The video
shows the problem that if a market order of 200 contracts hits the ask
of 59 contracts, the remaining 141 contracts gets the new bid. The studys
claculates this trade as traded at the bid because at the moment of the
calculation the close (last traded price ) = insidebid instead of traded at the ask.
Are there other ways to determine if a trade was on the Bid/Ask/BetweenBidAsk?
Using bid as data2 and close <= c of data2 (instead of insidebid) has the same limitation.