logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
manatrader  
#1 Posted : Friday, June 19, 2009 4:49:20 PM(UTC)
manatrader

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/30/2009(UTC)
Posts: 46
Location: Hawaii, US

Well, maybe I'm searching the forum for the wrong term, using 'end of day' includes lots of MS EOD results. I'm wanting to code an exit for intraday trades at end of day, like for 5 min bars I'd add to other exit rules.........:

"or current bar 3:55pm"

Thanks!
Justin  
#2 Posted : Friday, June 19, 2009 5:49:54 PM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

There are functions that allow you to reference time, i.e. Hour(), Minute(). Hours should follow a 24-hour clock. So a simple formula of: Hour() = 8 AND Minute() = 45 would trigger when the time was equal to 8:45 AM. You will always want to make sure to pick a time that exists in the relevant periodicity. In other words, Hour()=8 AND Minute() = 45 would not trigger on a 10-minute chart where the bars are stamped 8:10, 8:20, 8:30, 8:40, 8:50.
wabbit  
#3 Posted : Friday, June 19, 2009 6:19:13 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
manatrader  
#4 Posted : Friday, June 19, 2009 10:35:16 PM(UTC)
manatrader

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/30/2009(UTC)
Posts: 46
Location: Hawaii, US

Awesome, and it's right in the gdang manual as always. Thanks guys
manatrader  
#5 Posted : Thursday, June 25, 2009 4:49:07 PM(UTC)
manatrader

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/30/2009(UTC)
Posts: 46
Location: Hawaii, US

EDIT-forum won't let me delete post, problem was due to using NY time instead of local..

D'oh!


Whoops, for some reason it isn't working. In addition to other buy/sell rules, I've added

entry 'and hour()>9 and hour()<15'

exit 'or (hour()=15 and minute()=50)'

This is on a 2 minute bar test.. Any ideas?
Thanks
:)
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.