Discussions
»
Product and Service Development
»
MetaStock
»
Cross and divergence functions not working in explorer
Rank: Newbie
Groups: Registered, Registered Users Joined: 9/19/2007(UTC) Posts: 3
|
Hi, I was wondering if anyone may be having the same problem that I describe below:
When using the explorer power tool and coding either the cross function or the divergence function in the filter; viz:
Cross(colA,colB), where colA = Mov(CLOSE,5,EXPONENTIAL) and colB = Mov(CLOSE,10,EXPONENTIAL),
I am finding that that the explorations always yield no result. Yet I am physically observing such crosses on the charts themselves. All my other trial explorations, eg. ColA > Col B are yielding results, but those with the cross function (and divergence function) are not yielding any results when I know the criteria are being met. I have also tried other combinations such as a simple cross of the close above the moving average, but I never get a result.
This is such a simple bit of coding that I cannot see why it is not functioning. I have checked that the data is up to date and that its looking at the right stocks and the right directory. I have tried looking for possible configuration issues, but there aren't many to set, so it should be straight forward.
Has anyone else had this problem and do you know a fix?
Thanks in advance.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/18/2007(UTC) Posts: 99 Location: sydney australia
|
why don't you simply use the cross-function, directly into the filter (without columns, except columnA, where you put C {for close}
Cross(Mov(CLOSE,5,EXPONENTIAL),Mov(CLOSE,10,EXPONENTIAL))
then you won't have any more problems
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 9/19/2007(UTC) Posts: 3
|
Hi Amory,
Thanks. Surprisingly, that worked.
Makes when wonder what all the columns are doing their seeing that the manual instructs users to insert their functions their and refer to them from the filter.
Also make me wonder if its a bug that euis know of and are looking to remedy. Seeing that the versions are so far advanced since the 90's I am surprised that there is a problem. Unless of course I am missing something completely.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/18/2007(UTC) Posts: 99 Location: sydney australia
|
Rom, glad it worked for you. you will find that columns with formulas in them don't interact very well with each other, but the filter is happy to deal with them. of course, that whole system is outdated & the experts as you will have noticed, set up their formulas in a much more efficient way. myself able to read it, but when it comes to writing I stick to the columns & filter.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Rom
There's a reason why the filter does not work with Cross(). The filter is only active on the last bar of data, and as it reads only the last bar's results from two columns it cannot possibly calculate in the filter that a cross has occurred. The Cross() function requires 2 bars of data to give to give a result (a before bar and an after bar), and no column can supply that to the filter. Columns only report the last bar value to the filter, at the time when it is active - column results from previous bars cannot influence the filter in this situation.
The solution that Amory suggested works because a Cross() function used in the filter forces the filter to consider both "before" and "after" results (uses last two bars). The same outcome could be obtained by using Cross() in column A and then requiring the filter to test for a TRUE from colA. In that situation column A would force the use of two bars (before and after) to provide a result on the last data bar for the filter to test.
Roy
MetaStock Tips & Tools
|
|
|
|
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, If speed is important to you, the use of the Colx function is slower than just using the filter condition as the function calls within the exloration are similar to Fml(), FmlVar() and ExtFml() function calls which are all slow functions, so their use should be minimised unless absolutely necessary. You can test this yourself using a couple of simple explorations: run each exploration a few times for accurate results... Code:{Exploration 1}
{Column A - Close}
CLOSE
{Filter}
CLOSE > 10
Code:{Exploration 2}
{Column A - Close}
CLOSE
{Filter}
ColA > 10
You should notice the first exploration is slightly faster than the second. With such a simple test the speed difference is small, but still noticeable; with more complex computations the speed difference becomes more apparent. To get the best performance from explorations, in addition to using good data management and loading only as much data as is needed to generate correct results, use the exploration columns to display information where the values in the columns are important, and use the filter to make the selection criteria. e.g. DON'T do this: Code:{Column A}
MACD()>Mov(MACD(),9,e);
{filter}
ColA=1;
because we know Column A will just be full of 1's and this serves very little purpose! You would be better served doing this: Code:{filter}
MACD()>Mov(MACD(),9,e);
If you wanted to return a list of all stocks with a CLOSE greater than 10, like in the explorations at the top, do you really need to see the CLOSE price? or would you just be happy to know the exploration returns a list of tickers? In the latter case, you dont need to see a column full of numbers, so the fastest exploration would simply be: Of course, if you wanted to then sort the list by their price then you would need to return a column of price data on which to perform the sort. Careful consideration of the requirements of EVERY exploration and some careful coding will ensure the correct results are returned in the fastest time. Hope this helps. wabbit [:D]
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 9/19/2007(UTC) Posts: 3
|
Thanks guys. This is golden information.
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
MetaStock
»
Cross and divergence functions not working in explorer
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.