How to identify the primary trend?
Author: JohnTong
Creation Date: 12/11/2017 3:24 PM
profile picture

JohnTong

#1
I want to find out the primary trending for the past 6 months, either uptrend, downtrend or horizontal?
Also, I want to know the support/resistance level, though there is TrendLineValue[bar], but I wan to know the 2 standard diviation above/below this TrendLine, how to achieve that (like the auto regression channel lines)?
How to find other support/resistance data ?

Thanks
profile picture

Eugene

#2
QUOTE:
I want to find out the primary trending for the past 6 months, either uptrend, downtrend or horizontal?

QUOTE:
How to find other support/resistance data ?

Help us help you on these. There are numerous indicators and techniques aiming at trend detection. Tell us what's your favorite method, and we might help you out with the code.

QUOTE:
Also, I want to know the support/resistance level, though there is TrendLineValue[bar], but I wan to know the 2 standard diviation above/below this TrendLine, how to achieve that (like the auto regression channel lines)?

Standard deviation is available through StdDev DataSeries (indicator). Add or subtract the 2 StdDev[bar] as WealthScript Programming Guide > DataSeries > Accessing a Single Value from a DataSeries. Let me know if something's not clear.
profile picture

JohnTong

#3
Thanks for the StdDev[bar] method.

For the trending question, I want to know if the trendline is going up or going down...

For the support/resistance question, I guess I will simply use the max(High) for the past few months to determine a resistance, is that correct ?

Is there ways to find the upper/lower borders of Donchian channels ? What about Bollinger bands ? Volume on price ?

P.S. Oh, I just found the boolean TrendLine.IsRising, I guess that's the answer for the trending question.

Thanks
profile picture

Eugene

#4
QUOTE:
Is there ways to find the upper/lower borders of Donchian channels ? What about Bollinger bands ? Volume on price ?

I'm not sure if I understand your notion about finding the boundaries. It's your code where you set everything like that so you instantly know that. As the FAQ suggests (How do I get started learning Wealth-Lab?),

Then you can start reading the User Guide and WealthScript Programming Guide (Help menu) and explore the publicly available strategies. Use the convenient "Strategy Download" feature (found in Wealth-Lab's Open Strategy dialog, Ctrl+O).

So you might want to download and explore the various example strategies using both Donchian channels and Bollinger Bands.
profile picture

JohnTong

#5
Thanks for the advice ....