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
Patrick  
#1 Posted : Tuesday, July 26, 2005 4:17:36 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)
As per Jose suggestion I have been working towards a function that would allow us to use a variable in all Metastock functions. We would then not have to use LastValue(variable+prev-prev) trick. So it was easy enough to fill an array with just the last value of any variable, I just can't figure out what metastock expects. I tried casting reinterpreting etc ... with no success. So why am I writing this ... Well first to let people know that I'm working on this and maybe get some suggestions from some of you guys :D Patrick :mrgreen:
Jose  
#2 Posted : Wednesday, July 27, 2005 7:28:03 AM(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)
Hmmm... tricky stuff, Patrick. How about replicating the LastValue(variable+PREV-PREV) trick using C++ loops to replace the two PREV functions - would that work? jose '-)
Patrick  
#3 Posted : Thursday, July 28, 2005 8:03:48 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)
Quote:
How about replicating the LastValue(variable+PREV-PREV)
Not going to work ... Tried it :( Even if I just create a function with the number inbedded it still does not believe that my function returns a constant value ... I have tried as many things as I could think of but my guess is that our only option is to rewrite the indicators ourselves and make them accept variable values ... Which should not be too difficult however there so many indicators that I don't know I f I want to spend the time recreating all of them. Let me sulk for a couple of days and I will ( hopefully ) come up with another idea ... Patrick :mrgreen:
Patrick  
#4 Posted : Tuesday, August 2, 2005 12:51:28 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)
Finally found a way to get rid of +prev-prev :D I will test some more and post the dll and instructions later. Patrick :mrgreen:
Jose  
#5 Posted : Tuesday, August 2, 2005 8:25:27 AM(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)
Look forward to it - many thanks, Patrick. :) Any chance to keep the dll name short, such as Const.dll or CVal.dll? Short function names are always helpful when MFL coding space is in short supply. jose '-)
Patrick  
#6 Posted : Thursday, August 4, 2005 12:49:29 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)
Jose, I goofed up and I'm working to fix it ... Worse case scenario, why don't you tell me which functions you really need to be variable ... I have been busy, my hard drive had to be reformated etc ... :( So you will to be patient, but I will get there ultimately. Patrick :mrgreen:
Jose  
#7 Posted : Thursday, August 4, 2005 9:32:01 AM(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)
Patrick, probably some of the most useful variable-input functions would be the Ref(), HHV(), LLV(), BarsSince(), ValueWhen() and MA functions. Ok, let's take an EMA with variable periods for example: This won't work, as MetaStock's Moving Average function won't accept variable period inputs: [code:1:d7705381b1] { Chart's ZigZag cycle length } zz:=Zig(x,2,%); zzpk:=Ref(zz,-1)>zz AND Ref(zz,-1)>Ref(zz,-2); zztr:=Ref(zz,-1)<zz AND Ref(zz,-1)<Ref(zz,-2); PkTr:=zzpk OR zztr; CycleLength:=PkTr*(Ref(BarsSince(PkTr),-1)+1); { Variable-period EMA } Mov(TrueRange,CycleLength,E) [/code:1:d7705381b1] This may work (I don't have MetaStock with me on holidays): [code:1:d7705381b1] { Chart's ZigZag cycle length } zz:=Zig(x,2,%); zzpk:=Ref(zz,-1)>zz AND Ref(zz,-1)>Ref(zz,-2); zztr:=Ref(zz,-1)<zz AND Ref(zz,-1)<Ref(zz,-2); PkTr:=zzpk OR zztr; CycleLength:=PkTr*(Ref(BarsSince(PkTr),-1)+1); { Convert CycleLength variable to static value } CycleLength:=LastValue(CycleLength+PREV-PREV); { Variable-period EMA } Mov(TrueRange,CycleLength,E) [/code:1:d7705381b1] Now, using an imaginery staticVar.dll to lock the CycleLength: [code:1:d7705381b1] { Chart's ZigZag cycle length } zz:=Zig(x,2,%); zzpk:=Ref(zz,-1)>zz AND Ref(zz,-1)>Ref(zz,-2); zztr:=Ref(zz,-1)<zz AND Ref(zz,-1)<Ref(zz,-2); PkTr:=zzpk OR zztr; CycleLength:=PkTr*(Ref(BarsSince(PkTr),-1)+1); { Convert CycleLength variable to static value} CycleLength:=ExtFml("Const","CycleLength"); { Variable-period EMA } Mov(TrueRange,CycleLength,E) [/code:1:d7705381b1] jose '-) http://metastocktools.com/#metastock
Nag  
#8 Posted : Thursday, August 4, 2005 11:19:20 AM(UTC)
Nag

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/2/2005(UTC)
Posts: 7
Location: Aix-en-Provence - France

Hi, As I'm only getting back to the MetaStock plugins development, I'm no more an expert in that field (so the following statements shouldn't be taken for law). But I think that a Dll function that returns a constant value is impossible as Dll functions return a MSXDataInfoRec pointer which is basically a structure containing an array of float values... So the only way to get that done is to use a Dll providing directly indicators that allow a variable period in input, as the one I developped... Just my two cents, Patrick (aka Nag)
Patrick  
#9 Posted : Thursday, August 4, 2005 2:30:03 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)
Quote:
But I think that a Dll function that returns a constant value is impossible as Dll functions return a MSXDataInfoRec pointer which is basically a structure containing an array of float values... So the only way to get that done is to use a Dll providing directly indicators that allow a variable period in input, as the one I developped...
Thanks for letting me know ... I figured I would have a hard time but I'm stubborn, I was thinking of a 2 dimensionnal array :oops: ... Well so far it did not work out but it was a good learning experience :D Now regarding the dll you developped are you going to make it freely available? What are you plans for it ... Or should I start working on recreating all the work you have already done :) Jose, thanks for the examples, I guess I will start from there now. Patrick :mrgreen:
bradulrich  
#10 Posted : Friday, August 5, 2005 4:16:18 AM(UTC)
bradulrich

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/5/2005(UTC)
Posts: 35

Ah, When I started working on MY set of adaptive indicators (http://thedml.com/pages/products/asi.html) about a year ago, I didn't know of anyone else with adaptive indicators. Now I know of three. :? Needless to say, I hoped to sell these indicators since I thought they were the only ones available....and I still think that I have found some novel applications of them that have been somewhat overlooked. Just a couple comments on the development of the indicators: I agree with Nag, I think it is impossible to find a workaround that will solve the problem of a constant input. That's all I can say, and I thought about it for a long time. Finally, I am still hoping to sell my set on indicators...a basic set will cost around $80-$100. This set will include around 10 "building block" indicators. An entire set of around 40 will cost maybe around $180. At first glance, you may turn these down in favor of some free ones, and I can't blame anyone for that. However, being designed to be sold for profit as a professional product, they do have some advantages. 1.) The first set comes with a 30 plus page manual, the other, which is packaged with an Ehlers' Indicator set, comes with an approx. 60 page manual. The manuals contain specific examples of how to use the indicators for several very specific purpose, including loops. 2.) They have been tested very rigorously, and they match there metastock counterparts exactly. 3.) They have been optimized with a specific algorithm. When comparted to the easy or most intuitive algorithm (which I'm not sure if Nag or patrick have used) the optimized algorithm calculates the results about an order of magnitude (10 times) as fast. The technique is known as a "sliding window" algorithm. 4.) It is also going to contain a handful of formula building tools that the MS community has been asking for for a while. So once again, I can't blame anyone for taking any certain action with their own work, but I should be offering the deal above through my site in the next week or two. Just have to get the new product information up there, and I haven't had time to get around to changing the site. I wish I could have waited until I had the new site up, but oh well. Finally, I hope you look into our ADSI toolkit...The next release of it should be very soon, and it will contain more high level tools like expert advisors and systems based on the ADSI indicators. Our new site is also going to have a forum very similar to this one specifically for discussing adaptive indicators and their applications, including ADSI. Good luck in your coding, Brad Ulrich The Dynamic Market Lab, LLC www.thedml.com
Patrick  
#11 Posted : Friday, August 5, 2005 4:28:56 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)
Well Brad, I hope you realise that I'm not doing this to compete with you ... If you take a look at the date of some of the post talking about adaptive functions, you will see that they were made before your website went live ;) Ultimately I am sorry that I do these for free but like you said I'm not a professional. On the other hand I do not believe that adaptive indicators alone are worth much ... Hell I like the latch function 1000's better ;) because that is something that always bugged me when I wrote formulae for MetaStock. Patrick :mrgreen:
StorkBite  
#12 Posted : Friday, August 5, 2005 4:43:28 AM(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)
Quote:
...but like you said I'm not a professional.
Wrong!!!!!
Patrick  
#13 Posted : Friday, August 5, 2005 4:44:36 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)
:lol: What is wrong ?
StorkBite  
#14 Posted : Friday, August 5, 2005 4:50:32 AM(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)
You're are professional as it comes. Why wouldn't you be? Because you don't make a living selling proprietary products for your own corporation? P L E A S E! Indeed, you write formula's for the most popular technical software sold... not to get rich, but to help others learn. You are a team player by design and a damn good one. Stop the self-debasing junk... you're a professional! :wink: p.s. I'll wait for the free version to come out. Who needs the manual when you can get the designer live on the forum?! Heck, I'll write the FAQ for you! LOL!
Patrick  
#15 Posted : Friday, August 5, 2005 5:00:40 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)
Well ... Thanks ... :oops: I dont know whatelse to say besides: "Let's go make fun of marilyn last chit chat post " :D
Jose  
#16 Posted : Friday, August 5, 2005 7:12:50 AM(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)
Nag wrote:
But I think that a Dll function that returns a constant value is impossible as Dll functions return a MSXDataInfoRec pointer which is basically a structure containing an array of float values...
Thanks, Patrick (aka Nag). However, I would have thought that if LastValue(variable+PREV-PREV) works in MetaStock to convert variables to static values, perhaps that same MS trick could be replicated by using loops within the dll to replace the two PREV functions - similar to AmiBroker's (much faster) loop function replacing MetaStock's PREV function. I don't know... this variable to static problem "smells" like it should have a solution... jose '-) http://metastocktools.com/#metastock
bradulrich  
#17 Posted : Friday, August 5, 2005 1:31:17 PM(UTC)
bradulrich

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/5/2005(UTC)
Posts: 35

Patrick, I never said you were not a professional, I said that what I have is a complete professional product. I am sure that you can come up with one just as good, but it will take a substantial effort. You are doing great work for Equis, they should be really glad they have you. They have needed someone doing what your doing for a long time. If I was getting paid by Equis for what I did/am doing, I wouldn't charge for it, but I'm not. So like I said, no hard feelings there....bad news for me, good news for the MS customer !!! Brad
bradulrich  
#18 Posted : Friday, August 5, 2005 1:39:57 PM(UTC)
bradulrich

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/5/2005(UTC)
Posts: 35

You may be right there, However, I think that this would not be possible with the Developer's Kit as is stands now....The PREV functions are not passed into the DLL in any way. I have always seen the +PREV-PREV trick as basically be a special case for the Metastock formula parser. This process happens internally in Metastock. However, for someone like Patrick with access to the source, it may not be... this is all pretty hairy stuff though :lol: Brad
Marilyn  
#19 Posted : Friday, August 5, 2005 3:01:27 PM(UTC)
Marilyn

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/10/2004(UTC)
Posts: 863
Location: Salt Lake City, UT

<chiming in my 2 cents as usual> When Patrick used to work in support we did charge for his work... so ergo you are a professional Patrick so shhh. :) What we do on this forum... well, that's a different story. Patrick and I both have full time rolls that do not include the forum. This little brain child was hatched as a crazy plan mid last year. And as most of you know didn't really get off the ground until Jan... The time that Patrick puts in working on dlls, formulas and posting.. most of that is his time, freely given. That spirit of giving freely and sharing to help others is what this forum is all about. None of us would be here if we couldn't learn from each other. No criticizing people who charge for their work... but you have to respect people who help for the love of helping too. :)M
Nag  
#20 Posted : Friday, August 5, 2005 4:14:56 PM(UTC)
Nag

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/2/2005(UTC)
Posts: 7
Location: Aix-en-Provence - France

Sorry, Patrick, but I don't think that I will release my Dll freely to the public, as it's been quite a long time to develop and test... but you'll see that by yourself for sure :wink: But I plan to update it, in order to provide an adaptative version of any indicator in MS that comes with a fixed period. And I guess that it'll be available for a few tens of $. Those indicators, as you stated, are perhaps not worth much, but they still answer a need that MS hasn't be able to address for a long time (as I coded my Dll in 2001 :shock: that long ? :) ). At the moment, I'm building a website to present my work, as I have some other plugins that might interest the community of MS users/developers. Patrick (the other one aka Nag :wink: )
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.