Looking for Tradestation code to identify the following (will be used as part of a study I'm writing based on a 1min chart).
General: Looking for when a price goes from the upper or lower 5 minute bollinger band (BB) then goes above the 5 minute midband (MB) by a certain number of points (an input) and then hits the upper or lower BB again. Need numbers to reset so can take multiple setups during the day.
Need the following inputs:
1) the number of points (handles) the market is allowed to exceed the MB
2) Allowance factor (points) for near misses (points)
3) See output 4 below.
Need the following outputs:
1) Value of BB when at which the market leaves the BB on the way to the MB
2) Value of the BB when the market touches the BB the second time after touching the MB (see input 2 above)
3) The number of bars (1minute chart) between the 2 BB touches
4) The amount that the actual market excedes the 2nd BB touch within the next x bars (input 3 above)