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

QuantTrader Multiple feeds
http://www.smartquant.com/forums/viewtopic.php?f=60&t=10597
Page 1 of 1

Author:  waterstreet [ Tue Oct 01, 2013 5:49 am ]
Post subject:  QuantTrader Multiple feeds

I have Quanttrader connected to QuantRouter and it is getting data from IQFEED, this is no issue here.
I also have locally IB for sending trades to. how ever I am not able to pull any sort of data from IB,
now if I sign into IB on quantrouter I have no problems pulling data from IB this way. what would be
the reason for not getting IB data when i sign into IB on the same machine as quanttrader. is QT
not able to get data from two sources?

Attachments:
File comment: this is odd that is trying to get data from QR when the settings r for IB
screenshot (2).png
screenshot (2).png [ 8.55 KiB | Viewed 5336 times ]
File comment: you can see here that the symbol QGC# which is pulling iqfeed data from QR works fine. however the GC Dec13 pulling from the local IB connection does not work. and you can see my Alt Settings too.
screenshot.png
screenshot.png [ 45.39 KiB | Viewed 5337 times ]

Author:  waterstreet [ Tue Oct 01, 2013 6:06 am ]
Post subject:  Re: QuantTrader Multiple feeds

I am seeing that there is an option under Options -> Modes that you specify where the market data comes from. and that being QR... so this means QT can only accept one market data provider and that being QR? so if I want both as data providers then I need to have all connected to QR correct?

how about if I do not want data from IB and just want to send orders to IB, I presume I can have this portion located on the same machine as QT?

am I able to connect multiple IB accounts to QR?

Attachments:
screenshot3.png
screenshot3.png [ 20.58 KiB | Viewed 5336 times ]

Author:  Dr. Anton Fokin [ Tue Oct 01, 2013 11:49 pm ]
Post subject:  Re: QuantTrader Multiple feeds

Hi,

QT can receive data from one data source per mode, but you can configure QR so that it consolidates data from IB and IQFeed and sends consolidated data feed to QT. Please let me know if you need additional instructions.

Regards,
Anton

Author:  Dr. Anton Fokin [ Tue Oct 01, 2013 11:53 pm ]
Post subject:  Re: QuantTrader Multiple feeds

PS. From QR Getting Startegy Guide

9.2. Feed Consolidation
Task
Connect a strategy trading client application (OpenQuant) to a consolidated feed consisting of Hotspot
FX and Currenex FX feeds.
Solution
Use formula defining a consolidated stream.
For example to subscribe for EUR/USD Bid and Ask on Currenex and Bid, Ask and Trade on HotSpot use
the following formula:
EUR/USD(Currenex)Bid|Ask,EUR/USD(Hotspot)Bid|Ask|Trade

Author:  umer.master [ Tue Dec 10, 2013 10:55 am ]
Post subject:  Re: QuantTrader Multiple feeds

Hello Support,

Moving forward from you suggestion above, i would like to seek advice on something similar. My scenario is:

My strategy is running in OQ. What i would like is for it to use 2 different data feeds. I would like it to do all its calculations on IQFeed. But when the strategy generates a signal, it should use data from another provider to manage the orders etc. I have gone through the QuantRouter document and the part on feed consolidation, but i do not understand how i can make use of the multiple (consolidated) feeds available using QuantRouter.

Is what i want possible? If so, then how can i achieve this?

Hoping to hear from you soon.

Thanks

Author:  Baraz Sergey [ Tue Dec 10, 2013 11:08 am ]
Post subject:  Re: QuantTrader Multiple feeds

Hi,

Please take a look at this video:
http://smartquant.com/quantrouter/video ... tions.html

It shows how to setup instruments in OQ to consolidate/aggregate feeds using QR.

Regards,
Sergey.

Author:  umer.master [ Tue Dec 10, 2013 12:52 pm ]
Post subject:  Re: QuantTrader Multiple feeds

Hello Sergey,

