[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Re: Help re MDK / MSX Dates, continued



PureBytes Links

Trading Reference Links

Dear JimmyDaHands  :-)

YES, you got it !!!!!
Thank you, thank you, you have no idea (or maybe you do ??) just how long I struggled with (almost) 
every imaginable permutation of those #@$%$#%%% little symbols to try to get them in the right place and the 
right order. That's the problem for me of not being a "real" programmer .... trial and error is definitely NOT
a good way to get stuff like this going, but anyway that's got it now :-))


@a_psResultRec. @psResultArray. @pfValue[ i]=CLNG(@ a_psDataRec. @psDate[i] .lDate)   

Great, you have given me the correct syntax for accessing the MSX date data, and now the rest is easy sailing  !!!
.... back to writing the interesting parts of the DLL's  :-)

Your turn to ask me a favor some time.
Thanks again,
Tony M

============================

----- Original Message ----
From: jimmydahands <bellamy_29m@xxxxxxxxx>
To: equismetastock@xxxxxxxxxxxxxxx
Sent: Thursday, June 14, 2007 4:54:03 AM
Subject: [EquisMetaStock Group] Re: Help re MDK / MSX Dates, continued









  


    
            Tony,



I mentioned before I am not a PB user, but I THINK this might help to

solve your problem?



DIM lDate (l_iStartIndex TO l_iMaxIndex) AS LONG

FOR i = l_iStartIndex TO l_iMaxIndex

 

@a_psResultRec. @psResultArray. @pfValue[ i]=CSNG(@a_psDataRec. @sHigh.pfValue[i])

 

@a_psResultRec. @psResultArray. @pfValue[ i]=CLNG(@ a_psDataRec. @psDate[i] .lDate)

NEXT i



The @a_psResultRec. @psResultArray. @pfValue[ i] can only have one value,

so I am assuming you are just testing the for the moment and will

select which value to populate the return array with later?



Also note the @a_psResultRec. @psResultArray. @pfValue[ i] is a float

data-type so you might have to cast the values (I am not sure what

your CSNG and CLNG do, but I assume they are casting as single and

long?  Does PB have a cast CFLT?)



--- In equismetastock@ yahoogroups. com, Tony M <t4tonym@xxx > wrote:

>

> Jimmy & others,

> 

> Well, I'm still not quite there  yet, but thanks for helping me to

move a bit further forwards.

> I understood what you meant (more or less), but not really what the

specifics of what "dealt with accordingly" entails.

> After some trial & error (mostly error) experimentation, I have

revised the code  (revised version now posted below),

> so that it doesn't crash out now, nor return all zero's any more (as

it did yesterday), but the results are still not quite right.

> Basically I don't really understand what I need to do with regard to

defining the pointer and the lDate variable correctly.

> My apologies for the "boring beginner" questions, but please if, you

could take another look at my updated version and give me any more

clues as to what is still wrong, I would be most grateful.

> 

> Best regards,

> Tony

> 

> ============ ========

> 

> ----- Original Message ----

> From: jimmydahands <bellamy_29m@ ...>

> To: equismetastock@ yahoogroups. com

> Sent: Wednesday, June 13, 2007 4:29:00 PM

> Subject: [EquisMetaStock Group] Re: Date data with MDK / MSX using

PowerBasic

> 

> 

> 

> 

> 

> 

> 

> 

> 

>   

> 

> 

>     

>             Tony,

> 

> 

> 

> I don't use PowerBasic, but the way I see your code working is that

> 

> you are trying to deal with the long date data as a MSXDataInfoRec

> 

> structure inside the MSXDataRec; when  the date is MSXDateTime

structure.

> 

> 

> 

> The psDate is a pointer to an array of MSXDateTime structres so must

> 

> be dealt with accordingly.

> 

> 

> 

> --- In equismetastock@ yahoogroups. com, Tony M <t4tonym@ > wrote:

> 

> >

> 

> > Hi,

> 

> > 

> 

> > Anyone writing their own Metastock External Functions (MSX) with the

> 

> MDK who either: 

> 

> > a) writes in (Power) BASIC rather than C++, and/or

> 

> > b) has enough experience with MSX DLL's to  be able to help me , 

> 

> > could you please advise me regarding getting the Date array as a

> 

> function output from the MSX data structure.

> 

> > 

> 

> > Below is an example of part of the code that I wrote to access

> 

> "DOHLCV" data.

> 

> > It works fine for the "OHLCV" part  (the example shows "H"), but it

> 

> doesn't work for the "D" part. 

> 

> > I assume that I am simply missing some required step, due to that

> 

> fact that the "OHLCV" parts are floating point variables, 

> 

> > but "D" is data type "long". However the MDK manual does not make it

> 

> clear exactly what the required syntax is.

> 

> > 

> 

> > I think that the MSX part of the MDK is great, but the manual is not

> 

> quite adequate.

> 

> > Please help, anyone .....

> 

> > 

