Indicator to select x% above/below "a value"
Author: Investit
Creation Date: 6/14/2015 3:42 PM
profile picture

Investit

#1
Per a recent question you added the following
Indicator is X% above (below) its value a number of bars ago.

I am looking at the indicator (histogram) being x% above/below a value (such as zero ) a number of bars ago.

If there is a rules based method that I missed would you point it out.
If not, is is possible to add a rule that provides for "a value" a number of bars ago

Thanks
profile picture

Eugene

#2
Let's give it a thought.

A value is a value - whether "today" or "X bars ago". The value is static throughout the backtest. So your rule becomes "indicator being x% above/below a value".

As the value is static (let's say 50), you at all times know when an indicator's threshold is X% above/below the value (let's say 10%). So your rule boils down to "Indicator is above/below a value", where value = your original value +/- X%. So instead of the original value of 50, simply take 55.

This condition is built-in.
profile picture

Investit

#3
I agree with your first statement "indicator being x% above/below a value". Also that "a value" is static throughout the back test.

However I don't see where "this condition is built in".
The rule you created is not "a value" it has "its value"

"Its value" changes every day and is not static per your assumption.
If the rule was "a value" then I would agree with the condition is built in.

I may be dense but your example does not seem to fit what I am trying to do given the rule contains "its value" which is not static and you are stating "a value" which is not in the rule.

What am I missing?
profile picture

Eugene

#4
I'm talking about a different condition:

profile picture

Investit

#5
Forgive me I must be dense.

The value is fixed at zero.
The indicator is the histogram that changes with each stock and each day.

Across many stocks and days I want to take an action when a stock's histogram is at 10% below zero.
I do not know when the histogram will (if ever) be at 10% below the zero.

If I use "Indicator is below a value" or histogram below zero - then I will get false positives when the histogram is in the -.0001% to -9.999% or -10.0001% or lower range.

How would "Indicator is below a value" work in this case?
profile picture

Eugene

#6
So it appears that you're looking for a condition like "indicator is precisely at a value"? It doesn't make great sense to me. At least you can combine it with the opposite condition to create a pair and thus establish a range:

- Indicator is below -9.99
- Indicator is above -10.01

And vice versa for "Indicator above a value".
profile picture

Investit

#7
I may not have given a clear explanation above - I'm not looking for a precise value

My test - assuming that I made a correct buy signal and am holding the stock.
The obvious question is when to sell and not to sell to soon on a down turn if it is just a temporary pullback. I have noticed that the histogram may be a good indicator from the point it crosses under zero.
It turns down (under zero) with the pullback, but only for a smaller amount when it is truly only a pullback.
The amount or value (definition of what small) that it may turn down is subject to the value of the stock and the normal volatility of the stock.

Therefore if I set a fixed value under zero I will miss some stocks that may be valid.
By testing various percentages below I can optimize the results

profile picture

Eugene

#8
I'm having hard time understanding your explanation. At any rate, to establish a range the indicator may take you can also use technique above:

- Indicator is below -9.XX
- Indicator is above -10.XX

and vice versa.
profile picture

Investit

#9
Thanks, you may have hit on what I can do.
Given your dilemma and me not being able to clearly explain it I went over my strategy with a friend and I realized that although I was looking for a percentage above/below zero, in manually trying to generate what I wanted I realized that there is no denominator to use to get the percent that I was thinking about in generating the criteria.
I apologize for taking up your time but thanks for providing a potential an alternative
profile picture

Eugene

#10
Glad to have helped.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).