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

Notification

Icon
Error

Options
Go to last post Go to first unread
newbie  
#1 Posted : Wednesday, October 19, 2005 6:25:35 PM(UTC)
newbie

Rank: Member

Groups: Registered, Registered Users
Joined: 10/6/2005(UTC)
Posts: 26

Patrick wrote:
Is there a way to make the Expert Advisor to only show the first long/short signal, not all of them? Yes, there is, but it is fairly complex. It requires that your Expert formulas be reworked into what we tend to call a "flip-flop" construction. Here are two samples of this sort of construction: 3 state: bc:=C > Mov(C,20,S)+1{enter long condition}; be:=Cross(Mov(C,20,S),C){close long condition}; sc:=C < Mov(C,20,S)-1{enter short condition}; se:=Cross(C,Mov(C,20,S)){close short condition}; trade:=If( bc=1, 1, If(sc=1, -1, If((be AND PREV=1) OR (se AND PREV=-1),0,PREV))); Cross( trade= x, 0.5) You will need to change the Trade=X, in the above formulas to Trade= 1, Trade= -1, or Trade= 0, depending on the condition you are defining. As you can see these are rather involved ... Note: The PREV function used in these formulas is required, and it has the drawback of causing the calculation to be relatively slow.
Patrick, I am actually working on the following system test/indicator to be replicated in Expert System. To-date, I have not managed to get the signs to match those in the Enhanced System Test. Would appreciate if you could give this problem a bit of your time. bc:=C > LinearReg(C,12) and Qstick(10)>0+1{enter long condition}; be:=C<ref(llv(l,3),-1){close long condition}; sc:=C < LinearReg(C,12) and Qstick(10)<0-1{enter short condition}; se:=C>ref(hhv(h,3),-1){close short condition}; trade:=If( bc=1, 1, If(sc=1, -1, If((be AND PREV=1) OR (se AND PREV=-1),0,PREV))); Cross( trade= x, 0.5) How do I move on from here? What number is x for bc,be,sc and se to get the symbols to appear on the Expert System. Appreciate any help you could extend. TQ
Patrick  
#2 Posted : Wednesday, October 19, 2005 8:27:13 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)
Why don't you try and use the latch function from the forumDll? If you have MetaStock 9.0 Go to the download section, download the forumdll.exe and the manual ... Then let me know where you are at. Patrick :mrgreen:
newbie  
#3 Posted : Thursday, October 20, 2005 12:34:47 AM(UTC)
newbie

Rank: Member

Groups: Registered, Registered Users
Joined: 10/6/2005(UTC)
Posts: 26

I am using Metastock 8.0 Pro. Could I still use the Latch function that you described?
Patrick  
#4 Posted : Thursday, October 20, 2005 12:44:44 AM(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)
Download this file instead ... http://forum.equis.com/viewtopic.php?t=2047 Rename it from .[censored] to .dll and move the file to the external function dlls folder. Patrick :mrgreen:
newbie  
#5 Posted : Saturday, October 22, 2005 9:06:19 AM(UTC)
newbie

Rank: Member

Groups: Registered, Registered Users
Joined: 10/6/2005(UTC)
Posts: 26

Patrick wrote:
Download this file instead ... http://forum.equis.com/viewtopic.php?t=2047 Rename it from .[censored] to .dll and move the file to the external function dlls folder. Patrick :mrgreen:
Patrick, The latch function is not there anymore! BTW, could this latch function removed unwanted signals? For instance, if I am Long, I would like the Expert system to disregard sell-short and sell-exit signals until my Long position is squared off.
StorkBite  
#6 Posted : Saturday, October 22, 2005 4:38:18 PM(UTC)
StorkBite

Rank: Advanced Member

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

Was thanked: 14 time(s) in 10 post(s)
Unfortunately, the topic search is temporarily unavailable. There are many threads covering redundant signals. It is also covered in the MetaStock FAQ which is available for download. However, the operation of the forumDLL latch is covered in the user's guide that Wabbit prepared. I posted the current link in your previous post on the same topic.
newbie  
#7 Posted : Saturday, October 22, 2005 10:31:22 PM(UTC)
newbie

Rank: Member

Groups: Registered, Registered Users
Joined: 10/6/2005(UTC)
Posts: 26

g_stockman wrote:
Unfortunately, the topic search is temporarily unavailable. There are many threads covering redundant signals. It is also covered in the MetaStock FAQ which is available for download. However, the operation of the forumDLL latch is covered in the user's guide that Wabbit prepared. I posted the current link in your previous post on the same topic.
I will wait and try out forumdll once the link to Metastock 8.0 forumdll latch is up and running. I had responded to Patrick, and I believe another netter did too. I have no problem with redundant signals for Buy and Sell. But I have a complete system with LE, LX, SE and SX and all these indicators could be triggered at the same time. I just need one position, either Long or Short. Sometimes, when I am Long (and still active), the Expert system triggered a SE and SX. I am trying to get rid of these signals because they are confusing to look at on the chart. Anyway, thanks for your reply. I will keep my eyes open on a new link to forumdll v8.0.
btconnolly  
#8 Posted : Tuesday, October 25, 2005 6:56:52 PM(UTC)
btconnolly

Rank: Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/25/2005(UTC)
Posts: 12

I have been identifying for example the "FirstBuy" from subsequent Buy signals by using Ref(Ref) rather than (Prev): FirstBuy = Ref(Ref(BuySignal,1) and barssince(SellSignal)<barssince(BuySignal),-1) is this also correct?
Jose  
#9 Posted : Tuesday, October 25, 2005 8:43:23 PM(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)
The answer to latches (in MetaStock Formula Language) is here for those that want to see it. jose '-)
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.