WL team - I am looking for a way to add the vortex indicator and TMM squeeze (with the 7 colors). I saw that there is a TASCIndicators library which includes the vortex on wiki lab but I think that since more active and compatible (link attached). I also want to modify and add retracements for the fibonnaci tool if possible. Do I have to code all this ?
Rename
Link? Do you mean TTM Squeeze or is there a TMM too?
Forget about the Wiki, it's not for your version of WL. It's deprecated. Simply drag Squeeze or VMMinus/VMPlus from the Indicators tab onto a chart.
excuse me i'm talking about TASCIndicators library.
https://www2.wealth-lab.com/wl5wiki/TASCJan2010.ashx
For TTM SQUEEZE I'm talking about this model (image) which must be hard to code.
I coded indicators on TC2000 which is much simpler (formula), I admit that here I don't know where to start...
https://www2.wealth-lab.com/wl5wiki/TASCJan2010.ashx
For TTM SQUEEZE I'm talking about this model (image) which must be hard to code.
I coded indicators on TC2000 which is much simpler (formula), I admit that here I don't know where to start...
I know what you're talking about. Anyway, just do as suggested:
Simply drag Squeeze or VMMinus/VMPlus from the Indicators tab onto a chart.
That's all it takes.
Simply drag Squeeze or VMMinus/VMPlus from the Indicators tab onto a chart.
That's all it takes.
I coded up a version of TTM Squeeze for another generous WealthLabber, who probably won't mind if I share it with the community. It also includes a _squeezeCode TimeSeries that you can use in a trade condition.
You'll have to adjust the color logic. Here's what the code below looks like -
You'll have to adjust the color logic. Here's what the code below looks like -
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript123 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { Plot_TTM_Squeeze(bars, 20, 2.0); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } void Plot_TTM_Squeeze(BarHistory bars, int length, double stdDevs) { string paneTag = "Squeeze"; SetPaneDrawingOptions(paneTag, 15, 125); TimeSeries price = bars.Close; BBLower LowerBandBB = BBLower.Series(price, length, stdDevs); BBUpper UpperBandBB = BBUpper.Series(price, length, stdDevs); double factorhigh = 1.0; double factormid = 1.5; double factorlow = 2.0; TimeSeries shifthigh = factorhigh * SMA.Series(TR.Series(bars), length); TimeSeries shiftMid = factormid * SMA.Series(TR.Series(bars), length); TimeSeries shiftlow = factorlow * SMA.Series(TR.Series(bars), length); TimeSeries average = SMA.Series(price, length); TimeSeries UpperBandKCLow = average + shiftlow; TimeSeries LowerBandKCLow = average - shiftlow; TimeSeries UpperBandKCMid = average + shiftMid; TimeSeries LowerBandKCMid = average - shiftMid; TimeSeries UpperBandKCHigh = average + shifthigh; TimeSeries LowerBandKCHigh = average - shifthigh; TimeSeries K = (Highest.Series(bars.High, length) + Lowest.Series(bars.Low, length)) / 2 + EMA.Series(bars.Close, length); _momo = LR.Series(price - K / 2, length); PlotTimeSeries(_momo, "_momo", paneTag, WLColor.Gold, PlotStyle.Histogram); //create and plot a series of zeroes for the colored dots TimeSeries squeezeline = new TimeSeries(bars.DateTimes, 0); TimeSeries _squeezeCode = new TimeSeries(bars.DateTimes, 0); // use for screen PlotTimeSeries(squeezeline, "Squeeze", paneTag, WLColor.LightGray, PlotStyle.Dots, true); for (int n = 1; n < bars.Count; n++) { bool pos = _momo[n] >= 0; bool neg = !pos; bool up = _momo[n] >= _momo[n - 1]; bool dn = !up; bool presqueeze = LowerBandBB[n] > LowerBandKCLow[n] && UpperBandBB[n] < UpperBandKCLow[n]; bool originalSqueeze = LowerBandBB[n] > LowerBandKCMid[n] && UpperBandBB[n] < UpperBandKCMid[n]; bool ExtrSqueeze = LowerBandBB[n] > LowerBandKCHigh[n] && UpperBandBB[n] < UpperBandKCHigh[n]; bool PosUp = pos && up; bool PosDn = pos && dn; bool NegDn = neg && dn; bool NegUp = neg && up; WLColor color = WLColor.Green; int colorCode = 0; if (ExtrSqueeze) { color = WLColor.Purple; colorCode = 3; } else if (originalSqueeze) { color = WLColor.Red; colorCode = 2; } else if (presqueeze) { color = WLColor.DarkOrange; colorCode = 1; } SetSeriesBarColor(squeezeline, n, color); _squeezeCode[n] = colorCode; DrawDot(n, 0, color, 3, paneTag); if (PosUp) color = WLColor.LightBlue; else if (PosDn) color = WLColor.DarkBlue; else if (NegDn) color = WLColor.Red; else if (NegUp) color = WLColor.Yellow; SetSeriesBarColor(_momo, n, color); } } Parameter _plotTTMSqueeze; TimeSeries _squeezeCode; // " squeeze color code 0= Green, 1= Orange, 2= Red, 3= Purple TimeSeries _momo; } }
For the next update, would it be possible to add vortex to advanced smootheds? it is an indicator that is available at several brokers including IBKR.
Would these be the Vortex indicators you're looking for?
https://www.investopedia.com/terms/v/vortex-indicator-vi.asp
https://www.investopedia.com/terms/v/vortex-indicator-vi.asp
Yes, I am talking about these formulas.
Haven't we added the VMPlus/VMMinus aka Vortex Movement from the January 2010 issue of TASC?
It's correct ! yet I had it...
I had noticed a minor difference from the one used on TC2000, but I assume this is due to the data.
I had noticed a minor difference from the one used on TC2000, but I assume this is due to the data.
Your Response
Post
Edit Post
Login is required