asset subscription mechanism for broker API plugin

Posted By: madpower2000

asset subscription mechanism for broker API plugin - 04/17/16 19:25

I’m trying to develop some broker API plugin for Zorro, but lost a little with mechanism of an asset subscription.

I'm looked thru code at FXCMplugin.cpp - BrokerAsset() function implementation and don't see any code that push data from Broker to Zorro after subscribes an asset was established. Can you explain mechanism, how I should implement broker API event handler, when new data on subscribed asset arrived from broker? How should I pass it to Zorro?
Posted By: jcl

Re: asset subscription mechanism for broker API plugin - 04/18/16 08:26

When a price quote arrives, store it in a list together with the asset name. Then call fpProgress(0) for triggering Zorro. Zorro will then call BrokerAsset() for retrieving the price quote. If fpProgress is not called, the price will be retrieved at the next TickTime period.
Posted By: madpower2000

Re: asset subscription mechanism for broker API plugin - 04/24/16 11:27

Thanx! Got it, code it!
But, should I unsubscribe, to cancel listening broker quotes? Or leave it until broker logout?
Posted By: jcl

Re: asset subscription mechanism for broker API plugin - 05/02/16 06:49

Leave it until logout. Unsubscription is not used by the plugin.
© 2024 lite-C Forums