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

[Metastockusers] Re: Calculations between two specific dates. How ???



PureBytes Links

Trading Reference Links

Dusant,

As a slight extension of this thread, I was wondering if you know of 
a way to automatically draw a horizontal line in Metastock.  
Basically, I would input a start date and end date, and then have the 
indicator draw 2 horizontal lines using the highest/lowest prices 
between these 2 dates, respectively.

Thanks,
-Alex

--- In Metastockusers@xxxxxxxxxxxxxxx, "Dusant" <cooldush@xxxx> wrote:
> John,
> 
> {First Date}
> D1:=Input("1 Date",010100,123199,010101);
> {Second Date}
> D2:=Input("2 Date",010100,123199,010101);
> {Reducing Dates to day of year}
> Dt1:= If(Month()=(Int(D1/10000)) AND DayOfMonth()=(Int(D1/100)
> -((Int(D1/10000))*100)) AND Year()=(If(Mod(D1,100)>30,1900+Mod
(D1,100)
> ,2000+Mod(D1,100))),1,0);
> Dt2:= If(Month()=(Int(D2/10000)) AND DayOfMonth()=(Int(D2/100)
> -((Int(D2/10000))*100)) AND Year()=(If(Mod(D2,100)>30,1900+Mod
(D2,100)
> ,2000+Mod(D2,100))),1,0);
> {Assigning values}
> Hi1:= ValueWhen(1,Dt1=1,H);
> Lo1:= ValueWhen(1,Dt1=1,L);
> Hi2:= ValueWhen(1,Dt2=1,H);
> Lo2:= ValueWhen(1,Dt2=1,L);
> {Plotting Values}
> Hi1; Lo1; Hi2; Lo2;
> 
> I have ver 6.52 and it is not capable of realtime. Therefore, I 
cannot 
> help you on that score. However, the logic will be the same. There 
are 
> several posts earlier to pinpoint a particular time, so do a little 
> homework.
> 
> Dusant
> 
> --- In Metastockusers@xxxxxxxxxxxxxxx, "johnm_milton" 
<johnm_milton@xx
> ..> wrote:
> > 
> > Dear Dusant,
> > 
> > I thank you very much for your prompt help, but there is 
something I 
> > don't understand.
> > What you sent me seems an indicator formula or a new function 
that 
> > could return me the value (close, high, low) I need. Is it 
exact ? 
> > What is <your value>  , probably Close or High or low ? 
> > I tried to build it but it seems without results.
> > 
> > What I need is to build an Explorer where to list the value of 
two 
> > dates (or moments for intraday charts) and the differences 
between 
> > them.
> > Please forgive my limits and help me again.
> > Sincerely 
> > 
> > John
> > 
> > --- In Metastockusers@xxxxxxxxxxxxxxx, "Dusant" <cooldush@xxxx> 
> wrote:
> > > John,
> > > To pinpoint two dates:
> > > day1:= Input("Enter First Date - mmddyy",010100,123199,010101);
> > > m1:= Int(day1/10000);
> > > d1:= Int(day1/100) - (m1*100) ;
> > > y1:= If(Mod(day1,100)>30, 1900+Mod(day1,100), 2000+Mod
(day1,100));
> > > 
> > > day2:= Input("Enter Second Date - mmddyy",010100,123199,010101);
> > > m2:= Int(day2/10000);
> > > d2:= Int(day2/100) - (m2*100) ;
> > > y2:= If(Mod(day2,100)>30, 1900+Mod(day2,100), 2000+Mod
(day2,100));
> > > 
> > > val1:= ValueWhen( 1, Month() = m1 AND DayOfMonth() = d1 AND Year
() 
> > = 
> > > y1, <your value> );
> > > val2:= ValueWhen( 1, Month() = m2 AND DayOfMonth() = d2 AND Year
() 
> > = 
> > > y2, <your value> );
> > > 
> > > Dusant
> > > 
> > > --- In Metastockusers@xxxxxxxxxxxxxxx, "johnm_milton" 
> > <johnm_milton@xx
> > > ..> wrote:
> > > > Dear friends,
> > > > I have a question. (hoping my english is good enough)
> > > > I want to develop a simple  explorer wich will indicate the 
> > percent  
> > > > variations between two specific dates (or dates + minutes for 
> > > > intraday data) for a list of equities.
> > > > Now using the valuewhen function the difficulty is that I 
have 
> to 
> > > > calculate the number of days (or group of minutes for 
intraday 
> > data)
> > > > from the last value. Another difficulty is that not all the 
> > equities 
> > > > are updated at the same time so the last value is not the 
same 
> > for 
> > > > all the equities in the list.
> > > > I wonder if there is a function which allows this; I mean 
simply 
> > > > indicating dd+mm+yy+minute for starting and end of 
calculation.
> > > > 
> > > > I thank you in advance for your help.
> > > > John


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

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