SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun Apr 05, 2020 11:22 pm

All times are UTC + 3 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Nov 13, 2009 5:31 am 

Joined: Tue Oct 20, 2009 9:06 am
Posts: 19
i am having some questions about running "Bollinger Bands with Profit Target" in LIVE mode:

1. Since this is a daily bar strategy do i need to pre-load history bars in OnStrategyStart?

such as:
//pre-load history data
datetime2 = DateTime.Now;
datetime1 = datetime2.AddDays(-20);

foreach (Bar bar in GetHistoricalBars(datetime1, datetime2, BarType.Time, 19800))

2. do i need to keep it running by 24x7 in order to track maxduration days? or the status of strategy can be saved somewhere after i shutdown it?

3. in LIVE mode how can i get my IB account buying power or equity?

many thanks

 Post subject:
PostPosted: Fri Nov 27, 2009 12:10 pm 

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833

1) Yes, you should use lines like that. But are you sure that you want to use 19800 value? This seems to be 5h30m length bars. Please note that if you run your strategy on Daily data you should specify 86400 and it doesn't matter how long the real trading session is.

2) OQ can not save/restore your strategy state, so yes - you should run it 24x7. You can also try to restore your strategy state in the strategy logic - OQ can save and load back transactions made by the strategy, so you can try to use this info.

3) the following code prints out buying power of all of your IB accounts:

BrokerInfo info = DataManager.GetBrokerInfo();
      foreach (BrokerAccount account in info.Accounts)


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
Powered by phpBB® Forum Software © phpBB Group