Feeding Zorro with price data from a file

Posted By: Zheka

Feeding Zorro with price data from a file - 10/12/17 12:53

Jcl,

I want to read continuous quotes from a file to feed Zorro script making calculation off e.g. 10min bars in RT, but without sending orders to a broker.

I have studied your HFT simulation example with NxCore, but need to clarify some things.
1. For Zorro to have price fields available internally, does it have to be a 'broker plug-in'?

2. How does one generally use and implement a callback() function? Which function in the Broker plugin should call it? There is no documentation.

3. In NxCore example callback() returns 1. Does this have any meaning?

4. If I set ticks read from a file via priceQuote() - like in an NxCore example - would Zorro then automatically build bars and fill in its internal t6 structs?

5. if (4) is Yes, then If a price in PriceQuote() is negative, it is considered Bid. Would Zorro automatically calculate Spread and fill it in the t6 struct?

5. Can I set fields of a t6 structs in the callback() directly? Would be great to have a function like PriceQuote but for *.t6.

Your any other advice is greatly appreciated.
Posted By: jcl

Re: Feeding Zorro with price data from a file - 10/12/17 13:46

It needs not be a broker plugin, it can be any DLL. If it is a broker plugin and you have a callback function in the script, you can use BrokerProgress(ptr) for transmitting information. Look for the description in the manual under "Broker Plugin". An example of such a callback function can be found on the HFT page. What it returns is up to your implementation.

There are no T6 structs at runtime, T6 is only used for historical data. Still you can set the prices and spread directly, either with priceQuote, or with priceSet. As you can imagine, this is pioneer area, AFAIK priceQuote has so far only been used for HFT simulation. When you encounter problems, you know the procedure: email Support and you'll get help.
Posted By: Zheka

Re: Feeding Zorro with price data from a file - 10/12/17 17:41

It becomes clearer now. As Zorro creates bars in memory at runtime, would priceSet() do the same (in absense of smaller price ticks and with run() increasing the bar count)?

Or the correct function to use is bar()?
Quote:
The function is called whenever a new price quote arrives
Would calling priceQuote() trigger a call to bar ()?

Another question: if a *.t6 file is updated in realtime, would a script in [Test] mode continue to run and produce trade statistics?
Posted By: vles

Re: Feeding Zorro with price data from a file - 10/12/17 19:28

Hi,
I have IB gateway installed tws and zorros.
It connects running z8 displays the changes to portfolio but changes nothing and logs out after run.
How do you have your system set up?

I get no response from admin.
Posted By: Zheka

Re: Feeding Zorro with price data from a file - 10/13/17 08:52

I did not try to run Z systems - so I cannot answer.Sorry.
Posted By: Zheka

Re: Feeding Zorro with price data from a file - 10/13/17 11:39

Jcl,

Would appreciate your reply.
Posted By: jcl

Re: Feeding Zorro with price data from a file - 10/13/17 16:24

priceSet does not create bars, but it can fill or overwrite price candles.

priceQuote can indeed trigger a call to bar(), at least I would expect that since it is equivalent to the arrival of a tick. But as I said, it has been tested so far for HFT simulation only, so it's not guaranteed that it works for receiving prices during live trading.

Updating a .t6 price history file can have only an effect on the backtest when you do that at test start before selecting the asset.
Posted By: Zheka

Re: Feeding Zorro with price data from a file - 10/14/17 10:32

Clear. Thank you.
© 2024 lite-C Forums