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, May 3, 2005 2:13:31 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)
Let's use this thread to discuss functions that could be programmed into a dll. Patrick
Jose  
#2 Posted : Tuesday, May 3, 2005 6:00:28 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)
How about a CurrentValue.dll, similar to the LastValue() MS function, but instead it locks the current value (changes variable data into a static expression), rather than the last value in the data array... This kind of works sometimes: CurrentValue:=LastValue(DataArray+PREV-PREV); This new function would allow, for example, a comparison of the current bar's Close to previous Close values. Very useful - anyone can do? jose '-) http://www.metastocktools.com
Jose  
#3 Posted : Tuesday, May 3, 2005 6:36:19 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)
A simple loop function would be a definite must-have in MetaStock. Perhaps something basic like this may be enough: ExtFml("Loop",Expression,IterationStore,LoopCount) jose '-) http://www.metastocktools.com
Patrick  
#4 Posted : Wednesday, May 4, 2005 3:38:38 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 got my hands on the MDK Manual :mrgreen: Thanks Jose for the ideas I will take a look at it. Patrick
Jose  
#5 Posted : Wednesday, May 4, 2005 8:40:26 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, would you be able to post a copy (pdf?) of the MDK manual for all to see? Perhaps this may increase interest amongst C++/VB/Delphi programmers. jose '-) http://www.metastocktools.com
Patrick  
#6 Posted : Wednesday, May 4, 2005 5:28:57 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)
I don't think I can post the manual but here is a sample code for C++ of Moving Average Function #include <string.h> #include <stdlib.h> #include <math.h> #include <float.h> #include "MSXStruc.h" // we don't want C++ name-mangling #ifdef __cplusplus extern "C" { #endif const int NMyFuncs = 3; // three functions // arg constants for MyMov const int NMyMovArgs = 3; // 3 arguments const int NMyMovCustStrings = 8; // 8 custom strings for third arg // arg constants for AddN const int NAddNArgs = 2; // 2 arguments // arg constants for SumArrays const int NSumArraysNArgs = 1; // 1 argument BOOL __stdcall MSXInfo (MSXDLLDef *a_psDLLDef) { // copy in your copyright information... strncpy (a_psDLLDef->szCopyright, "C Sample MSX DLL, Copyright (c) Equis International, 2000", sizeof(a_psDLLDef->szCopyright)-1); // set the number of functions we are exporting // (don't forget to add them to your .def file) a_psDLLDef->iNFuncs = NMyFuncs; a_psDLLDef->iVersion = MSX_VERSION; return MSX_SUCCESS; } BOOL __stdcall MSXNthFunction (int a_iNthFunc, MSXFuncDef *a_psFuncDef) { BOOL l_bRtrn = MSX_SUCCESS; switch (a_iNthFunc) { case 0: strcpy (a_psFuncDef->szFunctionName, "MyMov"); strcpy (a_psFuncDef->szFunctionDescription, "My Moving Average"); a_psFuncDef->iNArguments = NMyMovArgs; break; case 1: strcpy (a_psFuncDef->szFunctionName, "AddN"); strcpy (a_psFuncDef->szFunctionDescription, "Add 'n' to Any DataArray"); a_psFuncDef->iNArguments = NAddNArgs; break; case 2: strcpy (a_psFuncDef->szFunctionName, "SumArrays"); strcpy (a_psFuncDef->szFunctionDescription, "Sum Initialed Price Arrays (OHLCVI)"); a_psFuncDef->iNArguments = NSumArraysNArgs; break; default: l_bRtrn = MSX_ERROR; break; } return l_bRtrn; } BOOL __stdcall MSXNthArg (int a_iNthFunc, int a_iNthArg, MSXFuncArgDef *a_psFuncArgDef) { BOOL l_bRtrn = MSX_SUCCESS; a_psFuncArgDef->iNCustomStrings = 0; switch (a_iNthFunc) { case 0: switch (a_iNthArg) { case 0: a_psFuncArgDef->iArgType = MSXDataArray; // DataArray; strcpy (a_psFuncArgDef->szArgName, "DataArray"); break; case 1: a_psFuncArgDef->iArgType = MSXNumeric; // Numeric strcpy (a_psFuncArgDef->szArgName, "Period"); break; case 2: a_psFuncArgDef->iArgType = MSXCustom; // CustomType a_psFuncArgDef->iNCustomStrings = NMyMovCustStrings; strcpy (a_psFuncArgDef->szArgName, "Method"); break; default: l_bRtrn = MSX_ERROR; break; } break; case 1: switch (a_iNthArg) { case 0: a_psFuncArgDef->iArgType = MSXDataArray; strcpy (a_psFuncArgDef->szArgName, "DataArray"); break; case 1: a_psFuncArgDef->iArgType = MSXNumeric; strcpy (a_psFuncArgDef->szArgName, "Increment"); break; default: l_bRtrn = MSX_ERROR; break; } break; case 2: if (a_iNthArg == 0) { a_psFuncArgDef->iArgType = MSXString; strcpy(a_psFuncArgDef->szArgName, "DA Initials"); } break; default: l_bRtrn = MSX_ERROR; break; } return l_bRtrn; } BOOL __stdcall MSXNthCustomString (int a_iNthFunc, int a_iNthArg, int a_iNthString, MSXFuncCustomString *a_psCustomString) { BOOL l_bRtrn = MSX_SUCCESS; a_psCustomString->szString[0] = '\\0'; a_psCustomString->iID = -1; typedef struct { char *szString; int iID; } LocalStringElement; LocalStringElement l_sTheStrings[] = { {"Simple", 0}, {"S", 0}, {"Triangular", 1}, {"T", 1}, {"Weighted", 2}, {"W", 2}, {"Exponential", 3}, {"E", 3} }; switch (a_iNthFunc) { case 0: switch (a_iNthArg) { case 2: if(a_iNthString >= 0 && a_iNthString < NMyMovCustStrings) { strncpy (a_psCustomString->szString, l_sTheStrings[a_iNthString].szString, sizeof(a_psCustomString->szString)-1); a_psCustomString->iID = l_sTheStrings[a_iNthString].iID; } break; default: l_bRtrn = MSX_ERROR; break; } break; default: l_bRtrn = MSX_ERROR; break; } return l_bRtrn; } // ************************************************************************ // This local utility function is used to help ensure that no overflows // or underflows will occur during calculations. The MSXTest program // Stress Test function will call your DLL with a wide range of values, // including positive and negative values of FLT_MAX and FLT_MIN. // Perform all intermediate calculations using doubles and then force the // results into the range of a float. // Locally defined macros are used to avoid compiler definition differences. // ************************************************************************ #define MSXMax(a,b) (((a) > (b)) ? (a) : (b)) #define MSXMin(a,b) (((a) < (b)) ? (a) : (b)) double ForceFloatRange (double a_lfDbl) { if (a_lfDbl > 0.0) { a_lfDbl = MSXMin (a_lfDbl, double(FLT_MAX)); // make sure pos number <= FLT_MAX a_lfDbl = MSXMax (a_lfDbl, double(FLT_MIN)); // make sure pos number >= FLT_MIN } else { if (a_lfDbl < 0.0) { a_lfDbl = MSXMax (a_lfDbl, double(-FLT_MAX)); // make sure neg number >= -FLT_MAX a_lfDbl = MSXMin (a_lfDbl, double(-FLT_MIN)); // make sure neg number <= -FLT_MIN } } return a_lfDbl; } //------------------------------------------------------------------------ // This is an example of a local function used for calculations. This // one calculates a moving average on the source data array, and puts // the results in the result array. It differentiates its processing // based on whether the moving average is to be weighted or not. //------------------------------------------------------------------------ void MovingAverage (const MSXDataInfoRec *a_psSrc, MSXDataInfoRec *a_psRslt, int a_iPeriod, BOOL a_bIsWeighted) { int l_iIndex = a_psSrc->iFirstValid; int l_iMaxIndex = a_psSrc->iLastValid; double l_lfSum = 0.0; double l_lfDbl; float l_fDivisor; int i; if (a_bIsWeighted) l_fDivisor = float(a_iPeriod) * (float(a_iPeriod)+1.0f) / 2.0f; // sum of the digits formula else l_fDivisor = float(a_iPeriod); l_fDivisor = float(ForceFloatRange (l_fDivisor)); if (l_fDivisor == 0.0) l_fDivisor = 1.0f; while ((l_iIndex + a_iPeriod - 1) <= l_iMaxIndex) { l_lfSum = 0.0; for (i=0; i<a_iPeriod; i++) { if (a_bIsWeighted) l_lfSum += a_psSrc->pfValue[l_iIndex+i] * (i + 1.0f); else l_lfSum += a_psSrc->pfValue[l_iIndex+i]; } l_lfSum = ForceFloatRange(l_lfSum); l_lfDbl = l_lfSum / l_fDivisor; l_lfDbl = ForceFloatRange(l_lfDbl); a_psRslt->pfValue[l_iIndex + a_iPeriod - 1] = float(l_lfDbl); l_iIndex++; } a_psRslt->iFirstValid = a_psSrc->iFirstValid + a_iPeriod - 1; a_psRslt->iLastValid = l_iMaxIndex; } //------------------------------------------------------------------------ // This is another example of a local function used for calculations. This // one calculates an exponential moving average on the source data array, // and puts the results in the result array. See 'The Technical Analysis // Course' by Thomas A. Meyers for algorithm details. //------------------------------------------------------------------------ void ExponentialMovingAverage (const MSXDataInfoRec *a_psSrc, MSXDataInfoRec *a_psRslt, int a_iPeriod) { int l_iIndex = a_psSrc->iFirstValid; int l_iMaxIndex = a_psSrc->iLastValid; double l_lfSum = 0.0; double l_lfDivisor; double l_lfExponent; int i; if (a_iPeriod > 0 && ((l_iIndex + a_iPeriod - 1) <= l_iMaxIndex)) { l_lfExponent = ForceFloatRange(2.0 / (a_iPeriod+1)); l_lfDivisor = double(a_iPeriod); // start with simple moving average; for (i=0; i<a_iPeriod; i++) l_lfSum += a_psSrc->pfValue[l_iIndex+i]; l_lfSum = ForceFloatRange(l_lfSum); a_psRslt->pfValue[l_iIndex + a_iPeriod - 1] = float(ForceFloatRange(l_lfSum / l_lfDivisor)); l_iIndex += a_iPeriod; while (l_iIndex <= l_iMaxIndex) { a_psRslt->pfValue[l_iIndex] = float(ForceFloatRange((a_psSrc->pfValue[l_iIndex] - a_psRslt->pfValue[l_iIndex-1]) * l_lfExponent + a_psRslt->pfValue[l_iIndex-1])); l_iIndex++; } a_psRslt->iFirstValid = a_psSrc->iFirstValid + a_iPeriod - 1; a_psRslt->iLastValid = l_iMaxIndex; } else { a_psRslt->iFirstValid = 0; a_psRslt->iLastValid = -1; } } //------------------------------------------------------------------------------------------- // The following function demonstrates use of three argument types: // MSXDataArray, MSXNumeric and MSXCustom. // A MovingAverage is calculated on the input DataArray for input Periods. // Three moving average methods are available, specified by the Custom ID. //------------------------------------------------------------------------------------------- BOOL __stdcall MyMov (const MSXDataRec *a_psDataRec, const MSXDataInfoRecArgsArray *a_psDataInfoArgs, const MSXNumericArgsArray *a_psNumericArgs, const MSXStringArgsArray *a_psStringArgs, const MSXCustomArgsArray *a_psCustomArgs, MSXResultRec *a_psResultRec) { BOOL l_bRtrn = MSX_SUCCESS; // We expect 3 arguments, 1 DataArray, 1 Numeric and 1 Custom, in that order // The arguments will be found at: // DataArray: a_psDataInfoArgs[0] // Numeric : a_psNumericArgs->fNumerics[0]; // Custom : a_psCustomArgs->iCustomIDs[0]; const MSXDataInfoRec *l_psData; int l_iPeriod; int l_iMethod; int l_iIndex; int l_iMaxIndex; if (a_psDataInfoArgs->iNRecs == 1 && a_psNumericArgs->iNRecs == 1 && a_psCustomArgs->iNRecs == 1) { l_psData = a_psDataInfoArgs->psDataInfoRecs[0]; l_iPeriod = int(a_psNumericArgs->fNumerics[0]); // truncate any fractional period l_iMethod = a_psCustomArgs->iCustomIDs[0]; l_iIndex = l_psData->iFirstValid; l_iMaxIndex = l_psData->iLastValid; if (l_iPeriod > 0 && (l_iIndex + l_iPeriod - 1) <= l_iMaxIndex && l_iIndex > 0 && l_iMaxIndex > 0 && l_iIndex >= a_psDataRec->sClose.iFirstValid && l_iMaxIndex <= a_psDataRec->sClose.iLastValid) { switch (l_iMethod) { case 0: // Simple MovingAverage (l_psData, a_psResultRec->psResultArray, l_iPeriod, FALSE); break; case 1: // Triangular { MSXDataInfoRec l_sTmpRec; l_sTmpRec.pfValue = new float[l_iMaxIndex+1]; if (l_sTmpRec.pfValue) { l_iPeriod = (int)(((l_iPeriod+1.0)/2) + 0.5); MovingAverage (l_psData, &l_sTmpRec, l_iPeriod, FALSE); MovingAverage (&l_sTmpRec, a_psResultRec->psResultArray, l_iPeriod, FALSE); delete l_sTmpRec.pfValue; } else { a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } } break; case 2: // Weighted MovingAverage (l_psData, a_psResultRec->psResultArray, l_iPeriod, TRUE); break; case 3: // Exponential ExponentialMovingAverage (l_psData, a_psResultRec->psResultArray, l_iPeriod); break; default: { // Somehow we got called with an invalid argument strncpy (a_psResultRec->szExtendedError, "Undefined method argument", sizeof(a_psResultRec->szExtendedError)-1); l_bRtrn = MSX_ERROR; // report this as an error } break; } } else { a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } } else { // wrong number of arguments! strncpy (a_psResultRec->szExtendedError, "Wrong number of arguments", sizeof(a_psResultRec->szExtendedError)-1); l_bRtrn = MSX_ERROR; } if (l_bRtrn != MSX_SUCCESS) { // only for serious errors... a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } return l_bRtrn; } //------------------------------------------------------------------------------------------- // The following function will add a constant numeric value to any DataArray //------------------------------------------------------------------------------------------- BOOL __stdcall AddN (const MSXDataRec *a_psDataRec, const MSXDataInfoRecArgsArray *a_psDataInfoArgs, const MSXNumericArgsArray *a_psNumericArgs, const MSXStringArgsArray *a_psStringArgs, const MSXCustomArgsArray *a_psCustomArgs, MSXResultRec *a_psResultRec) { BOOL l_bRtrn = MSX_SUCCESS; int i; // We expect 2 arguments, 1 DataArray, 1 Numeric // The arguments will be found at: // DataArray: theDataInfoArgs[0] // Numeric : theNumericArgs->fNumerics[0]; if (a_psDataInfoArgs->iNRecs == 1 && a_psNumericArgs->iNRecs == 1) { const MSXDataInfoRec *l_psData = a_psDataInfoArgs->psDataInfoRecs[0]; if (l_psData->iFirstValid > 0 && l_psData->iLastValid > 0 && l_psData->iFirstValid >= a_psDataRec->sClose.iFirstValid && l_psData->iLastValid <= a_psDataRec->sClose.iLastValid) { float l_fAddOn = a_psNumericArgs->fNumerics[0]; if (l_psData) { for (i=l_psData->iFirstValid; i<=l_psData->iLastValid; i++) a_psResultRec->psResultArray->pfValue = float (ForceFloatRange(l_psData->pfValue + l_fAddOn)); a_psResultRec->psResultArray->iFirstValid = l_psData->iFirstValid; a_psResultRec->psResultArray->iLastValid = l_psData->iLastValid; } else { strncpy (a_psResultRec->szExtendedError, "Data array argument missing", sizeof(a_psResultRec->szExtendedError)-1); l_bRtrn = MSX_ERROR; } } else { // invalid incoming ranges a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } } else { // wrong number of arguments! strncpy (a_psResultRec->szExtendedError, "Wrong number of arguments", sizeof(a_psResultRec->szExtendedError)-1); l_bRtrn = MSX_ERROR; } if (l_bRtrn != MSX_SUCCESS) { a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } return l_bRtrn; } //------------------------------------------------------------------------------------------- // The following function demonstrates the use of an MSXString argument. // It parses the argument string for the initials identifying Open, High, Low, Close, // Vol or Indicator, and sums their values into the result array. // The result array FirstValid and LastValid are restricted to the common subset of // all selected arrays. //------------------------------------------------------------------------------------------- BOOL __stdcall SumArrays (const MSXDataRec *a_psDataRec, const MSXDataInfoRecArgsArray *a_psDataInfoArgs, const MSXNumericArgsArray *a_psNumericArgs, const MSXStringArgsArray *a_psStringArgs, const MSXCustomArgsArray *a_psCustomArgs, MSXResultRec *a_psResultRec) { BOOL l_bRtrn = MSX_SUCCESS; int i; int l_iFirstValid = a_psDataRec->sClose.iFirstValid; int l_iLastValid = a_psDataRec->sClose.iLastValid; const MSXDataInfoRec *l_psData; // We expect 1 arguments, 1 String // The argument will be found at: // theStringArgs[0] if (a_psStringArgs->iNRecs == 1) { if (l_iFirstValid > 0 && l_iLastValid > 0) { const char *l_pc = a_psStringArgs->pszStrings[0]; if (l_pc) { // init result: for (i=l_iFirstValid; i<=l_iLastValid; i++) a_psResultRec->psResultArray->pfValue = 0.0f; while (*l_pc) { switch (*l_pc++) { case 'O': case 'o': l_psData = &a_psDataRec->sOpen; break; case 'H': case 'h': l_psData = &a_psDataRec->sHigh; break; case 'L': case 'l': l_psData = &a_psDataRec->sLow; break; case 'C': case 'c': l_psData = &a_psDataRec->sClose; break; case 'V': case 'v': l_psData = &a_psDataRec->sVol; break; case 'I': case 'i': l_psData = &a_psDataRec->sInd; break; default: l_psData = NULL; break; } if (l_psData) { l_iFirstValid = __max(l_iFirstValid, l_psData->iFirstValid); l_iLastValid = __min(l_iLastValid, l_psData->iLastValid); for (i=l_iFirstValid; i<=l_iLastValid; i++) a_psResultRec->psResultArray->pfValue = float(ForceFloatRange(a_psResultRec->psResultArray->pfValue + l_psData->pfValue)); } } a_psResultRec->psResultArray->iFirstValid = l_iFirstValid; a_psResultRec->psResultArray->iLastValid = l_iLastValid; } else { // empty string! a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } } else { // invalid first/last a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } } else {// error - no argument passed! strncpy (a_psResultRec->szExtendedError, "Wrong number of arguments", sizeof(a_psResultRec->szExtendedError)-1); l_bRtrn = MSX_ERROR; } if (l_bRtrn != MSX_SUCCESS) { a_psResultRec->psResultArray->iFirstValid = 0; a_psResultRec->psResultArray->iLastValid = -1; } return l_bRtrn; } #ifdef __cplusplus } #endif Patrick
wabbit  
#7 Posted : Thursday, May 5, 2005 11:33:44 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)
Great work Patrick - we can see in here how to get started. All we need to do is figure out what we want to get started on! wabbit :D
Patrick  
#8 Posted : Tuesday, May 10, 2005 2:14:55 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)
Alright I'm finally done with my Flash training :D And I have studied the dev kit a little so I will work on something in the next few weeks. As silly as it may sound I was working on adding a button in metastock that would take you to the forum :oops: Anyone think it is a good idea besides me :?: Als I have jose suggestions, I don't think I'm ready for stuff like that yet ... Has anyone though of something else ? Patrick :mrgreen:
hayseed  
#9 Posted : Tuesday, May 10, 2005 4:46:01 AM(UTC)
hayseed

