- This topic has 1 reply, 2 voices, and was last updated 2 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Optuma Forums › Optuma Scripting › Scan for pullbacks from new highs
Hi,
I am trying to build a script to use as a scan. Unfortunately, I am stuck.
I want to find stocks that:
1) made a 252 day closing high in the last 10 days
2) has closed below that new high by more than 25% but less than 38.2%.
Here is what I have. I know that my Variable 1 does return stocks that closed at a 252 day high in the last 10 days. I cannot figure out how to find stocks that have now closed 25% to 38.2% below that high returned in Variable 1.
thank you,
Louis.
1 2 3 4 5 6 7 8 9 10 11 |
//Calculate new 252 day closing high in the last 10 bars. V1 = CLOSE() >= HIGHESTHIGH(Close(), BARS=252, EQUAL=True, INCBAR=True) and TIMESINCESIGNAL(V1) <= 10; //Define 25% below V1 and 38.2% below V1. V2 = (V1 * -0.25); V3 = -(V1 * -0.382); //Show when conditions are true. Close() <= V2 and >= V3; |
Hi,
Here is how i would script the criteria you listed:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
//Find new 252 Day Highs V1 = High() CrossesAbove HIGHESTHIGH(BARS=252) ; //Find New Highs within the last 10 days V2 = TIMESINCESIGNAL(V1) <= 10; //Find High Value at last trigger V3 = PRICEATSIGNAL(V1, PRICE=High); //Find Pullback Range V4 = V3 * 0.75; V5 = V3 * 0.618; //Results CLOSE() >= V5 and CLOSE() <= V4 and V2 == 1 |
Here is how it looks on a chart:
Black Line = Highest High (252 days) and Pink Arrows = Criteria Pass
Cookie | Duration | Description |
---|---|---|
cname | 14 days | This cookie is set by Optuma. The cookies is used to store the users campaign selection for selecting the correct version of Optuma to trial and is "Necessary". |
cookielawinfo-checbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |