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