SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Fri Oct 23, 2020 1:58 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Apr 06, 2011 8:24 pm 
Offline

Joined: Mon May 18, 2009 10:10 pm
Posts: 23
Hi, I would like to create a strategy condition using 5 min bar price and trade price. But They come from different event handlers ,onBar and onTrade.
Could you tell me what event handlers I need to use to handle those prices and volume ( bar price, trade price and size) together ? Thanks.

EX. if (Bars.Ago(1).Low > bbl.Ago(1) && Bars.Last.Low < bbl.Last) /*** Bar price **/
{
if ( Trade.Size > 100 && Trade.price < Bars.Last.Low ) /*** Trade price and Size**/

{
Buy();
}
}


Top
 Profile  
 
PostPosted: Wed Apr 06, 2011 9:11 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
I think you can move this logic into a separate method and call this method from both OnBar and OnTrade. Would this work?


Top
 Profile  
 
PostPosted: Wed Apr 06, 2011 9:40 pm 
Offline

Joined: Mon May 18, 2009 10:10 pm
Posts: 23
Yes. Could you give an example for that ? Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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