Input: TextOffset(.25),
UpLVol(1000),
DnLVol(1000);
vars: X(0), PivotL(0), PivotH(0), HHigh(0), LLow(0), Top(0), Bottom(0),
PHBarNumber(0), FirstLHBarNumber (0), PLBarNumber(0), DrawCreek(0), DrawIce(0), HHPBarNumber(0),HLPBarNUmber(0), TXT_UT(""),
JOC(0), JOCValue(0), FTI(0), FTIValue(0), Spring(0), UpThrust(0), SpringPrice(0), UpThrustPrice(0);
//UpTrends and Tops
If C<C[1] and Upticks[1] > 0 Then Begin //Is a Pivot High
If C[1] > PivotH Then // Higher High Pivot
HHigh = 1;
DrawIce = 0;
DrawCreek = 0;
HHPBarNumber = BarNumber;
If C[1] = PivotH and HHigh[1] = 1 Then //This is Double Top in an Uptrend Draw Ice at prior pivot high's low
HHigh = 1;
DrawIce = 0;
HHPBarNumber = BarNumber[3];
If C[1] = PivotH and HHigh[1] = 0 Then //This is Double Top in a DownTrend
HHigh = 0;
DrawIce = 0;
HHPBarNumber = BarNumber[3];
If C[1] < PivotH And HHigh[1] = 1 Then Begin //Top - Is Lower than previous pivot high & Last Pivot High was higher than previous pivot high/First LL
HHigh = 0;
Top = PivotH[1]; // This is uptrend top
PHBarNumber = PHBarNumber[1];
DrawIce = 1;
FTI = 1;
FTIValue = PivotL;
//Text For First LH
Value1 = Text_New(Date[1], Time[1], High[1] + Range * Textoffset , "1stLH");
Text_SetColor(Value1, Black);
Text_setstyle(Value1, 2, 1);
//Text For On The Spring Board Dn
If Upthrust = 1 Then Begin
Value2 = Text_New(Date[1], Time[1], High[1] + Range * Textoffset , "On SpringBoard");
Text_SetColor(Value2, Black);
Text_setstyle(Value2, 2, 0);
UPthrust = 0;
End;
End;
PivotH = Close[1]; //Set Last Pivot High Price
PHBarNumber = BarNumber[1];
End;
//Draw Trendlne for pivot Highs
If PivotH <> PivotH[1] Then Begin
Value3 = TL_New(Date[1], Time[1], PivotH, Date, Time, PivotH);
Tl_setcolor(Value3, Blue);
Tl_Setstyle(Value3, Tool_Dotted);
//Tl_setsize(Value3, 1);
End
Else Begin
If PivotH = PivotH[1] Then
Value4 = TL_SetEnd(Value3, Date, Time, PivotH);
End;
//Draw Trendline For Tops
If top <> Top[1] Then Begin
Value5 = TL_New(Date[1], Time[1], Top, Date, Time, Top);
Value6 = Tl_setbegin(Value5, Date[BarNumber[1] - PHBarNumber[1] +1], Time[BarNumber[1] - PHBarNumber[1] +1], Top);
Tl_setcolor(Value5, DarkGreen);
Tl_setsize(Value5, 1);
End
Else Begin If Top = Top Then
Value7 = TL_SetEnd(Value5, Date, Time, Top);
End;
|