Thank you for your prompt response.

As i mentioned in my original post, I understand this much i.e. how to add a consolidated feed. But, my question was how to use this in my scenario?

Quote:
My strategy is running in OQ. What i would like is for it to use 2 different data feeds. I would like it to do all its calculations on IQFeed. But when the strategy generates a signal, it should use data from another provider to manage the orders etc. I have gone through the QuantRouter document and the part on feed consolidation, but i do not understand how i can make use of the multiple (consolidated) feeds available using QuantRouter.

Is what i want possible? If so, then how can i achieve this?


Please help me with this.

Thanks

Author:  Baraz Sergey [ Tue Dec 10, 2013 1:01 pm ]
Post subject:  Re: QuantTrader Multiple feeds

Hi,

Perhaps you need to create two different instruments (one for IQFeed and one for another broker) and add them both to the MarketData section. Then in one instance of your strategy that corresponds to IQFeed you will get only IQFeed data, you can do any calculation you need and when you need to send an order you can call some function of the other instance of your strategy (that corresponds to another provider). This fuction can send an order on the second instrument and manage it using another provider data.

Do you see what I mean?

Regards,
Sergey.

Author:  umer.master [ Tue Dec 10, 2013 1:10 pm ]
Post subject:  Re: QuantTrader Multiple feeds

Hello Sergey,

Yeah, thank you for the suggestion.

So for the 2 instruments i create, i would need to provide only the required data provider in the symbol properties. Like you did separately in EUR/USD_CNX & EUR/USD_HS?

Regards

Author:  Baraz Sergey [ Tue Dec 10, 2013 2:16 pm ]
Post subject:  Re: QuantTrader Multiple feeds

Hi,

Yes, each instrument should be set up to be used with a given market data provider.

Regards,
Sergey.

Author:  umer.master [ Tue Dec 10, 2013 2:17 pm ]
Post subject:  Re: QuantTrader Multiple feeds

Understood. Thanks

I will try and let you know if i have any further questions.

Best
Umer

Author:  umer.master [ Tue Dec 10, 2013 6:44 pm ]
Post subject:  Re: QuantTrader Multiple feeds

ok so here is the complexity here:

Quote:
...and when you need to send an order you can call some function of the other instance of your strategy (that corresponds to another provider).


How can we communicate between different instances of the strategy? It would be very complex to communicate between the 2 instances in terms of coding as well as managing the solution.

Isn't there any other way to go about this? If not, then the functionality of providing consolidated data feed become literally useless in the broader perspective.

Hoping to hear from you soon.

Thanks

Author:  Baraz Sergey [ Wed Dec 11, 2013 10:31 am ]
Post subject:  Re: QuantTrader Multiple feeds

Hi,

Quote:
How can we communicate between different instances of the strategy?

Please see the following sample, it demonstrates how to call a method of one strategy instance from another one:
Code:
using System;
using System.Collections.Generic;
using System.Drawing;

using OpenQuant.API;
using OpenQuant.API.Indicators;

public class MyStrategy : Strategy
{   
   static Dictionary<string, MyStrategy> strategyTable = new Dictionary<string, MyStrategy>();
   
   public override void OnStrategyStart()
   {
      // register strategy instance in the table
      strategyTable[Instrument.Symbol] = this;
   }

   public override void OnBar(Bar bar)
   {
      // call MyFunc of another strategy instance
      if (Instrument.Symbol == "MSFT")
         strategyTable["CSCO"].MyFunc();
   }

   // user custom function
   public void MyFunc()
   {
      Buy(100);
   }
}

Quote:
Isn't there any other way to go about this?

Another option to accomplish what you need is to have 1 instrument that receives consolidated feed, but use ProviderId property of the incoming Trades and Quotes to realize where a given trade or quote comes from. Please note that bars will be generated using market data from both providers in this case, unless you build your own bars in the strategy code using ProviderId property of trades and quotes.

Regards,
Sergey.

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