Two consecutive candles closing in the top 25 percent of range


Category:
0
0

Pete,

   Clould you help me with a scan….for a long set up…The bar closes in the top 25% of it range..and the next bar has to to close higher than the previous bar and also trade in the top 25% of its range as well..This is now the long set up..

Marked as spam
Posted by (Questions: 49, Answers: 42)
Asked on December 29, 2019 9:49 am
416 views
0
Private answer

The math formula used by this code computes the location of the close within the high/low range as follows:

If the close is at the low of the range the computed value is zero percent. If the close is at the high of the range the computed value is 100%. So in order to find a bar that closes in the top 25% of its range we look for a value greater than or equal to 75.0%.

input targetPercentage = 75.0;
def percentOfRange = 100 * ((close - low) / (high - low));
def closeWithinPOR = percentOfRange >= targetPercentage;
plot scan = closeWithinPOR and closeWithinPOR[1] and close > close[1];

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 29, 2019 11:00 am
0
Pete Could we rewrite the code for just 1 candle instead of two...Not getting any results
( at January 3, 2020 4:17 pm)
0
Modify the last line of the code as follows: plot scan = closeWithinPOR and close > close[1];
( at January 3, 2020 7:04 pm)