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

Notification

Icon
Error

Options
Go to last post Go to first unread
wabbit  
#1 Posted : Wednesday, April 12, 2006 12:33:35 AM(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)
Hi all, Taking a quick break from my study (again!)... I have been re-thinking the logic of the latch. Although I think Patrick did an awesome job to get this function out as quickly as he did, and I like his code; I think the logic needs a little tweaking. To this end I have created a logic map for the function, and posted it on my ISP at http://members.iinet.net.au/~wabbit/ms/Latch Return Table.xlss no trade open 1 a long trade was open -1 a short trade was open The LE and SE each have two values: 0 do nothing 1 open a trade in the direction The LX and SX each have two values: 0 do nothing 1 conclude the trade in the direction The LATCH itself returns one of three values: 0, no trade 1, long -1 short You can see using the table below I have 64 permutations to consider. I have made my first stab at the logic, but I got to thinking this is how I (a risk adverse investor) would use the latch (and I never short!) How would a trader use the latch? If a trader was long and received a SE signal, what do they do? etc etc Can yuo see these questions now? Please look at the table below, or download it from the link given previously, make any changes you think pertinent, explain whatever you like and get it back to me, via email, snail mail, carrier pigeon or forum post and I will consolidate the returns for final approval before amending the .dll file. (Boy this is a long post!) [LOGIC TABLE REMOVED - it wasn't right anyway!] If something doesnt make sense, its becuase I am crazy! wabbit :D
wabbit  
#2 Posted : Wednesday, April 12, 2006 2:38:24 AM(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)
Having procrastinated about studies a little longer I have methematically solved the logic table with the exception of the following circumstances:
Previous LE	LX	SE	SX	Latch
1	0	0	1	0	????
1	1	1	1	0	????
-1	1	0	0	0	????
-1	1	0	1	1	????
NA	1	0	1	0	????
0	1	0	1	0	????
1	1	0	1	0	????
-1	1	0	1	0	????
Any traders want to gove some advice here? PLEASE. wabbit :D
wabbit  
#3 Posted : Wednesday, April 12, 2006 9:36:10 AM(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)
DONE!
Truth table:
Prev	SE	SX	LE	LX	(SE-SX)	(LE-LX)	i_S	LATCH
NA	0	1	0	1	-1	-1	-2	0
0	0	1	0	1	-1	-1	-2	0
1	0	1	0	1	-1	-1	-2	0
-1	0	1	0	1	-1	-1	-2	0
NA	0	1	0	0	-1	0	-1	0
NA	0	1	1	1	-1	0	-1	0
NA	0	0	0	1	0	-1	-1	0
NA	1	1	0	1	0	-1	-1	0
0	0	1	0	0	-1	0	-1	0
0	0	1	1	1	-1	0	-1	0
0	0	0	0	1	0	-1	-1	0
0	1	1	0	1	0	-1	-1	0
1	0	1	0	0	-1	0	-1	1
1	0	1	1	1	-1	0	-1	0
1	0	0	0	1	0	-1	-1	0
1	1	1	0	1	0	-1	-1	0
-1	0	1	0	0	-1	0	-1	0
-1	0	1	1	1	-1	0	-1	0
-1	1	1	0	1	0	-1	-1	0
-1	0	0	0	1	0	-1	-1	-1
NA	1	0	0	1	1	-1	0	-1
0	1	0	0	1	1	-1	0	-1
1	1	0	0	1	1	-1	0	-1
-1	1	0	0	1	1	-1	0	-1
NA	0	1	1	0	-1	1	0	1
0	0	1	1	0	-1	1	0	1
1	0	1	1	0	-1	1	0	1
-1	0	1	1	0	-1	1	0	1
NA	0	0	0	0	0	0	0	0
NA	1	1	0	0	0	0	0	0
NA	0	0	1	1	0	0	0	0
NA	1	1	1	1	0	0	0	0
0	0	0	0	0	0	0	0	0
0	1	1	0	0	0	0	0	0
0	0	0	1	1	0	0	0	0
0	1	1	1	1	0	0	0	0
1	0	0	0	0	0	0	0	1
1	1	1	0	0	0	0	0	1
1	0	0	1	1	0	0	0	1
1	1	1	1	1	0	0	0	1
-1	0	0	0	0	0	0	0	-1
-1	1	1	0	0	0	0	0	-1
-1	0	0	1	1	0	0	0	-1
-1	1	1	1	1	0	0	0	-1
NA	0	0	1	0	0	1	1	1
NA	1	1	1	0	0	1	1	1
NA	1	0	0	0	1	0	1	-1
NA	1	0	1	1	1	0	1	-1
0	0	0	1	0	0	1	1	1
0	1	1	1	0	0	1	1	1
0	1	0	0	0	1	0	1	-1
0	1	0	1	1	1	0	1	-1
1	0	0	1	0	0	1	1	1
1	1	1	1	0	0	1	1	1
1	1	0	0	0	1	0	1	1
1	1	0	1	1	1	0	1	1
-1	0	0	1	0	0	1	1	-1
-1	1	1	1	0	0	1	1	-1
-1	1	0	0	0	1	0	1	-1
-1	1	0	1	1	1	0	1	-1
NA	1	0	1	0	1	1	2	0
0	1	0	1	0	1	1	2	0
1	1	0	1	0	1	1	2	1
-1	1	0	1	0	1	1	2	-1
also posted at previous link (in first post) Anyone game enough to try it out !!!! COME ON!!! Let me know how you go? Download the new dll file, [FILE REMOVED - - see below] wabbit :D
hayseed  
#4 Posted : Wednesday, April 12, 2006 12:02:59 PM(UTC)
hayseed

