# Bollinger Band entry code

I

#### isaacb

##### New member
Hey everyone!
Im fairly new to the whole TOS platform and thinkscript in general.
I built a strategy using the conditional wizard and i want to use this strategy as a condition in a new strategy. So far i have found no way to use a study as a condition.

The main strategy is true once all conditions have been met:
1) 5 bars closed over BB with dev of 0.382
2) short pivot high was found in or after those bars ( high, higher high, lower high).

The code for the main Study is as follows:
Code:
``````close is greater than or equal to BollingerBands("num dev dn" = -0.382, "num dev up" = 0.382)."UpperBand"
and close from 1 bars ago is greater than or equal to BollingerBands("num dev dn" = -0.382, "num dev up" = 0.382)."UpperBand" from 1 bars ago
and close from 2 bars ago is greater than or equal to BollingerBands("num dev dn" = -0.382, "num dev up" = 0.382)."UpperBand" from 2 bars ago
and close from 3 bars ago is greater than or equal to BollingerBands("num dev dn" = -0.382, "num dev up" = 0.382)."UpperBand" from 3 bars ago
and close from 4 bars ago is greater than or equal to BollingerBands("num dev dn" = -0.382, "num dev up" = 0.382)."UpperBand" from 4 bars ago
and high is less than high from 1 bars ago and high from 1 bars ago is greater than high from 2 bars ago``````

(I cant seem to upload an image, so for the sake of simplicity im adding this image url)

As can be seen by the image, the study works well to find the conditions. (Bar #2 met all conditions, while bar #1 is the high of the last conditions in the study)

What I am wishing to do is have another study that will alert when the next X bars after go over the high bar before that triggered the study (bar #1). So in this case bar #4 reaches higher than bar #1 (only after Study1 is triggered) and this should alert in the new study.

I hope I was able to be clear with the explanation and apologies for the image that wouldn't upload.

Thanks for the help!