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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
wabbit  
#1 Posted : Sunday, June 10, 2007 12:46:36 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)
The MetaStock Forum Crew originally wrote the Forum.dll back in 2005 (let's be honest, Patrick wrote the Forum.dll back in 2005). Since then a number of issues have been raised about the existing functions and some people would also like to have some more functionality added. Its time we reviewed the file and gave it a freshen up.

I have just finished another semester at University and now have some time to dedicate to updating the Forum.dll and the documentation.

I need your assistance to find out what you would like changed. What errors / bugs have you discovered that you want fixed? What functions just don't quite do what you want them to do, or don't behave like you think they should? What new functionality would you like to see?

(Please note: this is not the opportunity for you to ask for custom functions for yourself (you can pay to have these written) Any new functions must be "globally useful" to the majority of MS users. Applications to write data or interface with the MS user interface will NOT be considered for inclusion.)

The updating / fixing of existing functions will be afforded a higher priority than new functions.

Add your comments and requests here. Please make sure to provide as much detail as possible. If I have to ask questions to try to find out what you think you meant in the request, then I will simply ignore the request.

This is your opportunity to get something for nothing and help your fellow MS users, so get those thinking caps on!


wabbit [:D]



PTJim  
#2 Posted : Sunday, June 10, 2007 9:47:01 AM(UTC)
PTJim

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/10/2006(UTC)
Posts: 252

Thanks: 11 times
Was thanked: 9 time(s) in 6 post(s)
I don't know if it's possible to do such a thing on the fly with a .DLL, but I think it would be useful to implement Heikin-Ashi candlestick charts since Equis doesn't seem in much of a hurry to do it.

Interestingly, one of my bookmarks is this one, wherein back in 2004 an Equis person wrote an essay on how to (sort of) implement Heikin-Ashi. It would certainly be nice to be able to generate a HA chart without all the extra steps of exporting to another application to perform the averaging calculations.

Thanks for your consideration.

wabbit  
#3 Posted : Sunday, June 10, 2007 7:52:00 PM(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)
PTJim,

The implementation of HA would require either writing a new MS data file or accessing the MetaStock user interface, or both. There are other products available to read MS data files and write HA data files for MS and no .dll has access to the user interface, so this will not be implemented, sorry.

Also, in order to produce a candle you need four data arrays (OHLC) whereas only one array can be returned from a .dll for MS.

In the mean time, this might help:
http://forum.equis.com/forums/post/18678.aspx
gawdib  
#4 Posted : Thursday, June 14, 2007 8:55:45 AM(UTC)
gawdib

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 11/10/2005(UTC)
Posts: 31

Lately, I have been having a lot of problems seemingly caused by Forum.mov.

Lots of messages that it is causing 1 Error in column A: An MSX DLL is reporting a floating point invalid operation error. Referenced DLL: "Forum.MOV

2 and/or

Error in column A: An MSX DLL has incorrectly produced results prior to the first loaded price data record. Referenced DLL: "Forum.MOV"

and/or 3. causing the exploration to stop and that there is a windows error and that windows has to close Metastock down.

Something corrupted?

Geo

gawdib  
#5 Posted : Thursday, June 14, 2007 8:57:58 AM(UTC)
gawdib

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 11/10/2005(UTC)
Posts: 31

There has been mention in the past of a lot of "instability" in these dll s. That would seem an important issue. Geo

wabbit  
#6 Posted : Thursday, June 14, 2007 6:35:18 PM(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)
Thanks gawdib,

I have made some error handling already for the Mov function, but will checkout any more error possibilities, and try to handle them too.

Could you be a bit more specific about this instability? The .dll becomes unstable when trying to use which functions on which charts or data sets, indicators etc. The more information you can provide, the easier it will be to identify the culprit code and correct it.


wabbit [:D]

gawdib  
#7 Posted : Thursday, July 5, 2007 11:20:11 AM(UTC)
gawdib

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 11/10/2005(UTC)
Posts: 31

dear Roy:
Thank you ever so much for your guidance. It gave me confidence as to where i might investigate next. I found the culprit!!!
It involves the forum dll, in all the different versions i have, is what causes it, that is when the forum.dll is used in the explorer and with the "security function".
This involved using the forum.dll as part of the "pvtorig" fml i composed . This fml causes no problem in the explorer when it is not used as part of that security function!!
By the way as part of my investigations when using the forum dll, explorer came up with a new reason for rejection. "the msxdll produced results pror to the first loaded price data record. " I have loaded 5000 records into explorer and the stock itself goes back to 1990.
I have no ideas what that might mean.
I am thrilled that i can no proceed ahead with my analysis.
Best regards, Geo

[edited by wabbit : formatting made post unreadable / reading difficult]
wabbit  
#8 Posted : Thursday, July 5, 2007 7:39:23 PM(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)
Geo,

Can you please post the code you are using that causes the errors, or at least post what functions in the Forum.dll you are calling that generates the errors.

I know what the error means and what causes the error, but there are 30 or so functions in the Forum.dll and a few thousand lines of code, so knowing where to start looking will simplify the bug-hunt. (That is assuming I can get the full and complete version of the original source code?)


wabbit [:D]


Spaceant  
#9 Posted : Thursday, July 5, 2007 10:14:04 PM(UTC)
Spaceant

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/16/2005(UTC)
Posts: 182

Wabbit,

Would you consider to add another "latch" function with another Karnaugh Map as we discussed earlier? Or would it be considered as another latch function (or dll) that MS users can opt for?

Regards,

Sa

wabbit  
#10 Posted : Thursday, July 5, 2007 10:33:33 PM(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)
sa,

I have written seven different versions of the latch function for clients according to their specific trading requirements and styles. I have two of my own. I guess what this means that it would be virtually impossible to have a single function that globally, everyone will be happy with.

I was toying with the idea to allow the user to have their own maps of the function, but this adds another level of complexity for less experienced or less capable users. As the Forum.dll is offered free, as-is and without any real support mechanism, the simpler the product the better for all users.

I guess the simple solution is, if you want a customised function based on your own requirements, give me a call. [:)] Once you have the map defined, it is a relatively simple matter to create the function.


