SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun Sep 15, 2019 1:13 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Hot to set a time stop?
PostPosted: Sat Jul 11, 2009 12:47 am 
Offline

Joined: Thu Mar 16, 2006 12:15 pm
Posts: 184
Somehow I am not able to program a time stop after e.g. 10 bars after entry.

Any help?

_________________
Expect the unexpected. May your MM/RM be with you.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 11, 2009 11:04 am 
Offline

Joined: Thu Sep 20, 2007 6:43 pm
Posts: 122
Location: Poland
Hi :)

Count new bar from order entry or its better way use DateTime structure which will be check order entry time and present time.

Regards
MaRCHeW

_________________
"Your worst day with OpenQuant is better than your best day with most of the other stuff."


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 11, 2009 11:26 pm 
Offline

Joined: Thu Mar 16, 2006 12:15 pm
Posts: 184
"DateTime structure which will be check order entry time and present time. "

Position.EntryTime ok.
Present time: Clock.Now or Bar.EndTime?

But how to calculate the difference? In Bars? Tried something with Bar.Duration but did not work.

_________________
Expect the unexpected. May your MM/RM be with you.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 13, 2009 2:24 pm 
Offline

Joined: Wed Jul 18, 2007 3:39 pm
Posts: 36
Check out the TimeSpan class. Its easy.

For example:
Code:
TimeSpan ts = new TimeSpan();
ts = datetime1 - datetime2;
if (ts.Minutes > 15)
   Console.WriteLine("hi");
[/code]


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