How to use IB Volume?

Posted By: AndrewAMD

How to use IB Volume? - 04/11/19 16:42

jcl,

For the IB plugin, the manual says this is the volume policy:

Quote:
marketVol: Trade volume per minute in historical data; accumulated volume since market open in live data. Only for exchange-traded assets, not for currencies.

Okay, so I can download M1 volume.

Now suppose that:
* I only had the IB plugin.
* I need the M30 volume. (That is, I need all of the volume for one thirty-minute bar.)
* I need this info both in backtests and live.
* I need to use priceRecord() to update volume data live.

Therefore, I must do this:
* Download the M1 data from IB using the IB plugin with script "A".
* Convert the M1 volume to accumulated volume for consistency purposes with script "A".
* Script "B" is a separate trading script. (It must be separate, because the historical data will be modified.)
* The script has BarPeriod = 30 (or BarPeriod * Timeframe == 30).
* Calculate bar volume with my own indicator. (It just determines the difference in accumulated volume between this bar and the last bar, accounting for exceptions/resets.)
* Finally, priceRecord() will continue to add accumulated volume to the historical data.

Is my understanding correct?
Posted By: jcl

Re: How to use IB Volume? - 04/11/19 17:09

Yes, that looks correct to me. I don't know why the volume is different in live data, but probably the API delivers it so.
Posted By: AndrewAMD

Re: How to use IB Volume? - 04/11/19 17:18

Thanks for the clarification.

Currently, my Sierra Chart plugin automatically emulates accumulated volume for historical downloads, so that historical and live match. I am considering offering additional options.
© 2024 lite-C Forums