> 

> > 

> 

> > Regards,

> 

> > Tony M

> 

> > 

> 

> > Metastock MSX example follows:

> 

> > 

> 

> > ============ ========= ========= ========= ========= =========

========= =

>  

>  FUNCTION MyDate SDECL ALIAS "MyDate" _

> (BYVAL a_psDataRec AS MSXDataRec PTR, _

>  BYVAL a_psDataInfoArgs AS MSXDataInfoRecArgsA rray PTR, _

>  BYVAL a_psNumericArgs AS MSXNumericArgsArray PTR, _

>  BYVAL a_psStringArgs AS MSXStringArgsArray PTR, _

>  BYVAL a_psCustomArgs AS MSXCustomArgsArray PTR, _

>  BYVAL a_psResultRec AS MSXResultRec PTR) _

>  EXPORT AS LONG

>  

>  LOCAL l_bRtrn AS LONG

>  l_bRtrn = %MSX_SUCCESS

>  

>  LOCAL l_psData AS MSXDataInfoRec PTR

>  LOCAL l_iStartIndex AS LONG

>  LOCAL l_iMaxIndex AS LONG

>  DIM i AS INTEGER

>  l_psData = @a_psDataInfoArgs. psDataInfoRecs( 0)      'Input data array

>  

> l_iStartIndex = @l_psData.iFirstVal id

>  

> l_iMaxIndex = @l_psData.iLastVali d

>  

> @a_psResultRec. @... = @l_psData.iFirstVal id

>  

> @a_psResultRec. @... = @l_psData.iLastVali d

>    ' *** So far, down to here is all standard stuff for MSX functions 

> 

> ************ *****

> 

>  

> LOCAL l_psHigh AS MSXDataInfoRec PTR

> '***  For the "H" part of "DOHLC" data array  ***

>  l_psHigh = VARPTR(@a_psDataRec .sHigh)

>  

> 

>  LOCAL lDate AS MSXDateTime PTR

> '***  For the "D" part of "DOHLC" data array ***

>  lDate = VARPTR(@a_psDataRec .psDate)

> DIM lDate (l_iStartIndex TO l_iMaxIndex) AS LONG

>        

>  

> FOR i = l_iStartIndex TO l_iMaxIndex

>  

> @a_psResultRec. @psResultArray. @pfValue[ i] =

> 

> CSNG(@l_psHigh. @pfValue[ i])    '*** "H":  THIS WORKS OK***

>  

> @a_psResultRec. @psResultArray. @pfValue[ i] =

> 

> CLNG(@lDate( i))     '*** "D": THIS DOESN'T ***

>  

> NEXT i

> 

>  

>  

> MyDate = l_bRtrn

>  

> END FUNCTION                                                       

> 

>       

>   

> 

> >  

> 

> > 

> 

> > 

> 

> > 

> 

> >  

> 

> >

> 

> ____________ _________ _________ _________ _________ _________ _

> 

> > The fish are biting. 

> 

> > Get more visitors on your site using Yahoo! Search Marketing.

> 

> > http://searchmarket ing.yahoo. com/arp/sponsore dsearch_v2. php

> 

> > 

> 

> > [Non-text portions of this message have been removed]

> 

> >

> 

> 

> 

> 

> 

>     

>   

> 

>     

>     

> 

> 

> 

> 

> <!--

> 

> #ygrp-mlmsg {font-size:13px; font-family: arial, helvetica, clean,

sans-serif;}

> #ygrp-mlmsg table {font-size:inherit; font:100% ;}

> #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica,

clean, sans-serif;}

> #ygrp-mlmsg pre, code {font:115% monospace;}

> #ygrp-mlmsg * {line-height: 1.22em;}

> #ygrp-text{

> font-family: Georgia;

> }

> #ygrp-text p{

> margin:0 0 1em 0;}

> #ygrp-tpmsgs{

> font-family: Arial;

> clear:both;}

> #ygrp-vitnav{

> padding-top: 10px;font- family:Verdana; font-size: 77%;margin: 0;}

> #ygrp-vitnav a{

> padding:0 1px;}

> #ygrp-actbar{

> clear:both;margin: 25px

0;white-space: nowrap;color: #666;text- align:right; }

> #ygrp-actbar .left{

> float:left;white- space:nowrap; }

> .bld{font-weight: bold;}

> #ygrp-grft{

> font-family: Verdana;font- size:77%; padding:15px 0;}

> #ygrp-ft{

> font-family: verdana;font- size:77%; border-top: 1px solid #666;

> padding:5px 0;

> }

> #ygrp-mlmsg #logo{

> padding-bottom: 10px;}

> 

> #ygrp-vital{

> background-color: #e0ecee;margin- bottom:20px; padding:2px 0 8px 8px;}

> #ygrp-vital #vithd{

>

font-size:77% ;font-family: Verdana;font- weight:bold; color:#333; text-transform: uppercase; }

> #ygrp-vital ul{

