Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 5/29/2020 5:49 PM 7 replies, 1906 viewings |
|
|
Printer friendly version |
^ Top | ||||
Gerry![]() Veteran ![]() ![]() ![]() ![]() ![]() Posts: 277 Joined: 12/24/2003 Location: Lewiston, Maine 04240 ![]() |
Hello, How would you go about creating the following scan ? I am still using OmniPro 2014 if that makes a difference. If I am using the following Bollinger Bands formula that looks for stocks whose Upper and Lower Bands are closing in to each other ( tightening ) but want to scan for two other setups that if both of the UPPER and LOWER have been going UP for at least 4 bars then on the last bar the UPPER BAND TURNED DOWN I bar ago, then show me those stocks. Then at the opposite direction is that if both of the UPPER and LOWER BANDS have been going DOWN for at least 4 bars then on the last bar the LOWER BAND TURNED UP 1 bar ago, then show me those stocks. This is what I am now using for TIGHTENING BANDS Bol_Upper(9,1.2) < Bol_Upper(9,1.2)[1] and Bol_Lower(9,1.2) > Bol_Lower(9,1.2)[1] Thanking you in advance, Gerry | |||
^ Top | ||||
Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() |
Hi, Gerry Your description is good but seems contradictory in one regard. If you are requiring the U+L to go up for at least 4 bars, then how could the Upper turn down on the bar before the current one (if it's also going up)? Do you mean, for shorts ... On current bar, Upper is down vs the bar before, and for 4 bars before that, U+L are both up ... and reverse for longs? [Edited by Jim Dean on 8/17/2015 1:06 PM] | |||
^ Top | ||||
Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() |
Solution uses the "Sum" function to accumulate "votes" for successive condition rules to be valid (-sign is important since it converts the sum of four "trues", each = -1, to a positive number): For shorts, this identifies the run of U+L up's with the most recent bar's Upper having just turned down ... -Sum( (Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Upper(9,1.2) < Bol_Upper(9,1.2)[1] For longs, this identifies the run of U+L dn's with the most recent bar's Lower having just turned up ... -Sum( (Bol_Upper(9,1.2)[1] < Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] < Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Lower(9,1.2) > Bol_Lower(9,1.2)[1] I'm not clear how you want to integrate a squeeze with this, so I'll leave that to you ... and btw I have not tested this re syntax or validity, but it's pretty straightforward so hopefully you're good to go. | |||
^ Top | ||||
Gerry![]() Veteran ![]() ![]() ![]() ![]() ![]() Posts: 277 Joined: 12/24/2003 Location: Lewiston, Maine 04240 ![]() |
Hello again Jim, Hi, Gerry Your description is good but seems contradictory in one regard. If you are requiring the U+L to go up for at least 4 bars, then how could the Upper turn down on the bar before the current one (if it's also going up)? Do you mean, for shorts ... On current bar, Upper is down vs the bar before, and for 4 bars before that, U+L are both up ... and reverse for longs? [Edited by Jim Dean on 8/17/2015 2:06 PM] Yes, Jim, Both Bands were heading UP but the Current UPPER bar is Down vs the 4 or more bars that it was heading Up as was the Lower Band but now that the Current UPPER Band has turned Down the LOWER BOLLINGER BAND is still HEADING UP. Show me those stocks. At the opposite end would be that Both Bands were heading DOWN but the CURRENT LOWER is UP vs the 4 or more bars that it was heading DOWN as was the UPPER BAND but now that the CURRENT LOWER BAND has turned UP the UPPER BOLLINGER BAND is still HEADING DOWN. Show me those stocks. These scans would not be a TIGHTENING situation as BOTH Bands are HEADING in the SAME DIRECTION. Hope this helps. Gerry [Edited by Gerry on 8/17/2015 3:10 PM] | |||
^ Top | ||||
Gerry![]() Veteran ![]() ![]() ![]() ![]() ![]() Posts: 277 Joined: 12/24/2003 Location: Lewiston, Maine 04240 ![]() |
Hi Jim, Here is what I have been trying and am not getting any results ? For shorts, this identifies the run of U+L up's with the most recent bar's Upper having just turned down ... -Sum( (Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Upper(9,1.2) < Bol_Upper(9,1.2)[1] For longs, this identifies the run of U+L dn's with the most recent bar's Lower having just turned up ... -Sum( (Bol_Upper(9,1.2)[1] < Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] < Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Lower(9,1.2) > Bol_Lower(9,1.2)[1] I'm not clear how you want to integrate a squeeze with this, so I'll leave that to you ... and btw I have not tested this re syntax or validity, but it's pretty straightforward so hopefully you're good to go. Jim, did you get a chance to read my last post where I indicate in more details what it is that I am looking for. I think that others would enjoy this setup once we have it going. Thanks again, Gerry | |||
^ Top | ||||
Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() |
There could be two reasons for not getting any hits (if the compile is correct): 1. the starting population is too small, or 2. the formula is not doing what you hoped The first is easy to check ... just set population to All US Stocks. If still no hits, then break the formula down to smaller pieces and make sure each piece works right ... -Sum( (Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2]), 4) = 4 and Bol_Upper(9,1.2) < Bol_Upper(9,1.2)[1] would become: Bol_Upper(9,1.2) < Bol_Upper(9,1.2)[1] (check it by itself) ... and ... -Sum( (Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2]), 4) = 4 (check it by itself) if the first piece works but the second doesn't, break the second down: Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2] (checks for just one bar before current to be "up" ... if that works, then try this form, which should give the same results: -Sum( (Bol_Upper(9,1.2)[1] > Bol_Upper(9,1.2)[2] and Bol_Lower(9,1.2)[1] > Bol_Lower(9,1.2)[2]), 1) = 1 if that works, then gradually increase the two final "1's" to 2's then 3's then 4's ... each time you add another test, it gets tougher to satisfy and you will get fewer hits. I can't take time to do a full development and tuning process for you ... but hopefully that "plan" will lead you to a solution, or at least to help focus on the problem area. | |||
^ Top | ||||
Gerry![]() Veteran ![]() ![]() ![]() ![]() ![]() Posts: 277 Joined: 12/24/2003 Location: Lewiston, Maine 04240 ![]() |
Hi Jim, Thanks again ! I will be playing with your setups for the next few days and see what develops. Many Thanks, Gerry | |||
^ Top | ||||
Gerry![]() Veteran ![]() ![]() ![]() ![]() ![]() Posts: 277 Joined: 12/24/2003 Location: Lewiston, Maine 04240 ![]() |
Hello all, If anyone has been trying these scans I am curious as to your results looking to compare some of your findings. Thanks to all, Gerry |
|
|
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |