|
|
UPDATED LATCH AND RANDOM FUNCTIONS COMPLETE [RESOLVED]
Last post 02-26-2007, 3:46 by wabbit. 15 replies.
-
04-12-2006, 0:33 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
UPDATED LATCH AND RANDOM FUNCTIONS COMPLETE [RESOLVED]
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.xls
The table is also below for you to peruse....
What I need from y'all is to complete the logic of the table! i.e. define what value the latch returns in different scenarios of LE,LX,SE,LX given the previous value of the latch.
Now the previous bar has FOUR values:
NA if the 1st bar on the chart (yesterday didnt exist!),
0, there was 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
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
-
04-12-2006, 2:38 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
Re: UPDATED LATCH AND RANDOM FUNCTIONS COMPLETE [RESOLVED]
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
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
-
04-12-2006, 9:36 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
UPDATED LATCH AND RANDOM FUNCTIONS COMPLETE - TESTERS REQ
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
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
-
04-12-2006, 12:02 |
-
04-12-2006, 16:38 |
-
04-13-2006, 16:14 |
-
04-13-2006, 20:24 |
-
04-14-2006, 2:21 |
-
smg
-
-
-
Joined on 08-13-2005
-
-
Posts 92
-
-
|
Latch function of FORUM Dll and your Dll
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
|
|
-
04-14-2006, 3:03 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
Re: Latch function of FORUM Dll and your Dll
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!
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
-
04-14-2006, 7:15 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
Re: Latch function of FORUM Dll and your Dll
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
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
-
-
04-14-2006, 11:48 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
smg: 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:
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
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
-
04-17-2006, 2:55 |
-
04-20-2006, 11:24 |
-
04-20-2006, 12:44 |
-
02-26-2007, 3:46 |
-
wabbit
-
-

-
Joined on 10-29-2004
-
Perth, Western Australia
-
Posts 1,637
-
-
|
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
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK For custom MetaStock programming : http://www.wabbit.com.au My SkyPE status :  My SkyPE account : wabbit.com.au
|
|
|
|