New version 17 available now


Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

VST in TC Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thnkbigr
Posted : Thursday, January 11, 2018 3:45:03 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,013

Bruce 

As you are aware I refined the the Volatility Stop indicator in SF to get rid of what I believe were flaws and one of those Adjustments were how far you allow the indicator to retreat 

In TC take a look at JP with a VST 22, 4 setting as an ex pls 

As you can see the stock made a new low 12/6 and has rallied eversince crossing above the VST 22,4 on 1/2

As the stock rallied from 12/6 it's volatility shrank which resulted in smaller and smaller gap between price and the indicator. 

In SF we made a few adjustments and one was to only re-adjust the stop loss value when the stock makes a new high if price is above the indicator or when price is below the indicator only re-adjust the stop when the stock makes a new low

If instead the volatility would have expanded in JP in the last month that it has been rallying it woudl have caused the Stop level to back away and become wider that's why one of the other adjutments we made was to only allow the indiactor to retreat by a Max amount of ATR which I only allow Max 1. From what I see in TC this is not an issue bc the indicator never backs away. It seems when volatility expands it goes sideways but if volatility shrinks it causes the gap to become smaller which in return causes a lot of whipsaws. 

I have copied the VST RealCode below for your ref

I have also shared a chart in Sf V4 with 3 types of VST indicators under VST types 

The white one is the one that allows Max 1 Retreat as volatility expands 

The Yellow one doesn't allow any retreat AND only re-adjust the stop on a NH or NL which is why from 12/7 a day after the NL the indicator went side ways 

The Red one is something similar to what we have in TC but it doesn't seem to be exactly the same. 

Can you please tell me what the diff is? 

And also is there any chance to adjust the Current VST indicator to enhance it

Many thanks  

'# period = UserInput.Single = 22
'# factor = UserInput.Single = 4
'# retreat = UserInput.Single = 1
'# Cumulative
Static TR As Single
Static ATR As Single
Static termRatio As Single
static Weight As Single
Static sumWeight As Single
Static extreme(1) As Single
Static tstop As Single
Static state As Boolean
If isFirstBar Then
TR = Price.High - Price.Low
termRatio = (period - 1) / period
ATR = TR
sumweight = termratio + 1
weight = 1 / sumweight
If Price.Last(-1) - System.Math.Min(Price.Low, Price.Low(-1)) < _
System.Math.Max(Price.High, Price.High(-1)) - Price.Last(-1) Then
extreme(0) = Price.Last
tstop = extreme(0) + factor * TR
extreme(1) = tstop
state = False
Else
extreme(0) = Price.Last
tstop = extreme(0) - factor * TR
extreme(1) = tstop
state = True
End If
Plot = tstop
Else
TR = (Price.High - Price.Low + _
System.Math.Abs(Price.High - Price.Last(1)) + _
System.Math.Abs(Price.Last(1) - Price.Low)) / 2
ATR = ATR * (1 - weight) + weight * TR
sumweight = sumweight * termratio + 1
weight = 1 / sumweight
If state
If Price.Last < tstop
state = False
extreme(0) = Price.Last
tstop = extreme(0) + factor * ATR
extreme(1) = tstop
End If
Else
If Price.Last > tstop
state = True
extreme(0) = Price.Last
tstop = extreme(0) - factor * ATR
extreme(1) = tstop
End If
End If
Plot = tstop
If state Then
If Price.High > Price.MaxHigh(9, 1) Then
extreme(0) = System.Math.Max(extreme(0), Price.Last)
tstop = extreme(0) - factor * ATR
extreme(1) = System.Math.Max(extreme(1), tstop)
tstop = System.Math.Max(tstop, extreme(1) - retreat * ATR)
End If
Else
If Price.Low < Price.MinLow(9, 1) Then
extreme(0) = System.Math.Min(extreme(0), Price.Last)
tstop = extreme(0) + factor * ATR
extreme(1) = System.Math.Min(extreme(1), tstop)
tstop = System.Math.Min(tstop, extreme(1) + retreat * ATR)
End If
End If
End If
 

 

Bruce_L
Posted : Thursday, January 11, 2018 4:06:59 PM


Worden Trainer

Joined: 10/7/2004
Posts: 61,564

Thank you for your suggestion.

I can't find your shared chart called "VST types".



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Thursday, January 11, 2018 4:15:18 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,013

sorry just shared 

Bruce_L
Posted : Thursday, January 11, 2018 4:25:11 PM


Worden Trainer

Joined: 10/7/2004
Posts: 61,564

The only difference I see between the red and yellow is the new high / new low check before allowing the VST to be adjusted in the yellow version. It isn't in the red version.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Thursday, January 11, 2018 6:32:55 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,013

I am aware of the differences between those in SF 

Out of the 3 in the SF chart I shared the Red one is the most similar to the volatility stop in TC. I am trying to find how what the diff is bc I can see the PCF in TC 

Bruce_L
Posted : Friday, January 12, 2018 9:04:42 AM


Worden Trainer

Joined: 10/7/2004
Posts: 61,564


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Friday, January 12, 2018 1:12:40 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,013

Thanks I'll play with it over the weekend 

Is there anyway to make adjustements to the VST in TC like we did in SF 

Bruce_L
Posted : Friday, January 12, 2018 2:00:48 PM


Worden Trainer

Joined: 10/7/2004
Posts: 61,564

No, there isn't any reasonable way to create a VST indicator in TC2000 or modify the existing VST indicator.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.