Price action scan


Category:
0
0

Hello Pete, Hope all is well.

Can you please help write a code for a scan for the stocks with the following criteria:

O = Open

H = High

C= Close

L= Low

In a matter of 25 trading days,

There is only up to 2.48% difference between O and H

and

There is only up to .27% difference between O and C

and

There is only up to 4.62% difference between L and H

and

There is only up to 2.13% difference between C and H

and

There is only up to 1.87% difference between O and L

and

There is only up to 2.25% difference between L and C

Thank you Pete

Marked as spam
Posted by (Questions: 13, Answers: 13)
Asked on May 28, 2018 10:03 am
316 views
0

I have a question about how to interpret this: “In a matter of 25 trading days,”

So we have a span of 25 days, I get that. But for your O,H,L,C percentage limits. Do these percentage limits apply to each individual daily bar within that 25 day period? Because one could also interpret this as the open of the 25 day period versus the close of the 25 day period. And the highest high of the 25 day period versus the lowest low of the 25 day period.

( at May 28, 2018 10:35 am)
0

Each individual daily bar

( at May 28, 2018 1:11 pm)
1
Private answer

I have not tested this. Figured it would be best left for you to test. Since you probably have a better feel for what results should be returned. Give it a shot and let me know how it works.

input limitOH = 2.48;
input limitOC = 0.27;
input limitLH = 4.62;
input limitCH = 2.13;
input limitOL = 1.87;
input limitLC = 2.25;
def conditionOH = 100 * (open / high - 1) > limitOH;
def conditionOC = 100 * (open / close -1) > limitOC;
def conditionLH = 100 * (low / high - 1) > limitLH;
def conditionCH = 100 * (close / high - 1) > limitCH;
def conditionOL = 100 * (open / low - 1) > limitOL;
def conditionLC = 100 * (low / close - 1) > limitLC;
def badEggs = conditionOH or conditionOC or conditionLH or conditionCH or conditionOL or conditionLC;
def noBadEggs = Highest(badEggs, 25) == 0;
plot scan = noBadEggs;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 28, 2018 4:42 pm
0

the code works perfectly Pete, Thank you

( at May 28, 2018 8:22 pm)