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

Notification

Icon
Error

Options
Go to last post Go to first unread
arnevanveen  
#1 Posted : Thursday, December 15, 2005 6:36:04 PM(UTC)
arnevanveen

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 10/15/2005(UTC)
Posts: 31
Location: The Netherlands

Hi there, I have developed some testing trading system. Now i'm trying to let the explorer show which stocks are ready to buy or sell. The first thing that came up my mind is if(buy,1,if(sell,-1,0). But the next thing i thought that it would be nice if the explorer gave me the date (or the days to) the last signal. Can anybody help me? Thanks in advance. PS. When is search on the keywords 'date' or 'date' and 'explorer' the search engine never returns any hits. Am i'm doing something wrong?
hayseed  
#2 Posted : Thursday, December 15, 2005 9:32:57 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey arnevanveen.... you might be able to use the 'barssince' .... similar to below....h [color=blue:043989281f]column a {buy}[/color]
c>mov(c,10,s)
[color=blue:043989281f]column b {sell}[/color]
c<mov(c,10,s)
[color=blue:043989281f]column c {barssince last buy}[/color]
barssince(c>mov(c,10,s))
[color=blue:043989281f]column d {barssince last sell}[/color]
barssince(c<mov(c,10,s))
filter
cola or colb or colc or cold -----------------------
Patrick  
#3 Posted : Thursday, December 15, 2005 9:44:37 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
I would try something more along the lines of: (valuewhen(1,buy,year())*10000)+ (valuewhen(1,buy,month())*100)+ valuewhen(1,buy,dayofmonth()) Patrick :mrgreen:
Jose  
#4 Posted : Friday, December 16, 2005 6:16:40 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
You may also want to take a look at the Year's Hi/Lo dates post. jose '-)
arnevanveen  
#5 Posted : Friday, December 16, 2005 6:38:02 PM(UTC)
arnevanveen

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 10/15/2005(UTC)
Posts: 31
Location: The Netherlands

Okay thank you all very much! I tried something out and i have the following explorer. It some sort of system which gives a buy signal when the adx is above 18 and the moving average also gives a buy signal. The exit long signal is giving from an indicator which is a combination of bollinger bands and rsi (metastock expert system). Despite your good help I still have three questions: 1. I tried to give the explorer the date from the last signal. The system tester gives really good results on this system. But i still don't trust the translation from the system tester (tradesim) to the explorer. From the dow stocks it gives 17 buy signals (from the 30 stocks) on 12 dec 2005, i think this is a bit weird. #-o 2. Besides this i would like to give the explorer to give buy and sell signals following each other. So the sequence buy, buy, buy, sell sell is not possible. Instead a buy, sell, buy, sell would be better (maybe some latch function is appropriate here). 3. Tradesim includes a moneymanagement command: C-3*ATR(10) . Can anybody explain how this function determines the size of the order and how it can be included in the explorer? I used the following codes: Col A: Security Close Col B: Date last buysignal Trendbuy:=LowestSince(1,Cross(ADX(14),22),ADX(14))>=18; Signal:=Mov(C,20,E)>Mov(C,65,E); buy:=trendbuy AND signal; (ValueWhen(1,buy,Year())*10000)+ (ValueWhen(1,buy,Month())*100)+ ValueWhen(1,buy,DayOfMonth()) Col C: Date last sellsignal ExitTrig:=Abs(13-BarsSince(Ref(C>BBandTop(C,20,S,2),-1) AND H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND Ref(RSI(14)>65,-1)))<=7 AND Ref(C>BBandTop(C,20,S,1.25),-1) AND Ref(C<BBandTop(C,20,S,2),-1) AND H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND Ref(RSI(14),-1)<ValueWhen(1,Ref(C>BBandTop(C,20,S,2),-1) AND H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND Ref(RSI(14)>65,-1),Ref(RSI(14),-1)) AND BarsSince(C<BBandTop(C,20,S,1.25))<BarsSince(Ref(C>BBandTop(C,20,S,2),-1) AND H<=Ref(H,-1) AND Ref(H,-1)>=Ref(H,-2) AND Ref(RSI(14)>65,-1)) AND BarsSince(C>BBandTop(C,20,S,2))>BarsSince(C<BBandTop(C,20,S,1.25)); (ValueWhen(1,ExitTrig,Year())*10000)+ (ValueWhen(1,ExitTrig,Month())*100)+ ValueWhen(1,ExitTrig,DayOfMonth()) Col D: sellsignal minus buysignal to see if current status is buy (positive value ) or sell (negative) {all variables from col b and c} datebuy:=BarsSince(buy) ; datesell:= BarsSince(exittrig) ; datesell-datebuy Thanks again for your help. Finally i'm designing a trading system that makes some sense. Enjoy your weekend :D !! Arne
k1116  
#6 Posted : Saturday, October 21, 2006 9:52:18 AM(UTC)
k1116

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/3/2005(UTC)
Posts: 2

Dear Patrick,

I am new to MetaStock.

I used valuewhen(1,condition,dayofmonth()) to find the day when the condition is fulfilled.

However, some odd dates came up, for example 32Aug, 00Sep.

Is this a problem with MetaStock EOD9.1 ?

Thank you very much.

Regards,
Kiong

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.