SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Sep 26, 2018 4:23 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Trading Process...
PostPosted: Thu Sep 18, 2014 10:14 pm 
Offline

Joined: Mon Sep 15, 2014 6:48 pm
Posts: 12
I’m looking for the document which explains the processes for trading with your system. I’m not talking about the sending of orders out to a broker for executing. I’m talking about how one goes about running this in production and setting up the strategy to do so. Take for example a strategy which enters long on a particular indicator that is built of N days of historical daily data. Once the trade is executed (typically MOC) the strategy sets stops based on another daily indicator and the high’s seen since that lot has been executed. Note that there could be multiple lots each with their own stop loss price.

Coming into the trading day with prior lots/positions the strategy would need to know:

1. Open lots
2. Stops for each of these lots (based on highs and another indicator)
3. The indicator used signal a buy for each stock

Is the typical scenario is that an external system calculates the indicator and stops for open lots and then feeds this information along with the open lots into the system at the start of the day?

I’m guessing that OnStrategyStart will get called once for each ticker, if not, where would I do this loading of data if that is the correct way? I keep thinking of a scenario where the indicator is the last N 30 minute bars even if it spans a trading day. Is this something that could be done?

I’m always open to getting more code samples. The samples I have seen have allowed me to add two new indicators which was very easy.


Top
 Profile  
 
 Post subject: Re: Trading Process...
PostPosted: Fri Sep 19, 2014 7:13 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6808
Hi,

yes, OnStrategyStart is called for every instrument in an InstrumentStrategy.

There are basically two ways to pre-load historical data into a strategy and pre-calculate indicators. You can do it directly in OnStrategyStart adding historical bars into Strategy.Bars series with attached indicators (indicators will be updated automatically when you add bars into their underlying Input series). Or you can have a scenario where you run a strategy on simulated data in backtest mode first and then switch to live trading.

Let me know if you need more info and code samples.

Regards,
Anton


Top
 Profile  
 
 Post subject: Re: Trading Process...
PostPosted: Mon Sep 22, 2014 6:59 pm 
Offline

Joined: Mon Sep 15, 2014 6:48 pm
Posts: 12
Hi Anton,

Thanks. That makes sense. If you have a code sample I would appreciate it.

Bruce


Top
 Profile  
 
 Post subject: Re: Trading Process...
PostPosted: Mon Sep 22, 2014 7:05 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6808
Are you using OQ2013 or OQ2014?

Regards,
Anton


Top
 Profile  
 
 Post subject: Re: Trading Process...
PostPosted: Mon Sep 22, 2014 7:15 pm 
Offline

Joined: Mon Sep 15, 2014 6:48 pm
Posts: 12
Version says 3.13.0 in Help->About.


Top
 Profile  
 
 Post subject: Re: Trading Process...
PostPosted: Mon Sep 22, 2014 7:23 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6808
This FAQ thread should be helpful to start with viewtopic.php?f=64&t=6227

Regards,
Anton


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group