Rank: Advanced Member

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

hey wabbit.... running it through the mill now..... will let ya how she turns out...... thanks. .....h
StorkBite  
#5 Posted : Wednesday, April 12, 2006 4:38:53 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)
I'll check it out too... won't be until tomorrow though. Thanks for keeping it all alive. DOn't forget that Patrick has a revision near ready now... he says it'll be his last, but I don't know... hmm...
hayseed  
#6 Posted : Thursday, April 13, 2006 4:14:13 PM(UTC)
hayseed

Rank: Advanced Member

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

hey wabbit.... ran the latch through the mill, no problems of any type seen...... downloaded your newest dll, will look at the ma tonite..... and will holler back.... thanks.....h
StorkBite  
#7 Posted : Thursday, April 13, 2006 8:24:04 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)
I agree with H... looks like it performs in accordance with your logic table. Good job!
smg  
#8 Posted : Friday, April 14, 2006 2:21:22 AM(UTC)
smg

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/13/2005(UTC)
Posts: 90

Wabbit, Are there any differences to expect in the working of Latch function of FORUM Dll and your Dll? Or we should test for similarity between the two? Regards SMG
wabbit  
#9 Posted : Friday, April 14, 2006 3:03:40 AM(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)
There are a lot of differences.... If you plot something like: {Latch tests based on prime numbers} LE:=Mod(Cum(1),7)=0; LX:=Mod(Cum(1),13)=0; SE:=Mod(Cum(1),17)=0; SX:=Mod(Cum(1),23)=0; 2*ExtFml("ForumDll.Latch",LE,LX,SE,SX); ExtFml("myDll.Latch",LE,LX,SE,SX); You will see the differences. The Forum Latch is scaled to -2, 2 to be discernable from myLatch -1,1 wabbit :D P.S. I suppose I could build the ForumDll truth table to be able to demonstrate the differences too.... I think I will. Standby a little later for this!
wabbit  
#10 Posted : Friday, April 14, 2006 7:15:46 AM(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)
Here is the comparison Truth Table between the ForumDll.Latch and myDll.Latch to show where the two are different.
Prev	SE	SX	LE	LX	Forum	myLatch
NA	1	0	0	1	0	-1
NA	0	1	1	0	0	1
NA	1	0	0	0	0	-1
NA	1	0	1	1	0	-1
NA	0	0	1	0	0	1
NA	1	1	1	0	0	1
0	1	0	0	1	0	-1
0	0	1	1	0	0	1
0	1	0	0	0	0	-1
0	1	0	1	1	0	-1
0	0	0	1	0	0	1
0	1	1	1	0	0	1
1	1	1	0	1	-1	0
1	0	1	1	1	1	0
1	1	1	0	0	-1	1
1	1	0	0	0	-1	1
-1	1	1	0	1	-1	0
-1	0	1	1	1	1	0
-1	0	0	1	1	1	-1
-1	1	1	1	1	1	-1
-1	1	0	1	1	1	-1
-1	0	0	1	0	1	-1
-1	1	1	1	0	1	-1
-1	1	0	1	0	1	-1
As this is just code that derives these values, it is possible to code ANY scenario, you just have to be able to create a table like these one that demonstrate what values you want the function to return in EVERY possible permutation. Hope this helps. wabbit :D
smg  
#11 Posted : Friday, April 14, 2006 11:38:50 AM(UTC)
smg

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/13/2005(UTC)
Posts: 90