Rank: Advanced Member

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

hey patrick.... speaking of buttons, does the metastock community button still work.... it gives me can not connect to server..... you can add a link/button to this forum on your lower custom toolbar... thats what i use.... only takes a couple seconds.... have no idea just how difficult this would be but what are the chances of getting second explorer button or expert advisor independent of the first one........ could that be done with the mdk kit or would the simplest solution be just to buy an eod version of meta.......h =============== MetaStock Custom User Interface Utility Add or delete buttons on the MetaStock custom toolbar Add or delete items on the MetaStock tools and help menus from equis mdk kit page =========================
Patrick  
#10 Posted : Tuesday, May 10, 2005 5:08:18 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)
Quote:
does the metastock community button still work.... it gives me can not connect to server.....
Try the Chat fix I posted a while back ... :D
Quote:
what are the chances of getting second explorer button or expert advisor independent of the first one........
I doubt it would work, I'm sure the explorer process is locked and that you could not start another session. I will check though. Patrick
tura  
#11 Posted : Tuesday, May 10, 2005 9:03:03 PM(UTC)
tura

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 5/10/2005(UTC)
Posts: 1
Location: istanbul

hi, how i can convert a MS formula into a DLL.
Patrick  
#12 Posted : Tuesday, May 10, 2005 9:54:53 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)
Convert? not possible ... But you can, using the developpers kit, write a dll with C++ that would do the same thing as your formula Patrick
Topkat  
#13 Posted : Friday, May 20, 2005 8:35:17 PM(UTC)
Topkat

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/10/2004(UTC)
Posts: 31