wabbit [:D]


gawdib  
#11 Posted : Tuesday, July 10, 2007 10:12:11 AM(UTC)
gawdib

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 11/10/2005(UTC)
Posts: 31

All versions of the variable moving avergage in forum and Asi seems to cause problems when used in the explorer. When I plot indicators on charts, there messages about floating point errors rarely if ever , come up. I am not sure if this happens just with the "security data" fml functions or with any indicator.

I also have the impression that the variable HHV causes problems too, since I frequently get a message that the indicator will not work because there are zero periods in the hhv.

Unfortunately, Metastock makes it impossible, in a practical sense, to trace these things down, because Metastock does not make it possible to do a "Windows search like" action so as to find which indicators include the mov or HHV things in it. Geo

wabbit  
#12 Posted : Tuesday, July 10, 2007 11:02:37 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)
gawdib wrote:
All versions of the variable moving avergage in forum and Asi seems to cause problems when used in the explorer. When I plot indicators on charts, there messages about floating point errors rarely if ever , come up. I am not sure if this happens just with the "security data" fml functions or with any indicator.


I will have a look into this and do some experiments to see what I can turn up.

gawdib wrote:
I also have the impression that the variable HHV causes problems too, since I frequently get a message that the indicator will not work because there are zero periods in the hhv.


This is not a problem with the function, it seems more like a problem with however you are setting the variable length. How do you define HHV(H,0) ? Perhaps you should check your values BEFORE calling the function? e.g.
Code:

myVariableLength := If(myVariableLength<=1, 1, myVariableLength);
ExtFml("function.VarMov",data, myVariableLength, type);


gawdib wrote:
Unfortunately, Metastock makes it impossible, in a practical sense, to trace these things down, because Metastock does not make it possible to do a "Windows search like" action so as to find which indicators include the mov or HHV things in it.

The source code and the users manual are available and highlight the most common problems. I will see what other information needs to be included in the documentation.


wabbit [:D]

mastermedea  
#13 Posted : Sunday, August 19, 2007 1:55:24 AM(UTC)
mastermedea

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 6/26/2007(UTC)
Posts: 12

I am very new to Metastock and not sure if the following requests are relevent. However I take all of my courage to post them:

1) Why should the rsi() function requires the number of data loaded even though it already specifies "rsi(14)"? It took me a lot of time to get to understand why the rsi(14) in my exploration returns a different value from what actually appears on chart until I found out that "loaded periods" issue. The problem I realize among my friends is they all try to study MS on their own and details such as loaded periods for RSI calculation is too subtle for them to recognize.

2) Whether it is possible to allow some functions such as Ref, Peak etc. having a number-returning formula in place of the constant among its parameters. For example, is it possible to arrive at such formula as Ref(c,-1*peakbars(1,c,5)-1) ?

thanks and best regards,