Wabbit, I created four Indicators: {Wabbit LE} LE:=Mod(Cum(1),7)=0; LE; {Wabbit LX} LX:=Mod(Cum(1),13)=0; LX; {Wabbit SE} SE:=Mod(Cum(1),17)=0; SE; {Wabbit SX} SX:=Mod(Cum(1),23)=0; SE; and plotted these indicators in two separate inner windows along with your Latch Function and Classic Latch function. The inference that I get from the chart seems to be that while the Classic Latch will exit a Long position on a Short Entry Signal even if a Long Exit Signal NOT been triggerred in between. Your Latch function will exit a long position ONLY if a Long Exit Signal has triggerred - reverse for Short positions. So it seems that we have to be a little more cautious while we use any of the Latch functions and be aware how they are working internally. Wabbit, am I right here? Thanks for taking us on the internal tour of the latch function. Regards SMG
wabbit  
#12 Posted : Friday, April 14, 2006 11:48:17 AM(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)
smg wrote:
The inference that I get from the chart seems to be that while the Classic Latch will exit a Long position on a Short Entry Signal even if a Long Exit Signal NOT been triggerred in between. Your Latch function will exit a long position ONLY if a Long Exit Signal has triggerred - reverse for Short positions.
wabbit wrote:
Prev	SE	SX	LE	LX	Forum	myLatch
1	1	1	0	1	-1	0
1	0	1	1	1	1	0
1	1	1	0	0	-1	1
1	1	0	0	0	-1	1
These are the tables of the DIFFERENCES between the two latches, if already in a LONG trade..... Reading from the top of the table: if SE=1 and SX=1 and LE=0 and LX=1, the forum latch will enter the short trade, myDll latch will exit the long if SE=0 and SX=1 and LE=1 and LX=1, the forum latch will enter a long trade, myDll latch will exit the long if SE=1 and SX=1 and LE=0 and LX=0, the forum latch will enter the short trade, myDll latch will stay in the long trade if SE=1 and SX=0 and LE=0 and LX=0, the forum latch will enter the short trade, myDll latch will stay in the long trade Hope that clears it up for you. wabbit :D
wabbit  
#13 Posted : Monday, April 17, 2006 2:55:38 AM(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)
... on second thoughts, if you want a copy of the dll as a TESTER then please PM me.... wabbit :D
PLAS  
#14 Posted : Thursday, April 20, 2006 11:24:52 AM(UTC)
PLAS

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 10/22/2005(UTC)
Posts: 8
Location: India

Where to download the file? -PLAS
hayseed  
#15 Posted : Thursday, April 20, 2006 12:44:52 PM(UTC)
hayseed

Rank: Advanced Member

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

hey plas..... wabbit pulled it from the open market..... drop him a pm for it now.... noticed your earlier post.... i don't have 9.2 or the mdk so theres no way for me to check.... just shootin from the hip here, if the two are not compatiable it should be a easy fix.... as long as the dll was reinstalled, can't imagine much more than a version name issue and hard to imagine that..... wabbit would know best.....h
wabbit  
#16 Posted : Monday, February 26, 2007 3:46:12 AM(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)
For anybody that is using the revised Latch in the Forum.dll please be aware there is a logic aberration that is listed in the truth table (above). I will let you figure out where the aberration lies. (If anyone wants to re-map the logic table, you will easily see where the instance occurs.) Please note: it is not an error nor a bug, it is an irregularity.

I will not change the free-ware version as no-one has complained about it, and the results are exactly as posted in the table above (Although I wrote it, I no longer agree with the table.)


Hope this helps.

wabbit [:D]


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.