How about a Relative Strength Comparative Exploration. A lot of the code could be used from the indicator of the same name. For the Exploration, the user would select the stocks desired for the Exploration to compare Relative Strength against the Nasdaq, NYSE, S&P 500 or whatever other index you can program into the DLL. Or, a separate Exploration for comparison of stocks selected by the user against one index (and make an exploration for all the different indexes).
Topkat  
#14 Posted : Friday, May 20, 2005 9:16:45 PM(UTC)
Topkat

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/10/2004(UTC)
Posts: 31

Ooops... I see you were looking for functions, not explorations. How about a function for Relative Strength Comparative that prompts the user to select the index for comparison (rather than having the user navigate the directory structure to find the index). You could include the biggies in the selection list (Nas, NYSE, S&P 500...) It would be a time saver and part of the code you already have for the Relative Strength Comparative indicator already out there. Then we could move on to an exploration to rank stocks that are showing strength against the overall market (indicies) using Relative Strength Comparative?
Jose  
#15 Posted : Saturday, May 21, 2005 2:34:43 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)
Topkat, the URSC (Universal Relative Strength Comparative) kit for MetaStock may be of interest to you: http://www.metastocktools.com/URSC/URSC.htm jose '-) http://www.metastocktools.com
wabbit  
#16 Posted : Saturday, May 21, 2005 2:49:08 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)
An idea for our first function: How about support and resistance lines? They could be straight, of for followers of the Guppy, parabolic? We would of course have to define time periods, significance, etc, but I think this might make an interesting first attempt for the forum. What say you all? wabbit :D
Patrick  
#17 Posted : Saturday, May 21, 2005 6:07:42 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)
I though MetaStock 9 already had those built-in... What did you have in mind wabbit? I Unfortunately do not have much time lately but we should slowly talk about what we can do that would be useful. Let me know the details so we can discuss them. Patrick :mrgreen:
oradba  
#18 Posted : Friday, May 27, 2005 5:47:25 AM(UTC)
oradba

