Hi Bruce,
Ok, I added the line to the first line of code in the Condition. I didn't see a change.
Here is my indicator code
' William 2Min V1.04 updated 4-3-13
Dim OffsetPct As Single
Dim Offset As Single
Dim Barsearched As Single
Dim offset1 As Single
Dim trigger As Single
Dim B4EarlyWarn As Single
Dim Length As Single
Dim volumeLength As Single
Dim VolumeAvediff As Single
Dim VolumeNowAve As Single
Dim VolumeShortAve As Single
Dim VolumeLongAve As Single
Dim diff As Single
Dim totaldiff As Single
Dim diffneg As Single
Dim diffneg1 As Single
Dim diffpercent As Single
Dim diffpercentneg As Single
Dim diffpercentneg1 As Single
Dim VolumeMult As Single
Dim volumeadjust As Single
Dim volumeDiffadjust As Single
Dim varVolumeMin As Single
Dim diffbar1 As Single
Dim MaxHigh15_6 As Single
Dim MaxHigh20_6 As Single
Dim MaxHigh20_10 As Single
Dim MaxHigh20_15 As Single
Dim MaxHigh20_16 As Single
Dim MaxHigh20_17 As Single
Dim MaxHigh20_18 As Single
Dim MaxHigh20_20 As Single
Dim MaxHigh20_21 As Single
Dim MA300_200 As Single
Static Open As New List(Of Single)
Static Close As New List(Of Single)
OffsetPct = 1.0252
Offset = 23
Barsearched = 0
Offset1 = 12
Trigger = .32
B4EarlyWarn = 1
Length = 300
VolumeLength = 1500
VolumeAvediff = 0
volumeadjust = 0
diffbar1 = 0
volumeMult = .1
varVolumeMin = 5000
MaxHigh20_6 = price.maxhigh(20, offset - 6)
' adjust for MA500_200 higher than diff
MA300_200 = Price.AVGH(300, 200)
' If price.high > MaxHigh20_6 Then
MaxHigh15_6 = price.maxhigh(15, offset + 6)
MaxHigh20_10 = price.maxhigh(20, offset - 10)
MaxHigh20_15 = price.maxhigh(20, offset - 15)
MaxHigh20_16 = price.maxhigh(20, offset - 16)
MaxHigh20_17 = price.maxhigh(20, offset - 17)
MaxHigh20_18 = price.maxhigh(20, offset - 18)
MaxHigh20_20 = price.maxhigh(20, offset - 20)
MaxHigh20_21 = price.maxhigh(20, offset - 21)
VolumeNowAve = volume.AVG(3, 1)
VolumeShortAve = volume.AVG(20, 2)
VolumeLongAve = volume.AVG(100, 1)
Static OpeningOpen As Single
Static YesterdayClose As Single
Static YesterdayHigh As Single
If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
OpeningOpen = Price.Open
YesterdayClose = Price.Close(1)
YesterdayHigh = Price.high(1)
End If
diffpercent = OpeningOpen * 1.01
diff = OpeningOpen + Trigger
If diff < price.maxhigh(Length, offset) * OffsetPct Then
diff = price.maxhigh(Length, offset) * OffsetPct
End If
If diff < price.maxhigh(Length, offset) + trigger Then
diff = price.maxhigh(Length, offset) + trigger
End If
If Single.IsNaN(OpeningOpen) Then
SetIndexInvalid
End If
If diff < diffpercent Then
diff = diffpercent
End If
If diff < YesterdayClose * 1.01 Then
diff = YesterdayClose * 1.01
End If
If diff < MaxHigh20_6 Then
diff = MaxHigh20_6
End If
If diff < MaxHigh20_6 Then
diff = MaxHigh20_6
End If
If diff < price.AVGH(15, offset + 80) + .1
diff = price.AVGH(15, offset + 80) + .1
End If
If diff < price.AVGH(15, offset + 80) * 1.01 Then
diff = price.AVGH(15, offset + 80) * 1.01
End If
If diff < MaxHigh20_6 + .19 Then
diff = MaxHigh20_6 + .19
End If
If diff < MaxHigh20_6 * 1.0123 Then
diff = MaxHigh20_6 * 1.0123
End If
If diff < MaxHigh20_10 + .13 Then
diff = MaxHigh20_10 + .13
End If
If diff < MaxHigh20_10 * 1.0123 Then
diff = MaxHigh20_10 * 1.0123
End If
If diff < MaxHigh20_15 * 1.001 Then
diff = MaxHigh20_15 * 1.001
End If
If diff < MaxHigh20_16 + .08 Then
diff = MaxHigh20_16 + .08
End If
If diff < MaxHigh20_16 * 1.0058 Then
diff = MaxHigh20_16 * 1.0058
End If
If diff < MaxHigh20_17 + .06 Then
diff = MaxHigh20_17 + .06
End If
If diff < MaxHigh20_17 * 1.005 Then
diff = MaxHigh20_17 * 1.005
End If
If diff < MaxHigh20_18 + .05 Then
diff = MaxHigh20_18 + .05
End If
If diff < MaxHigh20_18 * 1.0001 Then
diff = MaxHigh20_18 * 1.0001
End If
If diff < MaxHigh20_20 + .01 Then
diff = MaxHigh20_20 + .01
End If
If diff < MaxHigh20_20 * 1.0007 Then
diff = MaxHigh20_20 * 1.0007
End If
If diff < MaxHigh20_21 + .01 Then
diff = MaxHigh20_21 + .01
End If
If diff < MaxHigh20_21 * 1.0001 Then
diff = MaxHigh20_21 * 1.0001
End If
If diff < price.High(5) * 1.001 Then
diff = price.High(5) * 1.001
End If
If diff < MaxHigh15_6 + .1 Then
If price.High(offset - 15) < MaxHigh15_6 + .1 Then
diff = MaxHigh15_6 + .1
End If
End If
If diff < MaxHigh15_6 * 1.0014 Then
If price.High(offset - 15) < MaxHigh15_6 * 1.0014 Then
diff = MaxHigh15_6 * 1.0012
End If
End If
' If diff < price.low * 1.0028 Then
' diff = price.low * 1.0028
' End If
' adjust for MA500_200 higher than diffEntry
If diff < MA300_200 Then
diff = diff + (.055 * (MA300_200 - diff))
End If
If VolumeLongAve < varVolumeMin Then
volumeadjust = (1 - VolumeLongAve / varVolumeMin) * volumeMult
diff = (diff * 1.0005) + .02 + (volumeadjust * 1.0)
End If
If VolumeNowAve > volume.AVG(50, 10) * 2.15 Then
volumeDiffadjust = VolumeNowAve / ((volume.AVG(50, 10)) * 2.15)
volumeDiffadjust = System.Math.Sqrt(volumeDiffadjust)
volumeDiffadjust = volumeDiffadjust * .001
diff = diff * (1 + volumeDiffadjust)
End If
If VolumeNowAve > VolumeLongAve * 6.15 Then
volumeDiffadjust = VolumeNowAve / (VolumeLongAve * 6.15)
volumeDiffadjust = volumeDiffadjust * .85
volumeDiffadjust = System.Math.Sqrt(volumeDiffadjust)
volumeDiffadjust = volumeDiffadjust * .001
diff = diff * (1 + volumeDiffadjust)
End If
If Me.CurrentDate.hour = 10 Then
If Me.currentdate.minute < 20 Then
diff = diff * 1.001
End If
If Me.CurrentDate.hour < 10 Then
If Me.CurrentDate.hour <= 9 Then
If Me.currentdate.minute < 51 Then
diff = (diff * 1.001) + .01
End If
End If
diff = diff * 1.004 + .01
End If
If Me.CurrentDate.hour <= 10 Then
If Me.currentdate.minute < 10 Then
diff = diff * 1.001 + .01
End If
End If
End If
If Me.CurrentDate.hour >= 14 Then
If Me.currentdate.minute > 30 Then
diff = (diff * 1.002)
End If
If Me.CurrentDate.hour > 15 Then
diff = (diff * 1.01)
If Me.currentdate.minute > 15 Then
diff = (diff * 1.001) + .01
End If
End If
End If
plot = diff
|