wabbit  
#14 Posted : Sunday, August 19, 2007 2:58:43 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)
Let's deal with the easier part first...
mastermedea wrote:
2) Whether it is possible to allow some functions such as Ref, Peak etc. having a number-returning formula in place of the constant among its parameters. For example, is it possible to arrive at such formula as Ref(c,-1*peakbars(1,c,5)-1) ?

Most of the indicators in MetaStock only allow "static" values to be input as an argument to the function. There are some ways to "convert" the dynamic value (such as the result from a computation) into a static value; this usually involves the LastValue() function and some PREVs and has limited applications and some serious drawbacks to the real life trader and the speed of execution of the code. To alleviate some of these limitations, a Team (comprising nearly solely of Patrick) wrote some functions that instead of receiving static values, received dynamic values, making them "adaptive" (which was the buzz-word of the time). These functions were published in the freely available Forum.dll addon.

Included in the exisiting package are functions such as variable-length moving average and variable length RSI functions. Instead of entering, for example RSI(14) you could have an adaptive RSI function between values such as RSI(7) to RSI(21). Similar for the moving averages and the variable period lookback function or Ref(). Only those indicators that were considered valuable by traders were coded, Peak, Trough, Zig etc were not re-coded and included in the addon as these dynamic functions cannot be used by the majority of traders, or should not be used as a basis for making for trading decisions.

To achieve the aim of the code snippet you provided:
Code:
prd:=PeakBars(1,C,5)-1;
data:=ExtFml("Forum.Ref",C,prd);
{return}
data;

Notice here, the Forum.Ref function does not take a negative value, the reasons for this are explained in the Forum.dll Users Manual (Hopefully at some time I will get some time to do some more reviewing of the manual too?)

mastermedea wrote:
1) Why should the rsi() function requires the number of data loaded even though it already specifies "rsi(14)"? It took me a lot of time to get to understand why the rsi(14) in my exploration returns a different value from what actually appears on chart until I found out that "loaded periods" issue. The problem I realize among my friends is they all try to study MS on their own and details such as loaded periods for RSI calculation is too subtle for them to recognize.

From my experience most people trying to "learn MS" in fact don't try to learn anything. They install the program and then expect to start making money without doing anything, and particularly without learning anything. There is a lot to learn and most of it has absolutely nothing to do with MetaStock. People hear words like "stochastics", "RSI", "moving averages (or MA)" and think they can make money with these just because they happen to discover MetaStock has an implementation of these. Many people aren't even aware that "Stochastics" as applied in the field of Technical Analysis has absolutely nothing to do with the proper definition of stochastics as it applies to mathematical statistics! They hear the word and think because it sounds technical it must be good!

Every function, every system, every step of every process used in making trading decisions must be fully rationalised and re-discovered or proven from first principles to make sure it applicable to the trader and their trading style. Only people who understand the construction of the RSI(), for example, can understand its capabilities and limitations and successfully apply it to their trading. I suspect there are many traders who get lucky without knowing why but I suspect there are many more who have no idea why their RSI-based system performed or failed to performed in particular situations. Not only does the trader have to understand the concept as conceived, they have to understand the implementation of that concept in their software package of choice. For example, AmiBroker, BullCharts and MetaStock all have different inplementation of the Average True Range function. A trader with an ATR based system in AmiBroker may not have the same success with the system should they choose to export the idea to MetaStock, and vice-versa. The original ideas of people like Welles Wilder etc have been implemented in many many systems and each time a small change to the algorithm here and a small tweak there changes the underlying fundamental operation of the indicator, which changes its performance and its limitations. There are some algorithms that have been through so many changes it has obfuscated the original recipe completely!

The reason that functions like the RSI() require a lot more data than the 14 days specified in RSI(14) is because the function uses Wilders smoothing, which like exponential moving averages are Infinte Impulse Response (IIR) filters. IIRs always have a little bit of history included in them, which gets less significant with the passing of time, but never disappears completely. Conversely, Finite Impulse Response (FIR) filters such as simple moving averages e.g Mov(C,21,S) only contain data from the last 21 bars. On the next bar, the information from the bar that is now 22 bars old is dropped and forgotten. It can be demonstrated that you need to load at least five times the required amount of data to avoid precision errors with IIR filters in explorations and their charted comparison. If you are trying to observe the RSI(14) you should load at least 70 bars of data in an exploration. But why not load more? Many people think will slow down the exploration, but I ask, what would you prefer, correct results attained eventualy or wrong results achieved quickly? Load as much data as you can, it is safer. Some time later, when you have a better grasp of the indicators and how they all interact you might consider reducing the data load.

