How to create Envelope that contains only specific amount of prices outside?
Author: Olekso-Monsterlo
Creation Date: 4/12/2017 8:42 AM
profile picture

Olekso-Monsterlo

#1
Hello!

My question is much more generic than just mentioned in a caption. I'm not sure how to shortly describe it.
So I will use example with envelope to define what I'm interested on.

I want to create Envelope indicator that should met a few requiriements.
I reviewed a few indicators from Community library: EnvelopeUpper/EnvelopeLower and BBandLower but they are not meet requirements:

1. I want to have envelope that was calculated based only on specific amount of days (shouldn't depend from selected timeframe)
For example, I opened weekly chart that contain data for last 5 years and I set parameter for Envelope 100 days (calculate Envelope taken into account prices for the last 100 days)

2. I want to set one more parameter "Envelope Percent Period" that mean percent of prices that shouldn't be inside envelope.
That will give ability to create Envelope that contain strongly 80% or 95% of all prices for last N days.

Note: EnvelopeUpper/EnvelopeLower looks very close to what I want but parameter percent means something other than I want...
Also It's generic question about how to create Indicator where I need:
1. Create DataSeries that partially contain data from originally loaded symbol
2. Update it to contain data based at rule of N% prices. (that probably means to ignore N% of highest prices)
3. Use that DataSeries to build EMA

Does it make any sense in terms of Wealth Lab scripting ?

Thanks.
profile picture

Eugene

#2
Hi,
QUOTE:
That will give ability to create Envelope that contain strongly 80% or 95% of all prices for last N days.

Wouldn't 2 standard deviations contain 95.45% of the data given a normal distribution?
profile picture

Olekso-Monsterlo

#3
Hi Eugene,

QUOTE:
Wouldn't 2 standard deviations contain 95.45% of the data given a normal distribution?


I think it should. I do not know how to implement it in terms of WealthScript.

Maybe you mean one of comunity indicators like this one ?
http://www2.wealth-lab.com/wl5wiki/MAEnvelope.ashx
profile picture

Eugene

#4
I mean that 2 standard deviations are found e.g. in Bollinger Bands®. If you know math/stat, couldn't you convert the Envelope Percent Period input into a number of standard deviations?
profile picture

Olekso-Monsterlo

#5
Hi Eugene,

Sorry but I'm not good at math/stat.
But I can do things if I have an example...
profile picture

Eugene

#6
Neither am I ;)