SmartQuant Discussion
http://www.smartquant.com/forums/

How to emit and catch bid2,bid3.... ask2,ask3....
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14980
Page 1 of 1

Author:  dave10030 [ Thu Oct 24, 2019 2:01 pm ]
Post subject:  How to emit and catch bid2,bid3.... ask2,ask3....

In my provider I can use this:
Code:
base.EmitData(bid, true);


An in my strategy catch bid price with:
Code:
protected override void OnBid(Instrument instrument, Bid bid)


But this is only best bid price(bid1). If I want bid2,bid3.... then what should I do?

Author:  skuvv [ Thu Oct 24, 2019 3:42 pm ]
Post subject:  Re: How to emit and catch bid2,bid3.... ask2,ask3....

dave10030 wrote:
In my provider I can use this:
Code:
base.EmitData(bid, true);


An in my strategy catch bid price with:
Code:
protected override void OnBid(Instrument instrument, Bid bid)


But this is only best bid price(bid1). If I want bid2,bid3.... then what should I do?

Hi,
I suppose you want to retrieve market depth, so you should subscribe events like OnLevel2.
From provider side, you should send Level2Snapshot or Level2Update.

Author:  brankov [ Mon Feb 17, 2020 8:00 pm ]
Post subject:  Re: How to emit and catch bid2,bid3.... ask2,ask3....

Quote:
I suppose you want to retrieve market depth, so you should subscribe events like OnLevel2.
From provider side, you should send Level2Snapshot or Level2Update.


Could you provide a small code example how you would retrieve Level2 data from IB in OnLevel2()?

Author:  skuvv [ Wed Feb 19, 2020 3:07 pm ]
Post subject:  Re: How to emit and catch bid2,bid3.... ask2,ask3....

brankov wrote:
Quote:
I suppose you want to retrieve market depth, so you should subscribe events like OnLevel2.
From provider side, you should send Level2Snapshot or Level2Update.


Could you provide a small code example how you would retrieve Level2 data from IB in OnLevel2()?

In strategy:

Code:
public override void OnLevel2(Instrument instrument, Level2Snapshot snapshot)
{

}

public override void OnLevel2(Instrument instrument, Level2Update update)
{

}

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/