TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum » Customer Training & Support » Ask a Trainer - TC2000 version 12/18 » pcf decimal error
Bruce I am trying to create this PCF as below but its giving me error message as : numeric value with multiple decimal places at position 87 " so in the newer version can u please ask the development team to have that particular error highlighted so we can fix on our own because position 87 means what and where ?
Please help me to correct this below pcf
Position 87 is the 87th character in the entire formula. The issue is that .5.2 in the formula and the many subsequent .5.s going from .5.2 through .5.36 as the various bars ago parameters increase.
I am really not quite sure what the formula is supposed to be doing to tell you how to correct it. There seem to be a bunch of bars ago parameters connected to the end of numbers instead of being attached to the end of indicator syntax.
I guess I could have created something like this using copy and replace, but I usually test long formulas like this before I post them in the forums.
Thank you for your suggestion.
Ok bruce what i was trying to do is make dot plot overlayed as higher high fractal , Lower high fractal , Higher low fractal and Lower Low fractal on Bollinger bands %B with 4 different colours
So can u please help , I thought i might be able to do it myself but obviously without your expert input nothing seems to fall in right place
thankyou
I probably am not going to be able to do the full formula until sometime tomorrow, so let me show you what the problem seems to be.
Where you have written the following for the 2 bars ago version of Bollinger Band %B:
(C - AVGC20) / 2 / 2 / STDDEV20 + .5.2
It needs to actually be the following instead:
(C2 - AVGC20.2) / 2 / 2 / STDDEV20.2 + .5
But you don't actually need to calculate the entire Bollinger Bands %B formula:
(C - AVGC20) / 2 / 2 / STDDEV20 + .5
You can actually eliminate both the / 2 / 2 and the + .5 sections of the formula. If Bollinger Bands %B is at its highest point, then the following would be as well.
(C - AVGC20) / STDDEV20
And the 2 bars ago version of that woul dbe:
(C2 - AVGC20.2) / STDDEV20.2
I don't know if you want to give it a try before tomorrow or not.
No problem Bruce i will wait until tomorrow for you to give me the pcf because the other ones i will goof up > < signs i know
thanks
My assumption is that is a lower high fractal.
IIF((C2 - AVGC20.2) / STDDEV20.2 > GREATEST(MAX((C0 - AVGC20.0) / STDDEV20.0, 2), MAX((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 < IIF((C5 - AVGC20.5) / STDDEV20.5 > GREATEST(MAX((C3 - AVGC20.3) / STDDEV20.3, 2), MAX((C6 - AVGC20.6) / STDDEV20.6, 2)), (C5 - AVGC20.5) / STDDEV20.5, IIF((C6 - AVGC20.6) / STDDEV20.6 > GREATEST(MAX((C4 - AVGC20.4) / STDDEV20.4, 2), MAX((C7 - AVGC20.7) / STDDEV20.7, 2)), (C6 - AVGC20.6) / STDDEV20.6, IIF((C7 - AVGC20.7) / STDDEV20.7 > GREATEST(MAX((C5 - AVGC20.5) / STDDEV20.5, 2), MAX((C8 - AVGC20.8) / STDDEV20.8, 2)), (C7 - AVGC20.7) / STDDEV20.7, IIF((C8 - AVGC20.8) / STDDEV20.8 > GREATEST(MAX((C6 - AVGC20.6) / STDDEV20.6, 2), MAX((C9 - AVGC20.9) / STDDEV20.9, 2)), (C8 - AVGC20.8) / STDDEV20.8, IIF((C9 - AVGC20.9) / STDDEV20.9 > GREATEST(MAX((C7 - AVGC20.7) / STDDEV20.7, 2), MAX((C10 - AVGC20.10) / STDDEV20.10, 2)), (C9 - AVGC20.9) / STDDEV20.9, IIF((C10 - AVGC20.10) / STDDEV20.10 > GREATEST(MAX((C8 - AVGC20.8) / STDDEV20.8, 2), MAX((C11 - AVGC20.11) / STDDEV20.11, 2)), (C10 - AVGC20.10) / STDDEV20.10, IIF((C11 - AVGC20.11) / STDDEV20.11 > GREATEST(MAX((C9 - AVGC20.9) / STDDEV20.9, 2), MAX((C12 - AVGC20.12) / STDDEV20.12, 2)), (C11 - AVGC20.11) / STDDEV20.11, IIF((C12 - AVGC20.12) / STDDEV20.12 > GREATEST(MAX((C10 - AVGC20.10) / STDDEV20.10, 2), MAX((C13 - AVGC20.13) / STDDEV20.13, 2)), (C12 - AVGC20.12) / STDDEV20.12, IIF((C13 - AVGC20.13) / STDDEV20.13 > GREATEST(MAX((C11 - AVGC20.11) / STDDEV20.11, 2), MAX((C14 - AVGC20.14) / STDDEV20.14, 2)), (C13 - AVGC20.13) / STDDEV20.13, IIF((C14 - AVGC20.14) / STDDEV20.14 > GREATEST(MAX((C12 - AVGC20.12) / STDDEV20.12, 2), MAX((C15 - AVGC20.15) / STDDEV20.15, 2)), (C14 - AVGC20.14) / STDDEV20.14, IIF((C15 - AVGC20.15) / STDDEV20.15 > GREATEST(MAX((C13 - AVGC20.13) / STDDEV20.13, 2), MAX((C16 - AVGC20.16) / STDDEV20.16, 2)), (C15 - AVGC20.15) / STDDEV20.15, IIF((C16 - AVGC20.16) / STDDEV20.16 > GREATEST(MAX((C14 - AVGC20.14) / STDDEV20.14, 2), MAX((C17 - AVGC20.17) / STDDEV20.17, 2)), (C16 - AVGC20.16) / STDDEV20.16, IIF((C17 - AVGC20.17) / STDDEV20.17 > GREATEST(MAX((C15 - AVGC20.15) / STDDEV20.15, 2), MAX((C18 - AVGC20.18) / STDDEV20.18, 2)), (C17 - AVGC20.17) / STDDEV20.17, IIF((C18 - AVGC20.18) / STDDEV20.18 > GREATEST(MAX((C16 - AVGC20.16) / STDDEV20.16, 2), MAX((C19 - AVGC20.19) / STDDEV20.19, 2)), (C18 - AVGC20.18) / STDDEV20.18, IIF((C19 - AVGC20.19) / STDDEV20.19 > GREATEST(MAX((C17 - AVGC20.17) / STDDEV20.17, 2), MAX((C20 - AVGC20.20) / STDDEV20.20, 2)), (C19 - AVGC20.19) / STDDEV20.19, IIF((C20 - AVGC20.20) / STDDEV20.20 > GREATEST(MAX((C18 - AVGC20.18) / STDDEV20.18, 2), MAX((C21 - AVGC20.21) / STDDEV20.21, 2)), (C20 - AVGC20.20) / STDDEV20.20, IIF((C21 - AVGC20.21) / STDDEV20.21 > GREATEST(MAX((C19 - AVGC20.19) / STDDEV20.19, 2), MAX((C22 - AVGC20.22) / STDDEV20.22, 2)), (C21 - AVGC20.21) / STDDEV20.21, IIF((C22 - AVGC20.22) / STDDEV20.22 > GREATEST(MAX((C20 - AVGC20.20) / STDDEV20.20, 2), MAX((C23 - AVGC20.23) / STDDEV20.23, 2)), (C22 - AVGC20.22) / STDDEV20.22, IIF((C23 - AVGC20.23) / STDDEV20.23 > GREATEST(MAX((C21 - AVGC20.21) / STDDEV20.21, 2), MAX((C24 - AVGC20.24) / STDDEV20.24, 2)), (C23 - AVGC20.23) / STDDEV20.23, IIF((C24 - AVGC20.24) / STDDEV20.24 > GREATEST(MAX((C22 - AVGC20.22) / STDDEV20.22, 2), MAX((C25 - AVGC20.25) / STDDEV20.25, 2)), (C24 - AVGC20.24) / STDDEV20.24, IIF((C25 - AVGC20.25) / STDDEV20.25 > GREATEST(MAX((C23 - AVGC20.23) / STDDEV20.23, 2), MAX((C26 - AVGC20.26) / STDDEV20.26, 2)), (C25 - AVGC20.25) / STDDEV20.25, IIF((C26 - AVGC20.26) / STDDEV20.26 > GREATEST(MAX((C24 - AVGC20.24) / STDDEV20.24, 2), MAX((C27 - AVGC20.27) / STDDEV20.27, 2)), (C26 - AVGC20.26) / STDDEV20.26, IIF((C27 - AVGC20.27) / STDDEV20.27 > GREATEST(MAX((C25 - AVGC20.25) / STDDEV20.25, 2), MAX((C28 - AVGC20.28) / STDDEV20.28, 2)), (C27 - AVGC20.27) / STDDEV20.27, IIF((C28 - AVGC20.28) / STDDEV20.28 > GREATEST(MAX((C26 - AVGC20.26) / STDDEV20.26, 2), MAX((C29 - AVGC20.29) / STDDEV20.29, 2)), (C28 - AVGC20.28) / STDDEV20.28, IIF((C29 - AVGC20.29) / STDDEV20.29 > GREATEST(MAX((C27 - AVGC20.27) / STDDEV20.27, 2), MAX((C30 - AVGC20.30) / STDDEV20.30, 2)), (C29 - AVGC20.29) / STDDEV20.29, IIF((C30 - AVGC20.30) / STDDEV20.30 > GREATEST(MAX((C28 - AVGC20.28) / STDDEV20.28, 2), MAX((C31 - AVGC20.31) / STDDEV20.31, 2)), (C30 - AVGC20.30) / STDDEV20.30, IIF((C31 - AVGC20.31) / STDDEV20.31 > GREATEST(MAX((C29 - AVGC20.29) / STDDEV20.29, 2), MAX((C32 - AVGC20.32) / STDDEV20.32, 2)), (C31 - AVGC20.31) / STDDEV20.31, IIF((C32 - AVGC20.32) / STDDEV20.32 > GREATEST(MAX((C30 - AVGC20.30) / STDDEV20.30, 2), MAX((C33 - AVGC20.33) / STDDEV20.33, 2)), (C32 - AVGC20.32) / STDDEV20.32, IIF((C33 - AVGC20.33) / STDDEV20.33 > GREATEST(MAX((C31 - AVGC20.31) / STDDEV20.31, 2), MAX((C34 - AVGC20.34) / STDDEV20.34, 2)), (C33 - AVGC20.33) / STDDEV20.33, IIF((C34 - AVGC20.34) / STDDEV20.34 > GREATEST(MAX((C32 - AVGC20.32) / STDDEV20.32, 2), MAX((C35 - AVGC20.35) / STDDEV20.35, 2)), (C34 - AVGC20.34) / STDDEV20.34, IIF((C35 - AVGC20.35) / STDDEV20.35 > GREATEST(MAX((C33 - AVGC20.33) / STDDEV20.33, 2), MAX((C36 - AVGC20.36) / STDDEV20.36, 2)), (C35 - AVGC20.35) / STDDEV20.35, IIF((C36 - AVGC20.36) / STDDEV20.36 > GREATEST(MAX((C34 - AVGC20.34) / STDDEV20.34, 2), MAX((C37 - AVGC20.37) / STDDEV20.37, 2)), (C36 - AVGC20.36) / STDDEV20.36, IIF((C37 - AVGC20.37) / STDDEV20.37 > GREATEST(MAX((C35 - AVGC20.35) / STDDEV20.35, 2), MAX((C38 - AVGC20.38) / STDDEV20.38, 2)), (C37 - AVGC20.37) / STDDEV20.37, IIF((C38 - AVGC20.38) / STDDEV20.38 > GREATEST(MAX((C36 - AVGC20.36) / STDDEV20.36, 2), MAX((C39 - AVGC20.39) / STDDEV20.39, 2)), (C38 - AVGC20.38) / STDDEV20.38, IIF((C39 - AVGC20.39) / STDDEV20.39 > GREATEST(MAX((C37 - AVGC20.37) / STDDEV20.37, 2), MAX((C40 - AVGC20.40) / STDDEV20.40, 2)), (C39 - AVGC20.39) / STDDEV20.39, (C2 - AVGC20.2) / STDDEV20.2 - 1))))))))))))))))))))))))))))))))))), (C2 - AVGC20.2) / 4 / STDDEV20.2 + .5, 1 / 0)
Bruce I m not on my computer today , just traveling for a day, so once you upload all 4 fractal pcf’s will check later in evening and update you tomorrow
thanks again
The higher high should involve changing one > sign to a < sign and one - operator to a + operator.
IIF((C2 - AVGC20.2) / STDDEV20.2 > GREATEST(MAX((C0 - AVGC20.0) / STDDEV20.0, 2), MAX((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 > IIF((C5 - AVGC20.5) / STDDEV20.5 > GREATEST(MAX((C3 - AVGC20.3) / STDDEV20.3, 2), MAX((C6 - AVGC20.6) / STDDEV20.6, 2)), (C5 - AVGC20.5) / STDDEV20.5, IIF((C6 - AVGC20.6) / STDDEV20.6 > GREATEST(MAX((C4 - AVGC20.4) / STDDEV20.4, 2), MAX((C7 - AVGC20.7) / STDDEV20.7, 2)), (C6 - AVGC20.6) / STDDEV20.6, IIF((C7 - AVGC20.7) / STDDEV20.7 > GREATEST(MAX((C5 - AVGC20.5) / STDDEV20.5, 2), MAX((C8 - AVGC20.8) / STDDEV20.8, 2)), (C7 - AVGC20.7) / STDDEV20.7, IIF((C8 - AVGC20.8) / STDDEV20.8 > GREATEST(MAX((C6 - AVGC20.6) / STDDEV20.6, 2), MAX((C9 - AVGC20.9) / STDDEV20.9, 2)), (C8 - AVGC20.8) / STDDEV20.8, IIF((C9 - AVGC20.9) / STDDEV20.9 > GREATEST(MAX((C7 - AVGC20.7) / STDDEV20.7, 2), MAX((C10 - AVGC20.10) / STDDEV20.10, 2)), (C9 - AVGC20.9) / STDDEV20.9, IIF((C10 - AVGC20.10) / STDDEV20.10 > GREATEST(MAX((C8 - AVGC20.8) / STDDEV20.8, 2), MAX((C11 - AVGC20.11) / STDDEV20.11, 2)), (C10 - AVGC20.10) / STDDEV20.10, IIF((C11 - AVGC20.11) / STDDEV20.11 > GREATEST(MAX((C9 - AVGC20.9) / STDDEV20.9, 2), MAX((C12 - AVGC20.12) / STDDEV20.12, 2)), (C11 - AVGC20.11) / STDDEV20.11, IIF((C12 - AVGC20.12) / STDDEV20.12 > GREATEST(MAX((C10 - AVGC20.10) / STDDEV20.10, 2), MAX((C13 - AVGC20.13) / STDDEV20.13, 2)), (C12 - AVGC20.12) / STDDEV20.12, IIF((C13 - AVGC20.13) / STDDEV20.13 > GREATEST(MAX((C11 - AVGC20.11) / STDDEV20.11, 2), MAX((C14 - AVGC20.14) / STDDEV20.14, 2)), (C13 - AVGC20.13) / STDDEV20.13, IIF((C14 - AVGC20.14) / STDDEV20.14 > GREATEST(MAX((C12 - AVGC20.12) / STDDEV20.12, 2), MAX((C15 - AVGC20.15) / STDDEV20.15, 2)), (C14 - AVGC20.14) / STDDEV20.14, IIF((C15 - AVGC20.15) / STDDEV20.15 > GREATEST(MAX((C13 - AVGC20.13) / STDDEV20.13, 2), MAX((C16 - AVGC20.16) / STDDEV20.16, 2)), (C15 - AVGC20.15) / STDDEV20.15, IIF((C16 - AVGC20.16) / STDDEV20.16 > GREATEST(MAX((C14 - AVGC20.14) / STDDEV20.14, 2), MAX((C17 - AVGC20.17) / STDDEV20.17, 2)), (C16 - AVGC20.16) / STDDEV20.16, IIF((C17 - AVGC20.17) / STDDEV20.17 > GREATEST(MAX((C15 - AVGC20.15) / STDDEV20.15, 2), MAX((C18 - AVGC20.18) / STDDEV20.18, 2)), (C17 - AVGC20.17) / STDDEV20.17, IIF((C18 - AVGC20.18) / STDDEV20.18 > GREATEST(MAX((C16 - AVGC20.16) / STDDEV20.16, 2), MAX((C19 - AVGC20.19) / STDDEV20.19, 2)), (C18 - AVGC20.18) / STDDEV20.18, IIF((C19 - AVGC20.19) / STDDEV20.19 > GREATEST(MAX((C17 - AVGC20.17) / STDDEV20.17, 2), MAX((C20 - AVGC20.20) / STDDEV20.20, 2)), (C19 - AVGC20.19) / STDDEV20.19, IIF((C20 - AVGC20.20) / STDDEV20.20 > GREATEST(MAX((C18 - AVGC20.18) / STDDEV20.18, 2), MAX((C21 - AVGC20.21) / STDDEV20.21, 2)), (C20 - AVGC20.20) / STDDEV20.20, IIF((C21 - AVGC20.21) / STDDEV20.21 > GREATEST(MAX((C19 - AVGC20.19) / STDDEV20.19, 2), MAX((C22 - AVGC20.22) / STDDEV20.22, 2)), (C21 - AVGC20.21) / STDDEV20.21, IIF((C22 - AVGC20.22) / STDDEV20.22 > GREATEST(MAX((C20 - AVGC20.20) / STDDEV20.20, 2), MAX((C23 - AVGC20.23) / STDDEV20.23, 2)), (C22 - AVGC20.22) / STDDEV20.22, IIF((C23 - AVGC20.23) / STDDEV20.23 > GREATEST(MAX((C21 - AVGC20.21) / STDDEV20.21, 2), MAX((C24 - AVGC20.24) / STDDEV20.24, 2)), (C23 - AVGC20.23) / STDDEV20.23, IIF((C24 - AVGC20.24) / STDDEV20.24 > GREATEST(MAX((C22 - AVGC20.22) / STDDEV20.22, 2), MAX((C25 - AVGC20.25) / STDDEV20.25, 2)), (C24 - AVGC20.24) / STDDEV20.24, IIF((C25 - AVGC20.25) / STDDEV20.25 > GREATEST(MAX((C23 - AVGC20.23) / STDDEV20.23, 2), MAX((C26 - AVGC20.26) / STDDEV20.26, 2)), (C25 - AVGC20.25) / STDDEV20.25, IIF((C26 - AVGC20.26) / STDDEV20.26 > GREATEST(MAX((C24 - AVGC20.24) / STDDEV20.24, 2), MAX((C27 - AVGC20.27) / STDDEV20.27, 2)), (C26 - AVGC20.26) / STDDEV20.26, IIF((C27 - AVGC20.27) / STDDEV20.27 > GREATEST(MAX((C25 - AVGC20.25) / STDDEV20.25, 2), MAX((C28 - AVGC20.28) / STDDEV20.28, 2)), (C27 - AVGC20.27) / STDDEV20.27, IIF((C28 - AVGC20.28) / STDDEV20.28 > GREATEST(MAX((C26 - AVGC20.26) / STDDEV20.26, 2), MAX((C29 - AVGC20.29) / STDDEV20.29, 2)), (C28 - AVGC20.28) / STDDEV20.28, IIF((C29 - AVGC20.29) / STDDEV20.29 > GREATEST(MAX((C27 - AVGC20.27) / STDDEV20.27, 2), MAX((C30 - AVGC20.30) / STDDEV20.30, 2)), (C29 - AVGC20.29) / STDDEV20.29, IIF((C30 - AVGC20.30) / STDDEV20.30 > GREATEST(MAX((C28 - AVGC20.28) / STDDEV20.28, 2), MAX((C31 - AVGC20.31) / STDDEV20.31, 2)), (C30 - AVGC20.30) / STDDEV20.30, IIF((C31 - AVGC20.31) / STDDEV20.31 > GREATEST(MAX((C29 - AVGC20.29) / STDDEV20.29, 2), MAX((C32 - AVGC20.32) / STDDEV20.32, 2)), (C31 - AVGC20.31) / STDDEV20.31, IIF((C32 - AVGC20.32) / STDDEV20.32 > GREATEST(MAX((C30 - AVGC20.30) / STDDEV20.30, 2), MAX((C33 - AVGC20.33) / STDDEV20.33, 2)), (C32 - AVGC20.32) / STDDEV20.32, IIF((C33 - AVGC20.33) / STDDEV20.33 > GREATEST(MAX((C31 - AVGC20.31) / STDDEV20.31, 2), MAX((C34 - AVGC20.34) / STDDEV20.34, 2)), (C33 - AVGC20.33) / STDDEV20.33, IIF((C34 - AVGC20.34) / STDDEV20.34 > GREATEST(MAX((C32 - AVGC20.32) / STDDEV20.32, 2), MAX((C35 - AVGC20.35) / STDDEV20.35, 2)), (C34 - AVGC20.34) / STDDEV20.34, IIF((C35 - AVGC20.35) / STDDEV20.35 > GREATEST(MAX((C33 - AVGC20.33) / STDDEV20.33, 2), MAX((C36 - AVGC20.36) / STDDEV20.36, 2)), (C35 - AVGC20.35) / STDDEV20.35, IIF((C36 - AVGC20.36) / STDDEV20.36 > GREATEST(MAX((C34 - AVGC20.34) / STDDEV20.34, 2), MAX((C37 - AVGC20.37) / STDDEV20.37, 2)), (C36 - AVGC20.36) / STDDEV20.36, IIF((C37 - AVGC20.37) / STDDEV20.37 > GREATEST(MAX((C35 - AVGC20.35) / STDDEV20.35, 2), MAX((C38 - AVGC20.38) / STDDEV20.38, 2)), (C37 - AVGC20.37) / STDDEV20.37, IIF((C38 - AVGC20.38) / STDDEV20.38 > GREATEST(MAX((C36 - AVGC20.36) / STDDEV20.36, 2), MAX((C39 - AVGC20.39) / STDDEV20.39, 2)), (C38 - AVGC20.38) / STDDEV20.38, IIF((C39 - AVGC20.39) / STDDEV20.39 > GREATEST(MAX((C37 - AVGC20.37) / STDDEV20.37, 2), MAX((C40 - AVGC20.40) / STDDEV20.40, 2)), (C39 - AVGC20.39) / STDDEV20.39, (C2 - AVGC20.2) / STDDEV20.2 + 1))))))))))))))))))))))))))))))))))), (C2 - AVGC20.2) / 4 / STDDEV20.2 + .5, 1 / 0)
Lover Low should be the first formula with > GREASTEST replaced by < LEAST and MAX replaced by MIN.
IIF((C2 - AVGC20.2) / STDDEV20.2 < LEAST(MIN((C0 - AVGC20.0) / STDDEV20.0, 2), MIN((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 < IIF((C5 - AVGC20.5) / STDDEV20.5 < LEAST(MIN((C3 - AVGC20.3) / STDDEV20.3, 2), MIN((C6 - AVGC20.6) / STDDEV20.6, 2)), (C5 - AVGC20.5) / STDDEV20.5, IIF((C6 - AVGC20.6) / STDDEV20.6 < LEAST(MIN((C4 - AVGC20.4) / STDDEV20.4, 2), MIN((C7 - AVGC20.7) / STDDEV20.7, 2)), (C6 - AVGC20.6) / STDDEV20.6, IIF((C7 - AVGC20.7) / STDDEV20.7 < LEAST(MIN((C5 - AVGC20.5) / STDDEV20.5, 2), MIN((C8 - AVGC20.8) / STDDEV20.8, 2)), (C7 - AVGC20.7) / STDDEV20.7, IIF((C8 - AVGC20.8) / STDDEV20.8 < LEAST(MIN((C6 - AVGC20.6) / STDDEV20.6, 2), MIN((C9 - AVGC20.9) / STDDEV20.9, 2)), (C8 - AVGC20.8) / STDDEV20.8, IIF((C9 - AVGC20.9) / STDDEV20.9 < LEAST(MIN((C7 - AVGC20.7) / STDDEV20.7, 2), MIN((C10 - AVGC20.10) / STDDEV20.10, 2)), (C9 - AVGC20.9) / STDDEV20.9, IIF((C10 - AVGC20.10) / STDDEV20.10 < LEAST(MIN((C8 - AVGC20.8) / STDDEV20.8, 2), MIN((C11 - AVGC20.11) / STDDEV20.11, 2)), (C10 - AVGC20.10) / STDDEV20.10, IIF((C11 - AVGC20.11) / STDDEV20.11 < LEAST(MIN((C9 - AVGC20.9) / STDDEV20.9, 2), MIN((C12 - AVGC20.12) / STDDEV20.12, 2)), (C11 - AVGC20.11) / STDDEV20.11, IIF((C12 - AVGC20.12) / STDDEV20.12 < LEAST(MIN((C10 - AVGC20.10) / STDDEV20.10, 2), MIN((C13 - AVGC20.13) / STDDEV20.13, 2)), (C12 - AVGC20.12) / STDDEV20.12, IIF((C13 - AVGC20.13) / STDDEV20.13 < LEAST(MIN((C11 - AVGC20.11) / STDDEV20.11, 2), MIN((C14 - AVGC20.14) / STDDEV20.14, 2)), (C13 - AVGC20.13) / STDDEV20.13, IIF((C14 - AVGC20.14) / STDDEV20.14 < LEAST(MIN((C12 - AVGC20.12) / STDDEV20.12, 2), MIN((C15 - AVGC20.15) / STDDEV20.15, 2)), (C14 - AVGC20.14) / STDDEV20.14, IIF((C15 - AVGC20.15) / STDDEV20.15 < LEAST(MIN((C13 - AVGC20.13) / STDDEV20.13, 2), MIN((C16 - AVGC20.16) / STDDEV20.16, 2)), (C15 - AVGC20.15) / STDDEV20.15, IIF((C16 - AVGC20.16) / STDDEV20.16 < LEAST(MIN((C14 - AVGC20.14) / STDDEV20.14, 2), MIN((C17 - AVGC20.17) / STDDEV20.17, 2)), (C16 - AVGC20.16) / STDDEV20.16, IIF((C17 - AVGC20.17) / STDDEV20.17 < LEAST(MIN((C15 - AVGC20.15) / STDDEV20.15, 2), MIN((C18 - AVGC20.18) / STDDEV20.18, 2)), (C17 - AVGC20.17) / STDDEV20.17, IIF((C18 - AVGC20.18) / STDDEV20.18 < LEAST(MIN((C16 - AVGC20.16) / STDDEV20.16, 2), MIN((C19 - AVGC20.19) / STDDEV20.19, 2)), (C18 - AVGC20.18) / STDDEV20.18, IIF((C19 - AVGC20.19) / STDDEV20.19 < LEAST(MIN((C17 - AVGC20.17) / STDDEV20.17, 2), MIN((C20 - AVGC20.20) / STDDEV20.20, 2)), (C19 - AVGC20.19) / STDDEV20.19, IIF((C20 - AVGC20.20) / STDDEV20.20 < LEAST(MIN((C18 - AVGC20.18) / STDDEV20.18, 2), MIN((C21 - AVGC20.21) / STDDEV20.21, 2)), (C20 - AVGC20.20) / STDDEV20.20, IIF((C21 - AVGC20.21) / STDDEV20.21 < LEAST(MIN((C19 - AVGC20.19) / STDDEV20.19, 2), MIN((C22 - AVGC20.22) / STDDEV20.22, 2)), (C21 - AVGC20.21) / STDDEV20.21, IIF((C22 - AVGC20.22) / STDDEV20.22 < LEAST(MIN((C20 - AVGC20.20) / STDDEV20.20, 2), MIN((C23 - AVGC20.23) / STDDEV20.23, 2)), (C22 - AVGC20.22) / STDDEV20.22, IIF((C23 - AVGC20.23) / STDDEV20.23 < LEAST(MIN((C21 - AVGC20.21) / STDDEV20.21, 2), MIN((C24 - AVGC20.24) / STDDEV20.24, 2)), (C23 - AVGC20.23) / STDDEV20.23, IIF((C24 - AVGC20.24) / STDDEV20.24 < LEAST(MIN((C22 - AVGC20.22) / STDDEV20.22, 2), MIN((C25 - AVGC20.25) / STDDEV20.25, 2)), (C24 - AVGC20.24) / STDDEV20.24, IIF((C25 - AVGC20.25) / STDDEV20.25 < LEAST(MIN((C23 - AVGC20.23) / STDDEV20.23, 2), MIN((C26 - AVGC20.26) / STDDEV20.26, 2)), (C25 - AVGC20.25) / STDDEV20.25, IIF((C26 - AVGC20.26) / STDDEV20.26 < LEAST(MIN((C24 - AVGC20.24) / STDDEV20.24, 2), MIN((C27 - AVGC20.27) / STDDEV20.27, 2)), (C26 - AVGC20.26) / STDDEV20.26, IIF((C27 - AVGC20.27) / STDDEV20.27 < LEAST(MIN((C25 - AVGC20.25) / STDDEV20.25, 2), MIN((C28 - AVGC20.28) / STDDEV20.28, 2)), (C27 - AVGC20.27) / STDDEV20.27, IIF((C28 - AVGC20.28) / STDDEV20.28 < LEAST(MIN((C26 - AVGC20.26) / STDDEV20.26, 2), MIN((C29 - AVGC20.29) / STDDEV20.29, 2)), (C28 - AVGC20.28) / STDDEV20.28, IIF((C29 - AVGC20.29) / STDDEV20.29 < LEAST(MIN((C27 - AVGC20.27) / STDDEV20.27, 2), MIN((C30 - AVGC20.30) / STDDEV20.30, 2)), (C29 - AVGC20.29) / STDDEV20.29, IIF((C30 - AVGC20.30) / STDDEV20.30 < LEAST(MIN((C28 - AVGC20.28) / STDDEV20.28, 2), MIN((C31 - AVGC20.31) / STDDEV20.31, 2)), (C30 - AVGC20.30) / STDDEV20.30, IIF((C31 - AVGC20.31) / STDDEV20.31 < LEAST(MIN((C29 - AVGC20.29) / STDDEV20.29, 2), MIN((C32 - AVGC20.32) / STDDEV20.32, 2)), (C31 - AVGC20.31) / STDDEV20.31, IIF((C32 - AVGC20.32) / STDDEV20.32 < LEAST(MIN((C30 - AVGC20.30) / STDDEV20.30, 2), MIN((C33 - AVGC20.33) / STDDEV20.33, 2)), (C32 - AVGC20.32) / STDDEV20.32, IIF((C33 - AVGC20.33) / STDDEV20.33 < LEAST(MIN((C31 - AVGC20.31) / STDDEV20.31, 2), MIN((C34 - AVGC20.34) / STDDEV20.34, 2)), (C33 - AVGC20.33) / STDDEV20.33, IIF((C34 - AVGC20.34) / STDDEV20.34 < LEAST(MIN((C32 - AVGC20.32) / STDDEV20.32, 2), MIN((C35 - AVGC20.35) / STDDEV20.35, 2)), (C34 - AVGC20.34) / STDDEV20.34, IIF((C35 - AVGC20.35) / STDDEV20.35 < LEAST(MIN((C33 - AVGC20.33) / STDDEV20.33, 2), MIN((C36 - AVGC20.36) / STDDEV20.36, 2)), (C35 - AVGC20.35) / STDDEV20.35, IIF((C36 - AVGC20.36) / STDDEV20.36 < LEAST(MIN((C34 - AVGC20.34) / STDDEV20.34, 2), MIN((C37 - AVGC20.37) / STDDEV20.37, 2)), (C36 - AVGC20.36) / STDDEV20.36, IIF((C37 - AVGC20.37) / STDDEV20.37 < LEAST(MIN((C35 - AVGC20.35) / STDDEV20.35, 2), MIN((C38 - AVGC20.38) / STDDEV20.38, 2)), (C37 - AVGC20.37) / STDDEV20.37, IIF((C38 - AVGC20.38) / STDDEV20.38 < LEAST(MIN((C36 - AVGC20.36) / STDDEV20.36, 2), MIN((C39 - AVGC20.39) / STDDEV20.39, 2)), (C38 - AVGC20.38) / STDDEV20.38, IIF((C39 - AVGC20.39) / STDDEV20.39 < LEAST(MIN((C37 - AVGC20.37) / STDDEV20.37, 2), MIN((C40 - AVGC20.40) / STDDEV20.40, 2)), (C39 - AVGC20.39) / STDDEV20.39, (C2 - AVGC20.2) / STDDEV20.2 - 1))))))))))))))))))))))))))))))))))), (C2 - AVGC20.2) / 4 / STDDEV20.2 + .5, 1 / 0)
The same is true of converting the higher high to a higher low.
IIF((C2 - AVGC20.2) / STDDEV20.2 < LEAST(MIN((C0 - AVGC20.0) / STDDEV20.0, 2), MIN((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 > IIF((C5 - AVGC20.5) / STDDEV20.5 < LEAST(MIN((C3 - AVGC20.3) / STDDEV20.3, 2), MIN((C6 - AVGC20.6) / STDDEV20.6, 2)), (C5 - AVGC20.5) / STDDEV20.5, IIF((C6 - AVGC20.6) / STDDEV20.6 < LEAST(MIN((C4 - AVGC20.4) / STDDEV20.4, 2), MIN((C7 - AVGC20.7) / STDDEV20.7, 2)), (C6 - AVGC20.6) / STDDEV20.6, IIF((C7 - AVGC20.7) / STDDEV20.7 < LEAST(MIN((C5 - AVGC20.5) / STDDEV20.5, 2), MIN((C8 - AVGC20.8) / STDDEV20.8, 2)), (C7 - AVGC20.7) / STDDEV20.7, IIF((C8 - AVGC20.8) / STDDEV20.8 < LEAST(MIN((C6 - AVGC20.6) / STDDEV20.6, 2), MIN((C9 - AVGC20.9) / STDDEV20.9, 2)), (C8 - AVGC20.8) / STDDEV20.8, IIF((C9 - AVGC20.9) / STDDEV20.9 < LEAST(MIN((C7 - AVGC20.7) / STDDEV20.7, 2), MIN((C10 - AVGC20.10) / STDDEV20.10, 2)), (C9 - AVGC20.9) / STDDEV20.9, IIF((C10 - AVGC20.10) / STDDEV20.10 < LEAST(MIN((C8 - AVGC20.8) / STDDEV20.8, 2), MIN((C11 - AVGC20.11) / STDDEV20.11, 2)), (C10 - AVGC20.10) / STDDEV20.10, IIF((C11 - AVGC20.11) / STDDEV20.11 < LEAST(MIN((C9 - AVGC20.9) / STDDEV20.9, 2), MIN((C12 - AVGC20.12) / STDDEV20.12, 2)), (C11 - AVGC20.11) / STDDEV20.11, IIF((C12 - AVGC20.12) / STDDEV20.12 < LEAST(MIN((C10 - AVGC20.10) / STDDEV20.10, 2), MIN((C13 - AVGC20.13) / STDDEV20.13, 2)), (C12 - AVGC20.12) / STDDEV20.12, IIF((C13 - AVGC20.13) / STDDEV20.13 < LEAST(MIN((C11 - AVGC20.11) / STDDEV20.11, 2), MIN((C14 - AVGC20.14) / STDDEV20.14, 2)), (C13 - AVGC20.13) / STDDEV20.13, IIF((C14 - AVGC20.14) / STDDEV20.14 < LEAST(MIN((C12 - AVGC20.12) / STDDEV20.12, 2), MIN((C15 - AVGC20.15) / STDDEV20.15, 2)), (C14 - AVGC20.14) / STDDEV20.14, IIF((C15 - AVGC20.15) / STDDEV20.15 < LEAST(MIN((C13 - AVGC20.13) / STDDEV20.13, 2), MIN((C16 - AVGC20.16) / STDDEV20.16, 2)), (C15 - AVGC20.15) / STDDEV20.15, IIF((C16 - AVGC20.16) / STDDEV20.16 < LEAST(MIN((C14 - AVGC20.14) / STDDEV20.14, 2), MIN((C17 - AVGC20.17) / STDDEV20.17, 2)), (C16 - AVGC20.16) / STDDEV20.16, IIF((C17 - AVGC20.17) / STDDEV20.17 < LEAST(MIN((C15 - AVGC20.15) / STDDEV20.15, 2), MIN((C18 - AVGC20.18) / STDDEV20.18, 2)), (C17 - AVGC20.17) / STDDEV20.17, IIF((C18 - AVGC20.18) / STDDEV20.18 < LEAST(MIN((C16 - AVGC20.16) / STDDEV20.16, 2), MIN((C19 - AVGC20.19) / STDDEV20.19, 2)), (C18 - AVGC20.18) / STDDEV20.18, IIF((C19 - AVGC20.19) / STDDEV20.19 < LEAST(MIN((C17 - AVGC20.17) / STDDEV20.17, 2), MIN((C20 - AVGC20.20) / STDDEV20.20, 2)), (C19 - AVGC20.19) / STDDEV20.19, IIF((C20 - AVGC20.20) / STDDEV20.20 < LEAST(MIN((C18 - AVGC20.18) / STDDEV20.18, 2), MIN((C21 - AVGC20.21) / STDDEV20.21, 2)), (C20 - AVGC20.20) / STDDEV20.20, IIF((C21 - AVGC20.21) / STDDEV20.21 < LEAST(MIN((C19 - AVGC20.19) / STDDEV20.19, 2), MIN((C22 - AVGC20.22) / STDDEV20.22, 2)), (C21 - AVGC20.21) / STDDEV20.21, IIF((C22 - AVGC20.22) / STDDEV20.22 < LEAST(MIN((C20 - AVGC20.20) / STDDEV20.20, 2), MIN((C23 - AVGC20.23) / STDDEV20.23, 2)), (C22 - AVGC20.22) / STDDEV20.22, IIF((C23 - AVGC20.23) / STDDEV20.23 < LEAST(MIN((C21 - AVGC20.21) / STDDEV20.21, 2), MIN((C24 - AVGC20.24) / STDDEV20.24, 2)), (C23 - AVGC20.23) / STDDEV20.23, IIF((C24 - AVGC20.24) / STDDEV20.24 < LEAST(MIN((C22 - AVGC20.22) / STDDEV20.22, 2), MIN((C25 - AVGC20.25) / STDDEV20.25, 2)), (C24 - AVGC20.24) / STDDEV20.24, IIF((C25 - AVGC20.25) / STDDEV20.25 < LEAST(MIN((C23 - AVGC20.23) / STDDEV20.23, 2), MIN((C26 - AVGC20.26) / STDDEV20.26, 2)), (C25 - AVGC20.25) / STDDEV20.25, IIF((C26 - AVGC20.26) / STDDEV20.26 < LEAST(MIN((C24 - AVGC20.24) / STDDEV20.24, 2), MIN((C27 - AVGC20.27) / STDDEV20.27, 2)), (C26 - AVGC20.26) / STDDEV20.26, IIF((C27 - AVGC20.27) / STDDEV20.27 < LEAST(MIN((C25 - AVGC20.25) / STDDEV20.25, 2), MIN((C28 - AVGC20.28) / STDDEV20.28, 2)), (C27 - AVGC20.27) / STDDEV20.27, IIF((C28 - AVGC20.28) / STDDEV20.28 < LEAST(MIN((C26 - AVGC20.26) / STDDEV20.26, 2), MIN((C29 - AVGC20.29) / STDDEV20.29, 2)), (C28 - AVGC20.28) / STDDEV20.28, IIF((C29 - AVGC20.29) / STDDEV20.29 < LEAST(MIN((C27 - AVGC20.27) / STDDEV20.27, 2), MIN((C30 - AVGC20.30) / STDDEV20.30, 2)), (C29 - AVGC20.29) / STDDEV20.29, IIF((C30 - AVGC20.30) / STDDEV20.30 < LEAST(MIN((C28 - AVGC20.28) / STDDEV20.28, 2), MIN((C31 - AVGC20.31) / STDDEV20.31, 2)), (C30 - AVGC20.30) / STDDEV20.30, IIF((C31 - AVGC20.31) / STDDEV20.31 < LEAST(MIN((C29 - AVGC20.29) / STDDEV20.29, 2), MIN((C32 - AVGC20.32) / STDDEV20.32, 2)), (C31 - AVGC20.31) / STDDEV20.31, IIF((C32 - AVGC20.32) / STDDEV20.32 < LEAST(MIN((C30 - AVGC20.30) / STDDEV20.30, 2), MIN((C33 - AVGC20.33) / STDDEV20.33, 2)), (C32 - AVGC20.32) / STDDEV20.32, IIF((C33 - AVGC20.33) / STDDEV20.33 < LEAST(MIN((C31 - AVGC20.31) / STDDEV20.31, 2), MIN((C34 - AVGC20.34) / STDDEV20.34, 2)), (C33 - AVGC20.33) / STDDEV20.33, IIF((C34 - AVGC20.34) / STDDEV20.34 < LEAST(MIN((C32 - AVGC20.32) / STDDEV20.32, 2), MIN((C35 - AVGC20.35) / STDDEV20.35, 2)), (C34 - AVGC20.34) / STDDEV20.34, IIF((C35 - AVGC20.35) / STDDEV20.35 < LEAST(MIN((C33 - AVGC20.33) / STDDEV20.33, 2), MIN((C36 - AVGC20.36) / STDDEV20.36, 2)), (C35 - AVGC20.35) / STDDEV20.35, IIF((C36 - AVGC20.36) / STDDEV20.36 < LEAST(MIN((C34 - AVGC20.34) / STDDEV20.34, 2), MIN((C37 - AVGC20.37) / STDDEV20.37, 2)), (C36 - AVGC20.36) / STDDEV20.36, IIF((C37 - AVGC20.37) / STDDEV20.37 < LEAST(MIN((C35 - AVGC20.35) / STDDEV20.35, 2), MIN((C38 - AVGC20.38) / STDDEV20.38, 2)), (C37 - AVGC20.37) / STDDEV20.37, IIF((C38 - AVGC20.38) / STDDEV20.38 < LEAST(MIN((C36 - AVGC20.36) / STDDEV20.36, 2), MIN((C39 - AVGC20.39) / STDDEV20.39, 2)), (C38 - AVGC20.38) / STDDEV20.38, IIF((C39 - AVGC20.39) / STDDEV20.39 < LEAST(MIN((C37 - AVGC20.37) / STDDEV20.37, 2), MIN((C40 - AVGC20.40) / STDDEV20.40, 2)), (C39 - AVGC20.39) / STDDEV20.39, (C2 - AVGC20.2) / STDDEV20.2 + 1))))))))))))))))))))))))))))))))))), (C2 - AVGC20.2) / 4 / STDDEV20.2 + .5, 1 / 0)
Hi Bruce
Okay the pcf's are plotting correct but dots are not Snapping on %B line even after offsetting as -2 so is there anything else needs to be adjusted ??
And second question now that we have 4 different PCF so can the fibonacci ratio is possible as output in pcf to find where in ratio terms current %BB is "when a Fib retracement drawn from LOWER LOW to HIGHER HIGH when HH was most recent "
And vice versa where is current %B in ratio "when fib retracment drawn from HH to LL when LL is most recent"
See the 1 / 0 at the end? That is so dots don't get plotted when it isn't true. Changing that to a numeric value should do the trick, but I don't know what you want to change it to. Zero maybe?
Nope, still can't do that for all the same reasons as previously with price.
Ok Bruce so you saying that snapping isn't possible correct ? but my second question getting fib ratio as output possible ?
Quite the opposite. I provided a solution where you could replace the 1 / 0 with say 0 (or some number) in order to offset the plot. You will just end up with a line of dots at whatever value you choose.
There isn't a way to calculate the fib ratio from the LL to HH when the HH was most recent, because there is no way to determine the most recent past value of the LL in the formula. The same is true when going from HH to LL instead.
Okay got it Bruce i replaced with -0.5 at the end so %B will rarely reach there
and then for lower line bottom dots i plot Custom pcf again and scale with %B, change the "c" to -0.5 plot style as dots and colour as black as my chart background so that works and hides all lower line dots :)
thanks again for your help
Sounds like a great solution.
hi Bruce here i am attaching links to show you few divergence trades with price and bollinger %B
Can you please compute PCF to show a dot next to pricelow when the condition met is true
Please see links below
https://www.dhirenshah.com/higher-high-in-price-and-lower-high-in-b-bearish-reversal-divergence/
https://www.dhirenshah.com/lower-high-in-price-and-higher-high-in-b-bearish-continuation-hidden/
https://www.dhirenshah.com/higher-low-in-price-and-lower-low-in-b-bullish-continuation-divergence/
https://www.dhirenshah.com/lower-low-in-price-and-higher-low-in-b-bullish-reversal/
Pleaes try the following for a lower high in Bollinger %B and a higher high in price.
IIF((C2 - AVGC20.2) / STDDEV20.2 > GREATEST(MAX((C - AVGC20) / STDDEV20, 2), MAX((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 < IIF((C5 - AVGC20.5) / STDDEV20.5 > GREATEST(MAX((C3 - AVGC20.3) / STDDEV20.3, 2), MAX((C6 - AVGC20.6) / STDDEV20.6, 2)), IIF(H2 > H5, (C5 - AVGC20.5) / STDDEV20.5, 1 / 0), IIF((C6 - AVGC20.6) / STDDEV20.6 > GREATEST(MAX((C4 - AVGC20.4) / STDDEV20.4, 2), MAX((C7 - AVGC20.7) / STDDEV20.7, 2)), IIF(H2 > H6, (C6 - AVGC20.6) / STDDEV20.6, 1 / 0), IIF((C7 - AVGC20.7) / STDDEV20.7 > GREATEST(MAX((C5 - AVGC20.5) / STDDEV20.5, 2), MAX((C8 - AVGC20.8) / STDDEV20.8, 2)), IIF(H2 > H7, (C7 - AVGC20.7) / STDDEV20.7, 1 / 0), IIF((C8 - AVGC20.8) / STDDEV20.8 > GREATEST(MAX((C6 - AVGC20.6) / STDDEV20.6, 2), MAX((C9 - AVGC20.9) / STDDEV20.9, 2)), IIF(H2 > H8, (C8 - AVGC20.8) / STDDEV20.8, 1 / 0), IIF((C9 - AVGC20.9) / STDDEV20.9 > GREATEST(MAX((C7 - AVGC20.7) / STDDEV20.7, 2), MAX((C10 - AVGC20.10) / STDDEV20.10, 2)), IIF(H2 > H9, (C9 - AVGC20.9) / STDDEV20.9, 1 / 0), IIF((C10 - AVGC20.10) / STDDEV20.10 > GREATEST(MAX((C8 - AVGC20.8) / STDDEV20.8, 2), MAX((C11 - AVGC20.11) / STDDEV20.11, 2)), IIF(H2 > H10, (C10 - AVGC20.10) / STDDEV20.10, 1 / 0), IIF((C11 - AVGC20.11) / STDDEV20.11 > GREATEST(MAX((C9 - AVGC20.9) / STDDEV20.9, 2), MAX((C12 - AVGC20.12) / STDDEV20.12, 2)), IIF(H2 > H11, (C11 - AVGC20.11) / STDDEV20.11, 1 / 0), IIF((C12 - AVGC20.12) / STDDEV20.12 > GREATEST(MAX((C10 - AVGC20.10) / STDDEV20.10, 2), MAX((C13 - AVGC20.13) / STDDEV20.13, 2)), IIF(H2 > H12, (C12 - AVGC20.12) / STDDEV20.12, 1 / 0), IIF((C13 - AVGC20.13) / STDDEV20.13 > GREATEST(MAX((C11 - AVGC20.11) / STDDEV20.11, 2), MAX((C14 - AVGC20.14) / STDDEV20.14, 2)), IIF(H2 > H13, (C13 - AVGC20.13) / STDDEV20.13, 1 / 0), IIF((C14 - AVGC20.14) / STDDEV20.14 > GREATEST(MAX((C12 - AVGC20.12) / STDDEV20.12, 2), MAX((C15 - AVGC20.15) / STDDEV20.15, 2)), IIF(H2 > H14, (C14 - AVGC20.14) / STDDEV20.14, 1 / 0), IIF((C15 - AVGC20.15) / STDDEV20.15 > GREATEST(MAX((C13 - AVGC20.13) / STDDEV20.13, 2), MAX((C16 - AVGC20.16) / STDDEV20.16, 2)), IIF(H2 > H15, (C15 - AVGC20.15) / STDDEV20.15, 1 / 0), IIF((C16 - AVGC20.16) / STDDEV20.16 > GREATEST(MAX((C14 - AVGC20.14) / STDDEV20.14, 2), MAX((C17 - AVGC20.17) / STDDEV20.17, 2)), IIF(H2 > H16, (C16 - AVGC20.16) / STDDEV20.16, 1 / 0), IIF((C17 - AVGC20.17) / STDDEV20.17 > GREATEST(MAX((C15 - AVGC20.15) / STDDEV20.15, 2), MAX((C18 - AVGC20.18) / STDDEV20.18, 2)), IIF(H2 > H17, (C17 - AVGC20.17) / STDDEV20.17, 1 / 0), IIF((C18 - AVGC20.18) / STDDEV20.18 > GREATEST(MAX((C16 - AVGC20.16) / STDDEV20.16, 2), MAX((C19 - AVGC20.19) / STDDEV20.19, 2)), IIF(H2 > H18, (C18 - AVGC20.18) / STDDEV20.18, 1 / 0), IIF((C19 - AVGC20.19) / STDDEV20.19 > GREATEST(MAX((C17 - AVGC20.17) / STDDEV20.17, 2), MAX((C20 - AVGC20.20) / STDDEV20.20, 2)), IIF(H2 > H19, (C19 - AVGC20.19) / STDDEV20.19, 1 / 0), IIF((C20 - AVGC20.20) / STDDEV20.20 > GREATEST(MAX((C18 - AVGC20.18) / STDDEV20.18, 2), MAX((C21 - AVGC20.21) / STDDEV20.21, 2)), IIF(H2 > H20, (C20 - AVGC20.20) / STDDEV20.20, 1 / 0), IIF((C21 - AVGC20.21) / STDDEV20.21 > GREATEST(MAX((C19 - AVGC20.19) / STDDEV20.19, 2), MAX((C22 - AVGC20.22) / STDDEV20.22, 2)), IIF(H2 > H21, (C21 - AVGC20.21) / STDDEV20.21, 1 / 0), IIF((C22 - AVGC20.22) / STDDEV20.22 > GREATEST(MAX((C20 - AVGC20.20) / STDDEV20.20, 2), MAX((C23 - AVGC20.23) / STDDEV20.23, 2)), IIF(H2 > H22, (C22 - AVGC20.22) / STDDEV20.22, 1 / 0), IIF((C23 - AVGC20.23) / STDDEV20.23 > GREATEST(MAX((C21 - AVGC20.21) / STDDEV20.21, 2), MAX((C24 - AVGC20.24) / STDDEV20.24, 2)), IIF(H2 > H23, (C23 - AVGC20.23) / STDDEV20.23, 1 / 0), IIF((C24 - AVGC20.24) / STDDEV20.24 > GREATEST(MAX((C22 - AVGC20.22) / STDDEV20.22, 2), MAX((C25 - AVGC20.25) / STDDEV20.25, 2)), IIF(H2 > H24, (C24 - AVGC20.24) / STDDEV20.24, 1 / 0), IIF((C25 - AVGC20.25) / STDDEV20.25 > GREATEST(MAX((C23 - AVGC20.23) / STDDEV20.23, 2), MAX((C26 - AVGC20.26) / STDDEV20.26, 2)), IIF(H2 > H25, (C25 - AVGC20.25) / STDDEV20.25, 1 / 0), IIF((C26 - AVGC20.26) / STDDEV20.26 > GREATEST(MAX((C24 - AVGC20.24) / STDDEV20.24, 2), MAX((C27 - AVGC20.27) / STDDEV20.27, 2)), IIF(H2 > H26, (C26 - AVGC20.26) / STDDEV20.26, 1 / 0), IIF((C27 - AVGC20.27) / STDDEV20.27 > GREATEST(MAX((C25 - AVGC20.25) / STDDEV20.25, 2), MAX((C28 - AVGC20.28) / STDDEV20.28, 2)), IIF(H2 > H27, (C27 - AVGC20.27) / STDDEV20.27, 1 / 0), IIF((C28 - AVGC20.28) / STDDEV20.28 > GREATEST(MAX((C26 - AVGC20.26) / STDDEV20.26, 2), MAX((C29 - AVGC20.29) / STDDEV20.29, 2)), IIF(H2 > H28, (C28 - AVGC20.28) / STDDEV20.28, 1 / 0), IIF((C29 - AVGC20.29) / STDDEV20.29 > GREATEST(MAX((C27 - AVGC20.27) / STDDEV20.27, 2), MAX((C30 - AVGC20.30) / STDDEV20.30, 2)), IIF(H2 > H29, (C29 - AVGC20.29) / STDDEV20.29, 1 / 0), IIF((C30 - AVGC20.30) / STDDEV20.30 > GREATEST(MAX((C28 - AVGC20.28) / STDDEV20.28, 2), MAX((C31 - AVGC20.31) / STDDEV20.31, 2)), IIF(H2 > H30, (C30 - AVGC20.30) / STDDEV20.30, 1 / 0), IIF((C31 - AVGC20.31) / STDDEV20.31 > GREATEST(MAX((C29 - AVGC20.29) / STDDEV20.29, 2), MAX((C32 - AVGC20.32) / STDDEV20.32, 2)), IIF(H2 > H31, (C31 - AVGC20.31) / STDDEV20.31, 1 / 0), IIF((C32 - AVGC20.32) / STDDEV20.32 > GREATEST(MAX((C30 - AVGC20.30) / STDDEV20.30, 2), MAX((C33 - AVGC20.33) / STDDEV20.33, 2)), IIF(H2 > H32, (C32 - AVGC20.32) / STDDEV20.32, 1 / 0), IIF((C33 - AVGC20.33) / STDDEV20.33 > GREATEST(MAX((C31 - AVGC20.31) / STDDEV20.31, 2), MAX((C34 - AVGC20.34) / STDDEV20.34, 2)), IIF(H2 > H33, (C33 - AVGC20.33) / STDDEV20.33, 1 / 0), IIF((C34 - AVGC20.34) / STDDEV20.34 > GREATEST(MAX((C32 - AVGC20.32) / STDDEV20.32, 2), MAX((C35 - AVGC20.35) / STDDEV20.35, 2)), IIF(H2 > H34, (C34 - AVGC20.34) / STDDEV20.34, 1 / 0), IIF((C35 - AVGC20.35) / STDDEV20.35 > GREATEST(MAX((C33 - AVGC20.33) / STDDEV20.33, 2), MAX((C36 - AVGC20.36) / STDDEV20.36, 2)), IIF(H2 > H35, (C35 - AVGC20.35) / STDDEV20.35, 1 / 0), IIF((C36 - AVGC20.36) / STDDEV20.36 > GREATEST(MAX((C34 - AVGC20.34) / STDDEV20.34, 2), MAX((C37 - AVGC20.37) / STDDEV20.37, 2)), IIF(H2 > H36, (C36 - AVGC20.36) / STDDEV20.36, 1 / 0), IIF((C37 - AVGC20.37) / STDDEV20.37 > GREATEST(MAX((C35 - AVGC20.35) / STDDEV20.35, 2), MAX((C38 - AVGC20.38) / STDDEV20.38, 2)), IIF(H2 > H37, (C37 - AVGC20.37) / STDDEV20.37, 1 / 0), IIF((C38 - AVGC20.38) / STDDEV20.38 > GREATEST(MAX((C36 - AVGC20.36) / STDDEV20.36, 2), MAX((C39 - AVGC20.39) / STDDEV20.39, 2)), IIF(H2 > H38, (C38 - AVGC20.38) / STDDEV20.38, 1 / 0), IIF((C39 - AVGC20.39) / STDDEV20.39 > GREATEST(MAX((C37 - AVGC20.37) / STDDEV20.37, 2), MAX((C40 - AVGC20.40) / STDDEV20.40, 2)), IIF(H2 > H39, (C39 - AVGC20.39) / STDDEV20.39, 1 / 0), 1 / 0))))))))))))))))))))))))))))))))))), H2, 1 / 0)
Please try the following for a higher high in Bollinger %B and a lower high in price.
IIF((C2 - AVGC20.2) / STDDEV20.2 > GREATEST(MAX((C - AVGC20) / STDDEV20, 2), MAX((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 > IIF((C5 - AVGC20.5) / STDDEV20.5 > GREATEST(MAX((C3 - AVGC20.3) / STDDEV20.3, 2), MAX((C6 - AVGC20.6) / STDDEV20.6, 2)), IIF(H2 < H5, (C5 - AVGC20.5) / STDDEV20.5, 1 / 0), IIF((C6 - AVGC20.6) / STDDEV20.6 > GREATEST(MAX((C4 - AVGC20.4) / STDDEV20.4, 2), MAX((C7 - AVGC20.7) / STDDEV20.7, 2)), IIF(H2 < H6, (C6 - AVGC20.6) / STDDEV20.6, 1 / 0), IIF((C7 - AVGC20.7) / STDDEV20.7 > GREATEST(MAX((C5 - AVGC20.5) / STDDEV20.5, 2), MAX((C8 - AVGC20.8) / STDDEV20.8, 2)), IIF(H2 < H7, (C7 - AVGC20.7) / STDDEV20.7, 1 / 0), IIF((C8 - AVGC20.8) / STDDEV20.8 > GREATEST(MAX((C6 - AVGC20.6) / STDDEV20.6, 2), MAX((C9 - AVGC20.9) / STDDEV20.9, 2)), IIF(H2 < H8, (C8 - AVGC20.8) / STDDEV20.8, 1 / 0), IIF((C9 - AVGC20.9) / STDDEV20.9 > GREATEST(MAX((C7 - AVGC20.7) / STDDEV20.7, 2), MAX((C10 - AVGC20.10) / STDDEV20.10, 2)), IIF(H2 < H9, (C9 - AVGC20.9) / STDDEV20.9, 1 / 0), IIF((C10 - AVGC20.10) / STDDEV20.10 > GREATEST(MAX((C8 - AVGC20.8) / STDDEV20.8, 2), MAX((C11 - AVGC20.11) / STDDEV20.11, 2)), IIF(H2 < H10, (C10 - AVGC20.10) / STDDEV20.10, 1 / 0), IIF((C11 - AVGC20.11) / STDDEV20.11 > GREATEST(MAX((C9 - AVGC20.9) / STDDEV20.9, 2), MAX((C12 - AVGC20.12) / STDDEV20.12, 2)), IIF(H2 < H11, (C11 - AVGC20.11) / STDDEV20.11, 1 / 0), IIF((C12 - AVGC20.12) / STDDEV20.12 > GREATEST(MAX((C10 - AVGC20.10) / STDDEV20.10, 2), MAX((C13 - AVGC20.13) / STDDEV20.13, 2)), IIF(H2 < H12, (C12 - AVGC20.12) / STDDEV20.12, 1 / 0), IIF((C13 - AVGC20.13) / STDDEV20.13 > GREATEST(MAX((C11 - AVGC20.11) / STDDEV20.11, 2), MAX((C14 - AVGC20.14) / STDDEV20.14, 2)), IIF(H2 < H13, (C13 - AVGC20.13) / STDDEV20.13, 1 / 0), IIF((C14 - AVGC20.14) / STDDEV20.14 > GREATEST(MAX((C12 - AVGC20.12) / STDDEV20.12, 2), MAX((C15 - AVGC20.15) / STDDEV20.15, 2)), IIF(H2 < H14, (C14 - AVGC20.14) / STDDEV20.14, 1 / 0), IIF((C15 - AVGC20.15) / STDDEV20.15 > GREATEST(MAX((C13 - AVGC20.13) / STDDEV20.13, 2), MAX((C16 - AVGC20.16) / STDDEV20.16, 2)), IIF(H2 < H15, (C15 - AVGC20.15) / STDDEV20.15, 1 / 0), IIF((C16 - AVGC20.16) / STDDEV20.16 > GREATEST(MAX((C14 - AVGC20.14) / STDDEV20.14, 2), MAX((C17 - AVGC20.17) / STDDEV20.17, 2)), IIF(H2 < H16, (C16 - AVGC20.16) / STDDEV20.16, 1 / 0), IIF((C17 - AVGC20.17) / STDDEV20.17 > GREATEST(MAX((C15 - AVGC20.15) / STDDEV20.15, 2), MAX((C18 - AVGC20.18) / STDDEV20.18, 2)), IIF(H2 < H17, (C17 - AVGC20.17) / STDDEV20.17, 1 / 0), IIF((C18 - AVGC20.18) / STDDEV20.18 > GREATEST(MAX((C16 - AVGC20.16) / STDDEV20.16, 2), MAX((C19 - AVGC20.19) / STDDEV20.19, 2)), IIF(H2 < H18, (C18 - AVGC20.18) / STDDEV20.18, 1 / 0), IIF((C19 - AVGC20.19) / STDDEV20.19 > GREATEST(MAX((C17 - AVGC20.17) / STDDEV20.17, 2), MAX((C20 - AVGC20.20) / STDDEV20.20, 2)), IIF(H2 < H19, (C19 - AVGC20.19) / STDDEV20.19, 1 / 0), IIF((C20 - AVGC20.20) / STDDEV20.20 > GREATEST(MAX((C18 - AVGC20.18) / STDDEV20.18, 2), MAX((C21 - AVGC20.21) / STDDEV20.21, 2)), IIF(H2 < H20, (C20 - AVGC20.20) / STDDEV20.20, 1 / 0), IIF((C21 - AVGC20.21) / STDDEV20.21 > GREATEST(MAX((C19 - AVGC20.19) / STDDEV20.19, 2), MAX((C22 - AVGC20.22) / STDDEV20.22, 2)), IIF(H2 < H21, (C21 - AVGC20.21) / STDDEV20.21, 1 / 0), IIF((C22 - AVGC20.22) / STDDEV20.22 > GREATEST(MAX((C20 - AVGC20.20) / STDDEV20.20, 2), MAX((C23 - AVGC20.23) / STDDEV20.23, 2)), IIF(H2 < H22, (C22 - AVGC20.22) / STDDEV20.22, 1 / 0), IIF((C23 - AVGC20.23) / STDDEV20.23 > GREATEST(MAX((C21 - AVGC20.21) / STDDEV20.21, 2), MAX((C24 - AVGC20.24) / STDDEV20.24, 2)), IIF(H2 < H23, (C23 - AVGC20.23) / STDDEV20.23, 1 / 0), IIF((C24 - AVGC20.24) / STDDEV20.24 > GREATEST(MAX((C22 - AVGC20.22) / STDDEV20.22, 2), MAX((C25 - AVGC20.25) / STDDEV20.25, 2)), IIF(H2 < H24, (C24 - AVGC20.24) / STDDEV20.24, 1 / 0), IIF((C25 - AVGC20.25) / STDDEV20.25 > GREATEST(MAX((C23 - AVGC20.23) / STDDEV20.23, 2), MAX((C26 - AVGC20.26) / STDDEV20.26, 2)), IIF(H2 < H25, (C25 - AVGC20.25) / STDDEV20.25, 1 / 0), IIF((C26 - AVGC20.26) / STDDEV20.26 > GREATEST(MAX((C24 - AVGC20.24) / STDDEV20.24, 2), MAX((C27 - AVGC20.27) / STDDEV20.27, 2)), IIF(H2 < H26, (C26 - AVGC20.26) / STDDEV20.26, 1 / 0), IIF((C27 - AVGC20.27) / STDDEV20.27 > GREATEST(MAX((C25 - AVGC20.25) / STDDEV20.25, 2), MAX((C28 - AVGC20.28) / STDDEV20.28, 2)), IIF(H2 < H27, (C27 - AVGC20.27) / STDDEV20.27, 1 / 0), IIF((C28 - AVGC20.28) / STDDEV20.28 > GREATEST(MAX((C26 - AVGC20.26) / STDDEV20.26, 2), MAX((C29 - AVGC20.29) / STDDEV20.29, 2)), IIF(H2 < H28, (C28 - AVGC20.28) / STDDEV20.28, 1 / 0), IIF((C29 - AVGC20.29) / STDDEV20.29 > GREATEST(MAX((C27 - AVGC20.27) / STDDEV20.27, 2), MAX((C30 - AVGC20.30) / STDDEV20.30, 2)), IIF(H2 < H29, (C29 - AVGC20.29) / STDDEV20.29, 1 / 0), IIF((C30 - AVGC20.30) / STDDEV20.30 > GREATEST(MAX((C28 - AVGC20.28) / STDDEV20.28, 2), MAX((C31 - AVGC20.31) / STDDEV20.31, 2)), IIF(H2 < H30, (C30 - AVGC20.30) / STDDEV20.30, 1 / 0), IIF((C31 - AVGC20.31) / STDDEV20.31 > GREATEST(MAX((C29 - AVGC20.29) / STDDEV20.29, 2), MAX((C32 - AVGC20.32) / STDDEV20.32, 2)), IIF(H2 < H31, (C31 - AVGC20.31) / STDDEV20.31, 1 / 0), IIF((C32 - AVGC20.32) / STDDEV20.32 > GREATEST(MAX((C30 - AVGC20.30) / STDDEV20.30, 2), MAX((C33 - AVGC20.33) / STDDEV20.33, 2)), IIF(H2 < H32, (C32 - AVGC20.32) / STDDEV20.32, 1 / 0), IIF((C33 - AVGC20.33) / STDDEV20.33 > GREATEST(MAX((C31 - AVGC20.31) / STDDEV20.31, 2), MAX((C34 - AVGC20.34) / STDDEV20.34, 2)), IIF(H2 < H33, (C33 - AVGC20.33) / STDDEV20.33, 1 / 0), IIF((C34 - AVGC20.34) / STDDEV20.34 > GREATEST(MAX((C32 - AVGC20.32) / STDDEV20.32, 2), MAX((C35 - AVGC20.35) / STDDEV20.35, 2)), IIF(H2 < H34, (C34 - AVGC20.34) / STDDEV20.34, 1 / 0), IIF((C35 - AVGC20.35) / STDDEV20.35 > GREATEST(MAX((C33 - AVGC20.33) / STDDEV20.33, 2), MAX((C36 - AVGC20.36) / STDDEV20.36, 2)), IIF(H2 < H35, (C35 - AVGC20.35) / STDDEV20.35, 1 / 0), IIF((C36 - AVGC20.36) / STDDEV20.36 > GREATEST(MAX((C34 - AVGC20.34) / STDDEV20.34, 2), MAX((C37 - AVGC20.37) / STDDEV20.37, 2)), IIF(H2 < H36, (C36 - AVGC20.36) / STDDEV20.36, 1 / 0), IIF((C37 - AVGC20.37) / STDDEV20.37 > GREATEST(MAX((C35 - AVGC20.35) / STDDEV20.35, 2), MAX((C38 - AVGC20.38) / STDDEV20.38, 2)), IIF(H2 < H37, (C37 - AVGC20.37) / STDDEV20.37, 1 / 0), IIF((C38 - AVGC20.38) / STDDEV20.38 > GREATEST(MAX((C36 - AVGC20.36) / STDDEV20.36, 2), MAX((C39 - AVGC20.39) / STDDEV20.39, 2)), IIF(H2 < H38, (C38 - AVGC20.38) / STDDEV20.38, 1 / 0), IIF((C39 - AVGC20.39) / STDDEV20.39 > GREATEST(MAX((C37 - AVGC20.37) / STDDEV20.37, 2), MAX((C40 - AVGC20.40) / STDDEV20.40, 2)), IIF(H2 < H39, (C39 - AVGC20.39) / STDDEV20.39, 1 / 0), 1 / 0))))))))))))))))))))))))))))))))))), H2, 1 / 0)
Please try the following for a lower low in Bollinger %B and a higher low in price.
IIF((C2 - AVGC20.2) / STDDEV20.2 < LEAST(MIN((C - AVGC20) / STDDEV20, 2), MIN((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 < IIF((C5 - AVGC20.5) / STDDEV20.5 < LEAST(MIN((C3 - AVGC20.3) / STDDEV20.3, 2), MIN((C6 - AVGC20.6) / STDDEV20.6, 2)), IIF(L2 > L5, (C5 - AVGC20.5) / STDDEV20.5, 1 / 0), IIF((C6 - AVGC20.6) / STDDEV20.6 < LEAST(MIN((C4 - AVGC20.4) / STDDEV20.4, 2), MIN((C7 - AVGC20.7) / STDDEV20.7, 2)), IIF(L2 > L6, (C6 - AVGC20.6) / STDDEV20.6, 1 / 0), IIF((C7 - AVGC20.7) / STDDEV20.7 < LEAST(MIN((C5 - AVGC20.5) / STDDEV20.5, 2), MIN((C8 - AVGC20.8) / STDDEV20.8, 2)), IIF(L2 > L7, (C7 - AVGC20.7) / STDDEV20.7, 1 / 0), IIF((C8 - AVGC20.8) / STDDEV20.8 < LEAST(MIN((C6 - AVGC20.6) / STDDEV20.6, 2), MIN((C9 - AVGC20.9) / STDDEV20.9, 2)), IIF(L2 > L8, (C8 - AVGC20.8) / STDDEV20.8, 1 / 0), IIF((C9 - AVGC20.9) / STDDEV20.9 < LEAST(MIN((C7 - AVGC20.7) / STDDEV20.7, 2), MIN((C10 - AVGC20.10) / STDDEV20.10, 2)), IIF(L2 > L9, (C9 - AVGC20.9) / STDDEV20.9, 1 / 0), IIF((C10 - AVGC20.10) / STDDEV20.10 < LEAST(MIN((C8 - AVGC20.8) / STDDEV20.8, 2), MIN((C11 - AVGC20.11) / STDDEV20.11, 2)), IIF(L2 > L10, (C10 - AVGC20.10) / STDDEV20.10, 1 / 0), IIF((C11 - AVGC20.11) / STDDEV20.11 < LEAST(MIN((C9 - AVGC20.9) / STDDEV20.9, 2), MIN((C12 - AVGC20.12) / STDDEV20.12, 2)), IIF(L2 > L11, (C11 - AVGC20.11) / STDDEV20.11, 1 / 0), IIF((C12 - AVGC20.12) / STDDEV20.12 < LEAST(MIN((C10 - AVGC20.10) / STDDEV20.10, 2), MIN((C13 - AVGC20.13) / STDDEV20.13, 2)), IIF(L2 > L12, (C12 - AVGC20.12) / STDDEV20.12, 1 / 0), IIF((C13 - AVGC20.13) / STDDEV20.13 < LEAST(MIN((C11 - AVGC20.11) / STDDEV20.11, 2), MIN((C14 - AVGC20.14) / STDDEV20.14, 2)), IIF(L2 > L13, (C13 - AVGC20.13) / STDDEV20.13, 1 / 0), IIF((C14 - AVGC20.14) / STDDEV20.14 < LEAST(MIN((C12 - AVGC20.12) / STDDEV20.12, 2), MIN((C15 - AVGC20.15) / STDDEV20.15, 2)), IIF(L2 > L14, (C14 - AVGC20.14) / STDDEV20.14, 1 / 0), IIF((C15 - AVGC20.15) / STDDEV20.15 < LEAST(MIN((C13 - AVGC20.13) / STDDEV20.13, 2), MIN((C16 - AVGC20.16) / STDDEV20.16, 2)), IIF(L2 > L15, (C15 - AVGC20.15) / STDDEV20.15, 1 / 0), IIF((C16 - AVGC20.16) / STDDEV20.16 < LEAST(MIN((C14 - AVGC20.14) / STDDEV20.14, 2), MIN((C17 - AVGC20.17) / STDDEV20.17, 2)), IIF(L2 > L16, (C16 - AVGC20.16) / STDDEV20.16, 1 / 0), IIF((C17 - AVGC20.17) / STDDEV20.17 < LEAST(MIN((C15 - AVGC20.15) / STDDEV20.15, 2), MIN((C18 - AVGC20.18) / STDDEV20.18, 2)), IIF(L2 > L17, (C17 - AVGC20.17) / STDDEV20.17, 1 / 0), IIF((C18 - AVGC20.18) / STDDEV20.18 < LEAST(MIN((C16 - AVGC20.16) / STDDEV20.16, 2), MIN((C19 - AVGC20.19) / STDDEV20.19, 2)), IIF(L2 > L18, (C18 - AVGC20.18) / STDDEV20.18, 1 / 0), IIF((C19 - AVGC20.19) / STDDEV20.19 < LEAST(MIN((C17 - AVGC20.17) / STDDEV20.17, 2), MIN((C20 - AVGC20.20) / STDDEV20.20, 2)), IIF(L2 > L19, (C19 - AVGC20.19) / STDDEV20.19, 1 / 0), IIF((C20 - AVGC20.20) / STDDEV20.20 < LEAST(MIN((C18 - AVGC20.18) / STDDEV20.18, 2), MIN((C21 - AVGC20.21) / STDDEV20.21, 2)), IIF(L2 > L20, (C20 - AVGC20.20) / STDDEV20.20, 1 / 0), IIF((C21 - AVGC20.21) / STDDEV20.21 < LEAST(MIN((C19 - AVGC20.19) / STDDEV20.19, 2), MIN((C22 - AVGC20.22) / STDDEV20.22, 2)), IIF(L2 > L21, (C21 - AVGC20.21) / STDDEV20.21, 1 / 0), IIF((C22 - AVGC20.22) / STDDEV20.22 < LEAST(MIN((C20 - AVGC20.20) / STDDEV20.20, 2), MIN((C23 - AVGC20.23) / STDDEV20.23, 2)), IIF(L2 > L22, (C22 - AVGC20.22) / STDDEV20.22, 1 / 0), IIF((C23 - AVGC20.23) / STDDEV20.23 < LEAST(MIN((C21 - AVGC20.21) / STDDEV20.21, 2), MIN((C24 - AVGC20.24) / STDDEV20.24, 2)), IIF(L2 > L23, (C23 - AVGC20.23) / STDDEV20.23, 1 / 0), IIF((C24 - AVGC20.24) / STDDEV20.24 < LEAST(MIN((C22 - AVGC20.22) / STDDEV20.22, 2), MIN((C25 - AVGC20.25) / STDDEV20.25, 2)), IIF(L2 > L24, (C24 - AVGC20.24) / STDDEV20.24, 1 / 0), IIF((C25 - AVGC20.25) / STDDEV20.25 < LEAST(MIN((C23 - AVGC20.23) / STDDEV20.23, 2), MIN((C26 - AVGC20.26) / STDDEV20.26, 2)), IIF(L2 > L25, (C25 - AVGC20.25) / STDDEV20.25, 1 / 0), IIF((C26 - AVGC20.26) / STDDEV20.26 < LEAST(MIN((C24 - AVGC20.24) / STDDEV20.24, 2), MIN((C27 - AVGC20.27) / STDDEV20.27, 2)), IIF(L2 > L26, (C26 - AVGC20.26) / STDDEV20.26, 1 / 0), IIF((C27 - AVGC20.27) / STDDEV20.27 < LEAST(MIN((C25 - AVGC20.25) / STDDEV20.25, 2), MIN((C28 - AVGC20.28) / STDDEV20.28, 2)), IIF(L2 > L27, (C27 - AVGC20.27) / STDDEV20.27, 1 / 0), IIF((C28 - AVGC20.28) / STDDEV20.28 < LEAST(MIN((C26 - AVGC20.26) / STDDEV20.26, 2), MIN((C29 - AVGC20.29) / STDDEV20.29, 2)), IIF(L2 > L28, (C28 - AVGC20.28) / STDDEV20.28, 1 / 0), IIF((C29 - AVGC20.29) / STDDEV20.29 < LEAST(MIN((C27 - AVGC20.27) / STDDEV20.27, 2), MIN((C30 - AVGC20.30) / STDDEV20.30, 2)), IIF(L2 > L29, (C29 - AVGC20.29) / STDDEV20.29, 1 / 0), IIF((C30 - AVGC20.30) / STDDEV20.30 < LEAST(MIN((C28 - AVGC20.28) / STDDEV20.28, 2), MIN((C31 - AVGC20.31) / STDDEV20.31, 2)), IIF(L2 > L30, (C30 - AVGC20.30) / STDDEV20.30, 1 / 0), IIF((C31 - AVGC20.31) / STDDEV20.31 < LEAST(MIN((C29 - AVGC20.29) / STDDEV20.29, 2), MIN((C32 - AVGC20.32) / STDDEV20.32, 2)), IIF(L2 > L31, (C31 - AVGC20.31) / STDDEV20.31, 1 / 0), IIF((C32 - AVGC20.32) / STDDEV20.32 < LEAST(MIN((C30 - AVGC20.30) / STDDEV20.30, 2), MIN((C33 - AVGC20.33) / STDDEV20.33, 2)), IIF(L2 > L32, (C32 - AVGC20.32) / STDDEV20.32, 1 / 0), IIF((C33 - AVGC20.33) / STDDEV20.33 < LEAST(MIN((C31 - AVGC20.31) / STDDEV20.31, 2), MIN((C34 - AVGC20.34) / STDDEV20.34, 2)), IIF(L2 > L33, (C33 - AVGC20.33) / STDDEV20.33, 1 / 0), IIF((C34 - AVGC20.34) / STDDEV20.34 < LEAST(MIN((C32 - AVGC20.32) / STDDEV20.32, 2), MIN((C35 - AVGC20.35) / STDDEV20.35, 2)), IIF(L2 > L34, (C34 - AVGC20.34) / STDDEV20.34, 1 / 0), IIF((C35 - AVGC20.35) / STDDEV20.35 < LEAST(MIN((C33 - AVGC20.33) / STDDEV20.33, 2), MIN((C36 - AVGC20.36) / STDDEV20.36, 2)), IIF(L2 > L35, (C35 - AVGC20.35) / STDDEV20.35, 1 / 0), IIF((C36 - AVGC20.36) / STDDEV20.36 < LEAST(MIN((C34 - AVGC20.34) / STDDEV20.34, 2), MIN((C37 - AVGC20.37) / STDDEV20.37, 2)), IIF(L2 > L36, (C36 - AVGC20.36) / STDDEV20.36, 1 / 0), IIF((C37 - AVGC20.37) / STDDEV20.37 < LEAST(MIN((C35 - AVGC20.35) / STDDEV20.35, 2), MIN((C38 - AVGC20.38) / STDDEV20.38, 2)), IIF(L2 > L37, (C37 - AVGC20.37) / STDDEV20.37, 1 / 0), IIF((C38 - AVGC20.38) / STDDEV20.38 < LEAST(MIN((C36 - AVGC20.36) / STDDEV20.36, 2), MIN((C39 - AVGC20.39) / STDDEV20.39, 2)), IIF(L2 > L38, (C38 - AVGC20.38) / STDDEV20.38, 1 / 0), IIF((C39 - AVGC20.39) / STDDEV20.39 < LEAST(MIN((C37 - AVGC20.37) / STDDEV20.37, 2), MIN((C40 - AVGC20.40) / STDDEV20.40, 2)), IIF(L2 > L39, (C39 - AVGC20.39) / STDDEV20.39, 1 / 0), 1 / 0))))))))))))))))))))))))))))))))))), L2, 1 / 0)
Please try the following for a higher low in Bollinger %B and a lower low in price.
IIF((C2 - AVGC20.2) / STDDEV20.2 < LEAST(MIN((C - AVGC20) / STDDEV20, 2), MIN((C3 - AVGC20.3) / STDDEV20.3, 2)) AND (C2 - AVGC20.2) / STDDEV20.2 > IIF((C5 - AVGC20.5) / STDDEV20.5 < LEAST(MIN((C3 - AVGC20.3) / STDDEV20.3, 2), MIN((C6 - AVGC20.6) / STDDEV20.6, 2)), IIF(L2 < L5, (C5 - AVGC20.5) / STDDEV20.5, 1 / 0), IIF((C6 - AVGC20.6) / STDDEV20.6 < LEAST(MIN((C4 - AVGC20.4) / STDDEV20.4, 2), MIN((C7 - AVGC20.7) / STDDEV20.7, 2)), IIF(L2 < L6, (C6 - AVGC20.6) / STDDEV20.6, 1 / 0), IIF((C7 - AVGC20.7) / STDDEV20.7 < LEAST(MIN((C5 - AVGC20.5) / STDDEV20.5, 2), MIN((C8 - AVGC20.8) / STDDEV20.8, 2)), IIF(L2 < L7, (C7 - AVGC20.7) / STDDEV20.7, 1 / 0), IIF((C8 - AVGC20.8) / STDDEV20.8 < LEAST(MIN((C6 - AVGC20.6) / STDDEV20.6, 2), MIN((C9 - AVGC20.9) / STDDEV20.9, 2)), IIF(L2 < L8, (C8 - AVGC20.8) / STDDEV20.8, 1 / 0), IIF((C9 - AVGC20.9) / STDDEV20.9 < LEAST(MIN((C7 - AVGC20.7) / STDDEV20.7, 2), MIN((C10 - AVGC20.10) / STDDEV20.10, 2)), IIF(L2 < L9, (C9 - AVGC20.9) / STDDEV20.9, 1 / 0), IIF((C10 - AVGC20.10) / STDDEV20.10 < LEAST(MIN((C8 - AVGC20.8) / STDDEV20.8, 2), MIN((C11 - AVGC20.11) / STDDEV20.11, 2)), IIF(L2 < L10, (C10 - AVGC20.10) / STDDEV20.10, 1 / 0), IIF((C11 - AVGC20.11) / STDDEV20.11 < LEAST(MIN((C9 - AVGC20.9) / STDDEV20.9, 2), MIN((C12 - AVGC20.12) / STDDEV20.12, 2)), IIF(L2 < L11, (C11 - AVGC20.11) / STDDEV20.11, 1 / 0), IIF((C12 - AVGC20.12) / STDDEV20.12 < LEAST(MIN((C10 - AVGC20.10) / STDDEV20.10, 2), MIN((C13 - AVGC20.13) / STDDEV20.13, 2)), IIF(L2 < L12, (C12 - AVGC20.12) / STDDEV20.12, 1 / 0), IIF((C13 - AVGC20.13) / STDDEV20.13 < LEAST(MIN((C11 - AVGC20.11) / STDDEV20.11, 2), MIN((C14 - AVGC20.14) / STDDEV20.14, 2)), IIF(L2 < L13, (C13 - AVGC20.13) / STDDEV20.13, 1 / 0), IIF((C14 - AVGC20.14) / STDDEV20.14 < LEAST(MIN((C12 - AVGC20.12) / STDDEV20.12, 2), MIN((C15 - AVGC20.15) / STDDEV20.15, 2)), IIF(L2 < L14, (C14 - AVGC20.14) / STDDEV20.14, 1 / 0), IIF((C15 - AVGC20.15) / STDDEV20.15 < LEAST(MIN((C13 - AVGC20.13) / STDDEV20.13, 2), MIN((C16 - AVGC20.16) / STDDEV20.16, 2)), IIF(L2 < L15, (C15 - AVGC20.15) / STDDEV20.15, 1 / 0), IIF((C16 - AVGC20.16) / STDDEV20.16 < LEAST(MIN((C14 - AVGC20.14) / STDDEV20.14, 2), MIN((C17 - AVGC20.17) / STDDEV20.17, 2)), IIF(L2 < L16, (C16 - AVGC20.16) / STDDEV20.16, 1 / 0), IIF((C17 - AVGC20.17) / STDDEV20.17 < LEAST(MIN((C15 - AVGC20.15) / STDDEV20.15, 2), MIN((C18 - AVGC20.18) / STDDEV20.18, 2)), IIF(L2 < L17, (C17 - AVGC20.17) / STDDEV20.17, 1 / 0), IIF((C18 - AVGC20.18) / STDDEV20.18 < LEAST(MIN((C16 - AVGC20.16) / STDDEV20.16, 2), MIN((C19 - AVGC20.19) / STDDEV20.19, 2)), IIF(L2 < L18, (C18 - AVGC20.18) / STDDEV20.18, 1 / 0), IIF((C19 - AVGC20.19) / STDDEV20.19 < LEAST(MIN((C17 - AVGC20.17) / STDDEV20.17, 2), MIN((C20 - AVGC20.20) / STDDEV20.20, 2)), IIF(L2 < L19, (C19 - AVGC20.19) / STDDEV20.19, 1 / 0), IIF((C20 - AVGC20.20) / STDDEV20.20 < LEAST(MIN((C18 - AVGC20.18) / STDDEV20.18, 2), MIN((C21 - AVGC20.21) / STDDEV20.21, 2)), IIF(L2 < L20, (C20 - AVGC20.20) / STDDEV20.20, 1 / 0), IIF((C21 - AVGC20.21) / STDDEV20.21 < LEAST(MIN((C19 - AVGC20.19) / STDDEV20.19, 2), MIN((C22 - AVGC20.22) / STDDEV20.22, 2)), IIF(L2 < L21, (C21 - AVGC20.21) / STDDEV20.21, 1 / 0), IIF((C22 - AVGC20.22) / STDDEV20.22 < LEAST(MIN((C20 - AVGC20.20) / STDDEV20.20, 2), MIN((C23 - AVGC20.23) / STDDEV20.23, 2)), IIF(L2 < L22, (C22 - AVGC20.22) / STDDEV20.22, 1 / 0), IIF((C23 - AVGC20.23) / STDDEV20.23 < LEAST(MIN((C21 - AVGC20.21) / STDDEV20.21, 2), MIN((C24 - AVGC20.24) / STDDEV20.24, 2)), IIF(L2 < L23, (C23 - AVGC20.23) / STDDEV20.23, 1 / 0), IIF((C24 - AVGC20.24) / STDDEV20.24 < LEAST(MIN((C22 - AVGC20.22) / STDDEV20.22, 2), MIN((C25 - AVGC20.25) / STDDEV20.25, 2)), IIF(L2 < L24, (C24 - AVGC20.24) / STDDEV20.24, 1 / 0), IIF((C25 - AVGC20.25) / STDDEV20.25 < LEAST(MIN((C23 - AVGC20.23) / STDDEV20.23, 2), MIN((C26 - AVGC20.26) / STDDEV20.26, 2)), IIF(L2 < L25, (C25 - AVGC20.25) / STDDEV20.25, 1 / 0), IIF((C26 - AVGC20.26) / STDDEV20.26 < LEAST(MIN((C24 - AVGC20.24) / STDDEV20.24, 2), MIN((C27 - AVGC20.27) / STDDEV20.27, 2)), IIF(L2 < L26, (C26 - AVGC20.26) / STDDEV20.26, 1 / 0), IIF((C27 - AVGC20.27) / STDDEV20.27 < LEAST(MIN((C25 - AVGC20.25) / STDDEV20.25, 2), MIN((C28 - AVGC20.28) / STDDEV20.28, 2)), IIF(L2 < L27, (C27 - AVGC20.27) / STDDEV20.27, 1 / 0), IIF((C28 - AVGC20.28) / STDDEV20.28 < LEAST(MIN((C26 - AVGC20.26) / STDDEV20.26, 2), MIN((C29 - AVGC20.29) / STDDEV20.29, 2)), IIF(L2 < L28, (C28 - AVGC20.28) / STDDEV20.28, 1 / 0), IIF((C29 - AVGC20.29) / STDDEV20.29 < LEAST(MIN((C27 - AVGC20.27) / STDDEV20.27, 2), MIN((C30 - AVGC20.30) / STDDEV20.30, 2)), IIF(L2 < L29, (C29 - AVGC20.29) / STDDEV20.29, 1 / 0), IIF((C30 - AVGC20.30) / STDDEV20.30 < LEAST(MIN((C28 - AVGC20.28) / STDDEV20.28, 2), MIN((C31 - AVGC20.31) / STDDEV20.31, 2)), IIF(L2 < L30, (C30 - AVGC20.30) / STDDEV20.30, 1 / 0), IIF((C31 - AVGC20.31) / STDDEV20.31 < LEAST(MIN((C29 - AVGC20.29) / STDDEV20.29, 2), MIN((C32 - AVGC20.32) / STDDEV20.32, 2)), IIF(L2 < L31, (C31 - AVGC20.31) / STDDEV20.31, 1 / 0), IIF((C32 - AVGC20.32) / STDDEV20.32 < LEAST(MIN((C30 - AVGC20.30) / STDDEV20.30, 2), MIN((C33 - AVGC20.33) / STDDEV20.33, 2)), IIF(L2 < L32, (C32 - AVGC20.32) / STDDEV20.32, 1 / 0), IIF((C33 - AVGC20.33) / STDDEV20.33 < LEAST(MIN((C31 - AVGC20.31) / STDDEV20.31, 2), MIN((C34 - AVGC20.34) / STDDEV20.34, 2)), IIF(L2 < L33, (C33 - AVGC20.33) / STDDEV20.33, 1 / 0), IIF((C34 - AVGC20.34) / STDDEV20.34 < LEAST(MIN((C32 - AVGC20.32) / STDDEV20.32, 2), MIN((C35 - AVGC20.35) / STDDEV20.35, 2)), IIF(L2 < L34, (C34 - AVGC20.34) / STDDEV20.34, 1 / 0), IIF((C35 - AVGC20.35) / STDDEV20.35 < LEAST(MIN((C33 - AVGC20.33) / STDDEV20.33, 2), MIN((C36 - AVGC20.36) / STDDEV20.36, 2)), IIF(L2 < L35, (C35 - AVGC20.35) / STDDEV20.35, 1 / 0), IIF((C36 - AVGC20.36) / STDDEV20.36 < LEAST(MIN((C34 - AVGC20.34) / STDDEV20.34, 2), MIN((C37 - AVGC20.37) / STDDEV20.37, 2)), IIF(L2 < L36, (C36 - AVGC20.36) / STDDEV20.36, 1 / 0), IIF((C37 - AVGC20.37) / STDDEV20.37 < LEAST(MIN((C35 - AVGC20.35) / STDDEV20.35, 2), MIN((C38 - AVGC20.38) / STDDEV20.38, 2)), IIF(L2 < L37, (C37 - AVGC20.37) / STDDEV20.37, 1 / 0), IIF((C38 - AVGC20.38) / STDDEV20.38 < LEAST(MIN((C36 - AVGC20.36) / STDDEV20.36, 2), MIN((C39 - AVGC20.39) / STDDEV20.39, 2)), IIF(L2 < L38, (C38 - AVGC20.38) / STDDEV20.38, 1 / 0), IIF((C39 - AVGC20.39) / STDDEV20.39 < LEAST(MIN((C37 - AVGC20.37) / STDDEV20.37, 2), MIN((C40 - AVGC20.40) / STDDEV20.40, 2)), IIF(L2 < L39, (C39 - AVGC20.39) / STDDEV20.39, 1 / 0), 1 / 0))))))))))))))))))))))))))))))))))), L2, 1 / 0)
Bruce all of them work perfect... I cannot thankyou enough brother for taking time to compute...
cheers :))
Hi Dhiren,
I tried adding your pcf's to the chart but they are not aligned to the BB band. I changed the number to -0.5 like you mentioned but I guess I'm doing something wrong. Is it okay for you to TCMail me your pcf chart? I can share what I was doing on my chart. It is okay if it is not possible to share too.'
Thanks,
Priya
Hi Bruce,
I am new to TC2000 and trying to understand as much as I can through the forum posts. I have the following requests for you.
Request1:
I have seen some posts on MACD Divergence but I felt if I can get PCF for MACD and price Divergence just like how you wrote for BB & Price, that would be nice.
Can you please write the PCF for MACD and Price divergence that plot dots on price? If you can add these to a chart and TC Mail me, that would be great.
1) Bullish Reversal
2) Bullish Continuation Divergence
3) Bearish Continuation
4) Bearish Reversal Divergence
Unfortunately, I'm not a pro like everyone is in the forum and I cannot specify the Higher high, lower low criteria like Dhirenshah provided you.
Request2: Can I please also get a chart on TCMail with what was requested in this post for BB and Price divergence? I tried to add these on my TC2000 but I' no where close to doing it right.
1)Dot plot overlayed as higher high fractal , Lower high fractal , Higher low fractal and Lower Low fractal on Bollinger bands %B with 4 different colours
2) lower high in Bollinger %B and a higher high in price.
3) higher high in Bollinger %B and a lower high in price.
4) lower low in Bollinger %B and a higher low in price.
5) higher low in Bollinger %B and a lower low in price.
Please let me know if it is possible.
Note: I'm new and only started learning since last two months. I appreciate all the requests people post on the forums and I'm learning a lot from them.
Good Morning Bruce,
Whenever you get a chance, can you please help me with the above requests?
Regards,
I have sent you a my implementation Request2 via TCMail.
Request1 is may or may not be possible (and I have not personally been impressed by any MACD divergence formula of this type so far), but let me ask some questions.
Is this for a plain MACD or a MACD Histogram?
Are it an exponential MACD 12,26,9?
I can't really interpret Bullish Reversal, Bullish Continuation Reversal, Bearish Continuation, and Bearish Reversal Divergence for you as it would pertain to higher highs, higher lows, lower highs, and lower lows.
There are 16 possible combinations if we are considering both the MACD and price in combination.
Priyaa first of all welcome to the forum and i saw the message you asked to me above,,, i think Bruce answered you for your query by sending you TC mail but in your Request 1 for MACD i might be able to help somewhat try this as below i followed what Bruce had built in past for me for someother queries he is best in what he does ,,,
ok saw for request 1
I like 5 and 21 for macd so i plot custom indicator and formula as "MACD5.21" then i slide to left and add click on that PCF and click add plot here then add 1 period simple moving average data source as Macd--- the reason i do this because to my eye i don't want zero line to be seen it bothers my divergence analysis
then plot custom indicator name it as Higher High and copy as below then slide it to the left and add offset moving average period 1 and offset -2 style dot plot give a green colour
Thank you Bruce and Dhiren. I'm very greatful to you both. I will need atleast to week to understand. I will get back to you both with any questions I have.
Bruce,
Regarding your question about MACD, I'm looking for MACD-H 12,26,9.