Rank: Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 13

HI Jose, where I can download loop function? thank you oradba
Patrick  
#19 Posted : Wednesday, June 29, 2005 5:26:05 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)
Hey ... Hello someone in here ? Lots of echo in here, g you should check the acoustic of this room :D It is an abysmal emptiness, can we chit chat in here :lol: Anyways ... I'm taking a week off work next week and I was thinking that I would have time for a dll. Here are the options : 1) Adaptive Moving Average 2) PP+ Latch functions 3) other ? I need to have picked one of these and all the details by this Friday midnight. Whichever I get more input on will be the one I will work on... So please make sure to give lots of detailed info. Patrick :mrgreen:
nobel_1101  
#20 Posted : Monday, July 11, 2005 11:41:44 PM(UTC)
nobel_1101

Rank: Member

Groups: Registered, Registered Users
Joined: 5/17/2005(UTC)
Posts: 24
Location: London

Jose wrote:
A simple loop function would be a definite must-have in MetaStock. Perhaps something basic like this may be enough: ExtFml("Loop",Expression,IterationStore,LoopCount)
I agree a loop function is needed but I think in practice this will be very difficult to produce. The difficulty is (tell me if I'm wrong) that dlls are simply churning out an answer to a set of simplistic arguments that you input into it. And these arguments cannot be a line of VB/C++ code that will be executed in the dll. In other words it is not possible to reprogram or customise the executable code within the loop function of the dll. Therefore the only way to create some complicated loops maybe via the dev kit. However if there are some standard loop expressions needed, for example seaching for previous peaks/troughs which have a particular value in order to establish resistance/support lines, this would be easy to build but it does not have great flexibility, I think that is what I'm getting at. I am frequent user of VB and I have also have working knowledge of C++. I've recently put an application into Equis for the read-only version of the dev kit. Do you think they'll let me have it? I'd like to design better resistance/support and trend lines than those which came with MS, along with other ideas as they occur. Perhaps if/when I get the dev kit I could help implement some of the ideas mentioned in this forum to help everyone and myself make better trades. :)
Users browsing this topic
Guest (Hidden)
Similar Topics
Functions ExtFml ("DeBry.DataIsCurrent", Periods). (Formula Assistance)
by Cobra 1/13/2015 4:33:27 PM(UTC)
External Functions DLLs (MetaStock)
by Tony S. 1/14/2013 2:40:52 PM(UTC)
HIGHEST AND LOWEST METASTOCK FUNCTIONS (MetaStock)
by ABDULLAH7044 4/7/2012 1:48:41 AM(UTC)
The Main Problem: Simulation functions prevent System Tester entering positions (Formula Assistance)
by analias 8/4/2009 1:54:00 PM(UTC)
Passing Parameters to Functions and Character Limit? (Formula Assistance)
by WindsurfStew 6/15/2008 4:52:05 PM(UTC)
Number of functions in a MSX DLL? (MetaStock Developer's Kit (MDK) Assistance)
by Pole 2/24/2008 10:35:13 AM(UTC)
using candlestick functions in formulas - varying periodicity (Formula Assistance)
by tallie 1/23/2008 4:58:55 AM(UTC)
Cross and divergence functions not working in explorer (MetaStock)
by romaioi 9/18/2007 11:25:14 PM(UTC)
How do I Call Metastock Functions From A Powerbasic DLL? (MetaStock Developer's Kit (MDK) Assistance)
by harryyeh 7/4/2007 11:15:49 PM(UTC)
Using MetaStock build in functions in MDK? (MetaStock Developer's Kit (MDK) Assistance)
by rexyhlee 12/2/2006 10:16:26 AM(UTC)
Automation functions in Developers' kit for Metastock? (MetaStock Developer's Kit (MDK) Assistance)
by OKAZ 10/26/2006 1:41:04 PM(UTC)
Miscellaneous: Adding functions to the custom toolbar (MetaStock FAQ)
by StorkBite 7/31/2006 11:32:28 PM(UTC)
system with IF or AND functions (Formula Assistance)
by wizworst 5/27/2006 3:06:34 PM(UTC)
NEW FUNCTION - Fix the formula functions IsDefined() (Product Wish List)
by wabbit 4/18/2006 1:41:05 AM(UTC)
PWR and POWER Functions in MS Formula Language (Formula Assistance)
by cenergy 4/13/2006 1:20:41 AM(UTC)
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.