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

Notification

Icon
Error

Options
Go to last post Go to first unread
a26174980  
#1 Posted : Tuesday, November 6, 2012 8:42:19 AM(UTC)
a26174980

Rank: Member

Groups: Registered, Registered Users
Joined: 11/2/2012(UTC)
Posts: 15

how to set "must sell before the market is closed" in backtesting? I am a day trader,so i have to sell before the market is closed. Thanks for reading the post!
wabbit  
#2 Posted : Tuesday, November 6, 2012 8:36:41 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)
Use a forward reference to the next bar to see if it has the same date; if not then the current bar is the last bar of that trading day, so close the position at the CLOSE price with zero delay. Of course, you cannot do this in real-life, but then again, back-testing doesn't necessarily portray what really happens in the market.


wabbit [:D]
a26174980  
#3 Posted : Tuesday, November 6, 2012 10:10:01 PM(UTC)
a26174980

Rank: Member

Groups: Registered, Registered Users
Joined: 11/2/2012(UTC)
Posts: 15

thank you! could u give me the codes? i am a very beginner to metastock :)
wabbit  
#4 Posted : Tuesday, November 6, 2012 10:49:25 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)
Have a look in the MS User Manual and the free Equis Formula Primer for how to use the Ref() and DayOfWeek() functions. Whilst looking in those documents, read the entire thing and see what other information is there waiting for you.


wabbit [:D]
a26174980  
#5 Posted : Thursday, November 8, 2012 1:26:46 AM(UTC)
a26174980

Rank: Member

Groups: Registered, Registered Users
Joined: 11/2/2012(UTC)
Posts: 15

thank you!
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.