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

Re: [Metastockusers] Indicator formula



PureBytes Links

Trading Reference Links

Murusprimus

Here's a rough translation - it's not perfect but it may get you started.
I've eliminated month and year as there appears to be a problem with the
original date construction. I suspect that multiplying Month() by 1000000 is
introducing a data error (MS uses single digit precision), and the result is
that one or both of the two indicator signals may fail to display.

Roy

A:=Input("First date - dd" ,1,31,31);
F:=Input("Time of day - hhmm",0800,1859,1015);
B:=Input("Second date - dd",1,31,31);
G:=Input("Time of day - hhmm",0800,1859,1130);
BSA:=BarsSince(A=DayOfMonth() AND F=Hour()*100+Minute());
BSB:=BarsSince(B=DayOfMonth() AND G=Hour()*100+Minute());
ADeg:=BSA*1.3846153;BDeg:=BSB*1.3846153;
Cyc1:=If(Int(ADeg)=30,1,If(Int(ADeg)=60,1,If(Int(ADeg)=90,
1,If(Int(ADeg)=120,1,If(Int(ADeg)=150,1,If(Int(ADeg)=180,
1,If(Int(ADeg)
=210,1,If(Int(ADeg)=240,1,If(Int(ADeg)=270,1,If(Int( (ADeg)=300),
1,If(Int(ADeg)=330,1,If(Int(ADeg)=360,1,0))))))))))));
Cyc2:=If(Int(BDeg)=30,1,If(Int(BDeg)=60,1,If(Int(BDeg)=90,
1,If(Int(BDeg)=120,1,If(Int(BDeg)=150,1,If(Int(BDeg)=180,
1,If(Int(BDeg)
=210,1,If(Int(BDeg)=240,1,If(Int(BDeg)=270,1,If(Int( (BDeg)=300),
1,If(Int(BDeg)=330,1,If(Int(BDeg)=360,1,0))))))))))));
Cyc1; Cyc2;


----- Original Message -----
From: "murusprimus" <sace@xxxxxxx>
To: <Metastockusers@xxxxxxxxxxxxxxx>
Sent: Tuesday, April 15, 2003 10:39 PM
Subject: [Metastockusers] Indicator formula


> Hi. I can't make any sense of the MetaStock formula language,
> probably because I've never been able to understand math, which
> brings me to ask if someone would help me by providing the coding I
> want for the following 'Henry Indicator'.
>
> The Indicators I've seen seem only to be written for Daily and above
> timeframes, and while some of them work on Intraday charts, the one
> below doesn't, and it's an Indicator I'd very much like to use on my
> Intraday charts.
>
> I want to be able to use the Indicator on any Intraday timeframe by
> having an 'Input' for the 'Hour and Minute' bar the Indicator should
> start from, as well as the mmddyyyy Inputs.
>
> Can Hour/s and Minute/s Input be coded into the formula ? if so and
> you know how, would you please reply with the new code.
>
> Many thanks. Murusprimus.
>
> Gann 30 degree cycles from 2 dates.
>
> A1:=Input("date A mmddyyyy",1011960,12312100,1072000);
> B1:=Input("date B mmddyyyy",1011960,12312100,1082000);
> BSA:=BarsSince(A1=Month()*1000000 + DayOfMonth()*10000+ Year());
> BSB:=BarsSince(B1=Month()*1000000 + DayOfMonth()*10000+ Year());
> ADeg:=BSA*1.3846153;BDeg:=BSB*1.3846153;
> Cyc1:=If(Int(ADeg)=30,1,If(Int(ADeg)=60,1,If(Int(ADeg)=90,1,If(Int
> (ADeg)=120,1,If(Int(ADeg)=150,1,If(Int(ADeg)=180,1,If(Int(ADeg)
> =210,1,If(Int(ADeg)=240,1,If(Int(ADeg)=270,1,If(Int( (ADeg)=300),1,If
> (Int(ADeg)=330,1,If(Int(ADeg)=360,1,0))))))))))));
> Cyc2:=If(Int(BDeg)=30,1,If(Int(BDeg)=60,1,If(Int(BDeg)=90,1,If(Int
> (BDeg)=120,1,If(Int(BDeg)=150,1,If(Int(BDeg)=180,1,If(Int(BDeg)
> =210,1,If(Int(BDeg)=240,1,If(Int(BDeg)=270,1,If(Int( (BDeg)=300),1,If
> (Int(BDeg)=330,1,If(Int(BDeg)=360,1,0))))))))))));
> Cyc1;Cyc2;
>
>
>
> 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/
>
>
>
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
DVD Rentals with No Late Fees - Try Netflix for FREE!
http://us.click.yahoo.com/ZKLNcC/pEZFAA/i5gGAA/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/