SmartQuant Discussion

Trading Process...
Page 1 of 1

Author:  willowdog [ Thu Sep 18, 2014 10:14 pm ]
Post subject:  Trading Process...

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.

Author:  Dr. Anton Fokin [ Fri Sep 19, 2014 7:13 am ]
Post subject:  Re: Trading Process...


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.


Author:  willowdog [ Mon Sep 22, 2014 6:59 pm ]
Post subject:  Re: Trading Process...

Hi Anton,

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


Author:  Dr. Anton Fokin [ Mon Sep 22, 2014 7:05 pm ]
Post subject:  Re: Trading Process...

Are you using OQ2013 or OQ2014?


Author:  willowdog [ Mon Sep 22, 2014 7:15 pm ]
Post subject:  Re: Trading Process...

Version says 3.13.0 in Help->About.

Author:  Dr. Anton Fokin [ Mon Sep 22, 2014 7:23 pm ]
Post subject:  Re: Trading Process...

This FAQ thread should be helpful to start with viewtopic.php?f=64&t=6227


Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group