SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Sep 28, 2020 5:35 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: OnOpenBar and .Ago
PostPosted: Tue Jun 10, 2014 8:58 am 
Offline

Joined: Wed Mar 05, 2008 5:03 pm
Posts: 6
Using bars.DateTime and Bars.Ago(1).DateTime in OnBarOpen and OnBar gives different results for Bars.Ago(1). I thought if OnBarOpen fires after first trade then the previous bar would be closed and Bars.Ago(1) give same results in both? See log:

10/19/1998 12:00:00 AM: OnBarOpen: CurrDate:19981019, Prev Date: 19981015
10/19/1998 12:00:00 AM: OnBar: CurrDate:19981019, Prev Date: 19981016

10/20/1998 12:00:00 AM: OnBarOpen: CurrDate:19981020, Prev Date: 19981016
10/20/1998 12:00:00 AM: OnBar: CurrDate:19981020, Prev Date: 19981019

10/21/1998 12:00:00 AM: OnBarOpen: CurrDate:19981021, Prev Date: 19981019
10/21/1998 12:00:00 AM: OnBar: CurrDate:19981021, Prev Date: 19981020

10/22/1998 12:00:00 AM: OnBarOpen: CurrDate:19981022, Prev Date: 19981020
10/22/1998 12:00:00 AM: OnBar: CurrDate:19981022, Prev Date: 19981021

10/23/1998 12:00:00 AM: OnBarOpen: CurrDate:19981023, Prev Date: 19981021
10/23/1998 12:00:00 AM: OnBar: CurrDate:19981023, Prev Date: 19981022


Top
 Profile  
 
 Post subject: Re: OnOpenBar and .Ago
PostPosted: Tue Jun 10, 2014 10:47 am 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Hi,

At OnBarOpen event, new bar is not in Bars series, since the bar is not completed yet.
It will be added at OnBar event only.

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: OnOpenBar and .Ago
PostPosted: Tue Jun 10, 2014 11:17 am 
Offline

Joined: Wed Mar 05, 2008 5:03 pm
Posts: 6
OK now i see, so only use OnBarOpen if I need to do anything when the bar is being built.


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 2 guests


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