- ago
Looking through the indicators available in Wealth Lab, I haven't found a way of using support and resistance lines. In combination with other elements of a strategy, I'd like to buy at a support level and then sell just before resistance. Is there a way of doing this in Wealth Lab 7?
1
1,626
Solved
22 Replies

Reply

Bookmark

Sort
- ago
#1
Get to know the uber-cool Chart Patterns extension:
https://www.wealth-lab.com/extension/detail/ChartPatterns#screenshots

You can define such a formation yourself in the PriceGrid Editor in a few clicks!
1
- ago
#2
Another approach is to use the canned "Modified Turtle Soup" strategy from Sample Strategies folder.

QUOTE:
The "turtle soup" pattern was introduced in the book Street Smarts by Linda Raschke and Larry Connors. System buys when price makes a new 20-day low close that is equal to or below another 20-day low close established between four and 30 days ago. Sell at the market after five days in the trade.
0
Cone8
 ( 6.24% )
- ago
#3
If I'm not mistaken, I think the question is how to use manually-drawn lines in Strategies. We had a way to do that in Wealth-Lab before Version 7 by naming the lines and accessing them in Strategies with the TrendLineValue() function. It's very useful, and do it all the time.

Let's turn this into a feature request and rename the Discussion:
Access Manual Trendlines in Strategies

It's got my vote already!
Edit: Actually, it's already on the wish list - add your vote!
https://www.wealth-lab.com/Discussion/Bring-Back-and-Improve-TrendLineValue-6109

=====
Meanwhile, I'll come up with an example using the Chart Patterns Provider that Eugene mentioned.
1
Cone8
 ( 6.24% )
- ago
#4
We sort of missed including the Help for this condition block, but give this a try - create a strategy with a Chart Pattern Rule like below. Inspecting the rules that go into "Rect. Brkout" (Data Manager > Event Providers > Open Library Chart Patterns), you'll see:
CODE:
Rectangle Breakout PeakTroughCompare Trough(0) VeryNear Trough(1) PeakTroughCompare Peak(0) VeryNear Peak(1) PriceCrossesPeakTroughLine Close Below Trough(0) Trough(1) Confirmation PriceCrossesPeakTroughLine Close Above Peak(0) Peak(1) Confirmation

"Very Near" is a setting you can tweak in the Chart Pattern Preferences. The lower the number, the closer the comparison for peaks/trough and the pattern will look more rectangular.



If you "Include Unconfirmed" that means that as soon as the rectangular pattern is detected, you'll trigger a trade (which will occur somewhere in the middle of the pattern, so you probably don't want that.
2
Best Answer
- ago
#5
Thanks for your input on this, Cone. I'll test the couple of options you've suggested above.
0
- ago
#6
The conversation for missing ChartPatterns has been moved to:
https://www.wealth-lab.com/Discussion/ChartPatterns-not-showing-after-installation-6992
0
ww58
- ago
#7
Are there any examples on chart patterns other than already included? I have tried a lot of variations, including Rectangle Breakout, in no way I was able to draw such a line, especially having the opportunity to change the settings only for this pattern
0
Glitch8
 ( 10.65% )
- ago
#8
Something like this is quite easy to spot visually, but how to you encode that objectively so a strategy can detect it?

There are plenty of approaches, I like to use the PeakTroughCalculator with its Trendline functionality, but it's not a cut and dried thing where we can slap a resistance indicator down.

Or, if you have a formula for resistance let me know and we can code it up.
0
Glitch8
 ( 10.65% )
