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

JulianToDate of the SwingLow



PureBytes Links

Trading Reference Links

I need to get this indicator to accept the JulianToDate of the SwingLow
( in {} below) as a number like the number I have to manually enter
(981008). What am I missing here??

I need to get this indicator to accept the JulianToDate of the SwingLow
as a number or change something that will and I must be missing some
concept here. it works fine with an actual number for the date (981008).
The three functions are also here (DFrmLstB isn't really used at this
time except for a check point).

*** Indicator - TextWriter%Change ***

IF DATE =DFrmLstB(0) { AND TIME =lastcalctime} THEN BEGIN

 VALUE1 =
TEXT_NEW(DATE,TIME,Close,NumToStr(PcntChangeFrmPic2Pic(981008,0,DFrmLstB(0),Close),2)+"%
Since10-08-98");
{   VALUE1 =
TEXT_NEW(DATE,TIME,Close,NumToStr(PcntChangeFrmPic2Pic(JulianToDate(SwingLow(1,5,5,100)),0,DFrmLstB(0),Close),2)+"%
Since10-08-98");}
   TEXT_SETCOLOR(VALUE1,1);
   TEXT_SETSTYLE(VALUE1,1,2);
   TEXT_SETLOCATION(VALUE1,980901,0,LowestUniversal(5,low,980901,0));
END;
plot1(c,"");

*** Function - PickBarValue ***

Input: StrtDate(Numeric),StrtTime(Numeric),Price(NumericSeries);
IF Date = StrtDate AND ((Time = StrtTime) OR (StrtTime = 0 AND Date >
Date[1])) Then PickBarValue = Price

*** Function - PcntChangeFrmPic2Pic ***
Input:
StrtDate(Numeric),StrtTime(Numeric),EndDate(Numeric),Price(NumericSeries);

IF ((Date = StrtDate AND (Time = StrtTime or StrtTime = 0)) OR (Date >
StrtDate)) AND (Date <= EndDate) Then PcntChangeFrmPic2Pic =
(Price/(PICKBARVALUE(STRTDATE, STRTTIME,PRICE))-1)*100

{IF ((Date = StrtDate AND (Time = StrtTime or StrtTime = 0)) OR (Date >
StrtDate)) AND (Date <= EndDate) Then PcntChangeFrmPic2Pic =  100 -
((PICKBARVALUE(STRTDATE, STRTTIME,PRICE) * 100) / PRICE)}

*** Function - DFrmLstB ***

INPUT : BarsBack(NUMERICSIMPLE);
VAR   : x(0);

IF CurrentBar > 1 THEN BEGIN
 Value1 = DateToJulian(LastCalcDate);
 FOR x = 0 TO BarsBack BEGIN
 Value2 = JulianToDate(Value1);
 Value3 = DayOfWeek(Value2);
 IF Value3 = 0 OR Value3 = 6 THEN x = x - 1;
  Value1 = Value1 - 1;
 END;
 DFrmLstB = Value2;
END;

{Instead of entering an offset date for the StrtDate input simply type
in the function name with the offset; like so...
  INPUTS : StrtDate(DFrmLstB(14)),etc.,,,;}
--
*****************************************
*                                       *
*            Glenn M. Orlosky           *
*                                       *
*     E.quity T.echnical A.dvisors      *
*                                       *
*        {Balancing Your Assets}        *
*             {Worldwide}               *
*                                       *
*****************************************