> padding:0;margin: 2px 0;}

> #ygrp-vital ul li{

> list-style-type: none;clear: both;border: 1px solid #e0ecee;

> }

> #ygrp-vital ul li .ct{

>

font-weight: bold;color: #ff7900;float: right;width: 2em;text- align:right; padding-right: .5em;}

> #ygrp-vital ul li .cat{

> font-weight: bold;}

> #ygrp-vital a {

> text-decoration: none;}

> 

> #ygrp-vital a:hover{

> text-decoration: underline; }

> 

> #ygrp-sponsor #hd{

> color:#999;font- size:77%; }

> #ygrp-sponsor #ov{

> padding:6px 13px;background- color:#e0ecee; margin-bottom: 20px;}

> #ygrp-sponsor #ov ul{

> padding:0 0 0 8px;margin:0; }

> #ygrp-sponsor #ov li{

> list-style-type: square;padding: 6px 0;font-size: 77%;}

> #ygrp-sponsor #ov li a{

> text-decoration: none;font- size:130% ;}

> #ygrp-sponsor #nc {

> background-color: #eee;margin- bottom:20px; padding:0 8px;}

> #ygrp-sponsor .ad{

> padding:8px 0;}

> #ygrp-sponsor .ad #hd1{

>

font-family: Arial;font- weight:bold; color:#628c2a; font-size: 100%;line- height:122% ;}

> #ygrp-sponsor .ad a{

> text-decoration: none;}

> #ygrp-sponsor .ad a:hover{

> text-decoration: underline; }

> #ygrp-sponsor .ad p{

> margin:0;}

> o {font-size:0; }

> .MsoNormal {

> margin:0 0 0 0;}

> #ygrp-text tt{

> font-size:120% ;}

> blockquote{margin: 0 0 0 4px;}

> .replbq {margin:4;}

> -->

> 

> 

> 

> 

> 

> 

> 

> 

>        

>

____________ _________ _________ _________ _________ _________ _

> Be a better Heartthrob. Get better relationship answers from someone

who knows. Yahoo! Answers - Check it out. 

> http://answers. yahoo.com/ dir/?link= list&sid= 396545433

> 

> [Non-text portions of this message have been removed]

>





    
  

    
    




<!--

#ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;}
#ygrp-mlmsg table {font-size:inherit;font:100%;}
#ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;}
#ygrp-mlmsg pre, code {font:115% monospace;}
#ygrp-mlmsg * {line-height:1.22em;}
#ygrp-text{
font-family:Georgia;
}
#ygrp-text p{
margin:0 0 1em 0;}
#ygrp-tpmsgs{
font-family:Arial;
clear:both;}
#ygrp-vitnav{
padding-top:10px;font-family:Verdana;font-size:77%;margin:0;}
#ygrp-vitnav a{
padding:0 1px;}
#ygrp-actbar{
clear:both;margin:25px 0;white-space:nowrap;color:#666;text-align:right;}
#ygrp-actbar .left{
float:left;white-space:nowrap;}
.bld{font-weight:bold;}
#ygrp-grft{
font-family:Verdana;font-size:77%;padding:15px 0;}
#ygrp-ft{
font-family:verdana;font-size:77%;border-top:1px solid #666;
padding:5px 0;
}
#ygrp-mlmsg #logo{
padding-bottom:10px;}

#ygrp-vital{
background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;}
#ygrp-vital #vithd{
font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-transform:uppercase;}
#ygrp-vital ul{
padding:0;margin:2px 0;}
#ygrp-vital ul li{
list-style-type:none;clear:both;border:1px solid #e0ecee;
}
#ygrp-vital ul li .ct{
font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;padding-right:.5em;}
#ygrp-vital ul li .cat{
font-weight:bold;}
#ygrp-vital a {
text-decoration:none;}

#ygrp-vital a:hover{
text-decoration:underline;}

#ygrp-sponsor #hd{
color:#999;font-size:77%;}
#ygrp-sponsor #ov{
padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;}
#ygrp-sponsor #ov ul{
padding:0 0 0 8px;margin:0;}
#ygrp-sponsor #ov li{
list-style-type:square;padding:6px 0;font-size:77%;}
#ygrp-sponsor #ov li a{
text-decoration:none;font-size:130%;}
#ygrp-sponsor #nc {
background-color:#eee;margin-bottom:20px;padding:0 8px;}
#ygrp-sponsor .ad{
padding:8px 0;}
#ygrp-sponsor .ad #hd1{
font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-height:122%;}
#ygrp-sponsor .ad a{
text-decoration:none;}
#ygrp-sponsor .ad a:hover{
text-decoration:underline;}
#ygrp-sponsor .ad p{
margin:0;}
o {font-size:0;}
.MsoNormal {
margin:0 0 0 0;}
#ygrp-text tt{
font-size:120%;}
blockquote{margin:0 0 0 4px;}
.replbq {margin:4;}
-->








       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/