- ago
#10
For example, here's something I coded up that sets resistance to the highest of the 2 most recently detected peaks:

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { 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) {          zz = ZigZag.Series(bars.Close, 1, PeakTroughReversalType.Percent);          PlotIndicator(zz, WLColor.Gray.MakeTransparent(128));          ptc = new PeakTroughCalculator(bars.Close, 1, PeakTroughReversalType.Percent);          StartIndex = 128;          resistance = new TimeSeries(bars.DateTimes);          PlotTimeSeries(resistance, "Resistance", "Price", WLColor.Yellow.MakeTransparent(128), PlotStyle.DashedLine); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) {          //set resistance to the highest of two most recent peaks          PeakTrough pt1 = ptc.GetPeak(idx);          if (pt1 != null)          {             PeakTrough pt2 = ptc.GetPeak(pt1.DetectedAtIndex - 1);             if (pt2 != null)             {                double value = Math.Max(pt1.Value, pt2.Value);                resistance[idx] = value;             }          } }       //declare private variables below       private ZigZag zz;       PeakTroughCalculator ptc;       TimeSeries resistance; } }


1
- ago
#11
@digitalsculpture - One thing you may want to consider is using the Highest and Lowest indicators. If a high is formed for n bars, or a low is formed for n bars then you may consider them as support and resistance levels...

1
ww58
- ago
#12
Glitch, you're right that there are many approaches. As in the LW above or here below the zigzag approach will not work perfectly. Another approach is the use of clustering, which will work if the level is formed by several high, I like it better. Also in it you can code the strength of the level. But it also would not work in the example below with the first 2 levels which are formed by one big bar. However it's debatable what exactly is considered a level. I just don't want to reinvent the wheel, if the level detection is available.

If we talk about a solution that fits everyone and can be added to the program, it is more of a clustering approach, where the level is formed by several high/lows, maximum touches with a given deviation. This approach would have worked best on the example in the initial post as well.
0
Glitch8
 ( 10.65% )
- ago
#13
What are the specific rules for this approach?
0
ww58
- ago
#14
I have these rules: The level is built by the first bar. When building levels, the priority is those with the most touches. The strength of the level is determined by how high or lows are homogeneous with regard to atr and how many false breaks there are. If the strength is less than the threshold, the level is discarded.

I don't see how this can be implemented as an indicator, since we can detect the level only after n number of bars. But as a chart pattern it is quite workable
0
Glitch8
 ( 10.65% )
- ago
#15
I'm sure it could all be coded as an indicator. After all, it's not relying on future data, only past.

>>the priority is those with the most touches<<

What is considered a touch? What if the price blasts right through the level to a new high? Is that a touch?


>>The strength of the level is determined by how high or lows are homogeneous with regard to atr<<

I can vaguely see where you're coming from here but the idea would need to be expressed in a much more concrete way that could be implemented in code.

>>how many false breaks there are<<

How do you quantify a false break?

Is there some strength scoring mechanism in play that adds points depending on the number of level touches, and subtracts points based on false breaks?

So, multiple levels need to be considered at one time? How many? And how far back historically would each level need to look in all these calculations and comparisons?

As you can see, it's quite easy to express a somewhat vague concept but much more difficult to translate it into something codable.
1
- ago
#16
The way Glitch puts it, this comes very close to a cluster analysis of all identifiable supports and resistances (very subjective, although the peaks and troughs already help a lot here) to determine which level would be significant. But it is very computationally intensive at each bar.
0
- ago
#17
Or, just keep it simple and use Highest and Lowest indicators with say 5 or 10 periods. Then measure for consolidation by an ATR multiple between the high and low channels. Consider breakouts by the high channel moving up. Pop the Highest and Lowest on a chart and you'll see. (If you add Highest it will add the companion Lowest and you'll have to manually adjust Lowest to the Low.)

Also, consider adding the Donchian indicator, which in WL8 land is the midpoint between the high and low channels.
0
mjj38
- ago
#18
I mainly use 3 approaches.

a) Multi-Timeframe Pivot highs and lows. Blue and White are daily pivot points while the green and red are 30 minute pivots.


b) Volume Profile (The are a lot of nuances but the principal is the focus on low volume and high volume nodes)


c) Lastly, is using Anchored Vwaps. Great for determining an area of resistance or support. Pink dotted line. See how TSLA paused at this point before pushing through.


This is a new book that just came out on it. Waiting to read it myself.
https://www.amazon.com/dp/B0BLZMMLLJ
0
ww58
- ago
#19
>As you can see, it's quite easy to express a somewhat vague concept but much more difficult to translate it into something codable.
The problem is that any refinement I make will apply to my strategy and will limit others, so I believe that any of the options for detecting levels, whether cluster analysis or any of the others described on the internet, will be good. There just isn't any at all right now. And level strength or false breakout is specific to each strategy.
0
Glitch8
 ( 10.65% )
- ago
#20
>> There just isn't any at all right now<<

Hmmm not true we did provide several concrete resistance examples you just don’t like them 😅
2
- ago
#21
TSLA, Daily, Two years (partial image) follows. This is Highest and Lowest indicators with period set to 10. Look at the highest (red) and lowest (green) indicator lines that are long. Then look at what happens in the future. Nice and simple...

0
ww58
- ago
#22
>Hmmm not true we did provide several concrete resistance examples you just don’t like them 😅
It's just that neither of the two worked for me 😅 I'm not complaining. In my case, it's easier to try to write my own
0

Reply

Bookmark

Sort