It is possible to re-write the RSI() function removing the Wilders smoothing IIR filter, allowing the old data to "fall out" of the recent computations. This can be said for just about all of the functions, but the trader has to be aware of the ramifications of making these changes. Replacing IIRs in indicators with FIRs may change the fundamental operation of the indicator making it more dangerous than the original.

Many of these issues have been mentioned in some detail in the MS Users Manual and in some excruciating detail at some point in time on this Forum. There is a very useful search function that should allow any Forum member to attain whatever information they require on just about any indicator; the beauty of the peer-to-peer support forum is that if after doing a thorough search the member cannot find the required information they can ask for assistance from their peers. Noone needs to learn in isolation.


Hope this helps.

wabbit [:D]
jjstein  
#15 Posted : Friday, September 7, 2007 7:06:29 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)

How about a function which returns the symbol of the current security?

wabbit  
#16 Posted : Friday, September 7, 2007 11:37:19 PM(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)
jjstein wrote:
How about a function which returns the symbol of the current security?


Functions can only return numerical values.

What were you thinking of attempting?



wabbit [:D]

jjstein  
#17 Posted : Saturday, September 8, 2007 3:47:27 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)

Something for use with index charts and composite-type indicators, such as created w/the FIRE add-on:

Symb:=SecuritySymbol();

v1:=Security("\METASTOCK DATA\INDICES & INDICATORS\COMMON MARKET INDICATORS\X.AMEX-V",V);
v2:=Security("\METASTOCK DATA\INDICES & INDICATORS\COMMON MARKET INDICATORS\X.NASD-V",V);
v3:=Security("\METASTOCK DATA\INDICES & INDICATORS\COMMON MARKET INDICATORS\X.NYSE-V",V);

vv:=if(Symb=".XAX",v1,if(Symb="IXIC",v2,if(Symb=".NYA",v3,v)));

vv; {Elder force, normalized, etc}

wabbit  
#18 Posted : Saturday, September 8, 2007 6:44:31 PM(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)
jj,

This is do-able. In the external function we can compare the name of the current security with the name provided in the argument, if they are the same return a value of TRUE otherwise FALSE:

Code:
v1:=Security("\METASTOCK DATA\INDICES & INDICATORS\COMMON MARKET INDICATORS\X.AMEX-V",V);
v2:=Security("\METASTOCK DATA\INDICES & INDICATORS\COMMON MARKET INDICATORS\X.NASD-V",V);
v3:=Security("\METASTOCK DATA\INDICES & INDICATORS\COMMON MARKET INDICATORS\X.NYSE-V",V);

vv:=if(extfml("forum.Symb",".XAX"),v1,if(extfml("forum.Symb","IXIC"),v2,if(extfml("forum.Symb",".NYA"),v3,v)));

vv; {Elder force, normalized, etc}



There have been delays in getting the original source code for the revision, so if you want this function, get in contact via email/skype to arrange something, otherwise I am waiting on another person to get me some more mandatory information to update the Forum.dll library of functions.



wabbit [:D]
wblam  
#19 Posted : Sunday, September 9, 2007 8:00:27 AM(UTC)
wblam

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/25/2006(UTC)
Posts: 79

Hi wabbit,

Can you have a look to the DateRange function.

I still do not know what the formula:

ExtFml("Forum.DateRange",20070102 , 0);

will return.

Sometime it return a 1 for date after Jan 2, 2007.

Sometime it return a zero or other number.

wabbit  
#20 Posted : Sunday, September 9, 2007 6:48:54 PM(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)
wblam,

the function:
Code:
ExtFml("Forum.DateRange",20070102 , 0);

will return TRUE for all dates ON OR AFTER 02 January 2007. Similarly:
Code:
ExtFml("Forum.DateRange",0 ,20070102);

will return TRUE for all dates BEFORE 02 January 2007. Please notice the difference between "on or after" and "before"

To return TRUE for dates between two values:
Code:
ExtFml("Forum.DateRange",20070102 ,20070910);

will return true for all dates on or after 02 January 2007, but before 10 September 2007.

To only return TRUE on a key date, enter the date in both arguments:
Code:
ExtFml("Forum.DateRange",20070102 , 20070102);

but beware there are issues with the behaviour of these date functions. The code immediately above will only return a true value if there is a bar for that date, if the stock did not trade on that date then the result will be FALSE for the entire chart.

Are you getting different behaviour?


wabbit [:D]


Users browsing this topic
Guest (Hidden)
2 Pages12>
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.