# Trading Analysis Swing Waves # Version 2.0 # 3/15/2024 # # Authors: Brian Strong - Micro Quant (brian@microquant.com) SwingWave detection # Daniel Sinnig - Biiuse Trading (dsinnig@biiuse-trading.com) Ideal entry detection # input MajorSwingPeriod = 13; input MinorSwingPeriod = 5; input AlertsOn = yes; def DN65l793265830208_____ = 0.20; def __80l1805849900004K___H = Average(TrueRange(high, close, low), 9) * DN65l793265830208_____; def J_82l6409464871467UA__R = if high > Highest(high[1], MajorSwingPeriod) and high > Highest(high[-MajorSwingPeriod], MajorSwingPeriod) then 1 else 0; def _J86l8420049411529GYFXI = if J_82l6409464871467UA__R then high+__80l1805849900004K___H else Double.NaN; def ZY_22l4351153575265NCR_I = if low < Lowest(low[1], MajorSwingPeriod) and low < Lowest(low[-MajorSwingPeriod], MajorSwingPeriod) then 1 else 0; def W_89l5965036025582KHFUS = if ZY_22l4351153575265NCR_I then low-__80l1805849900004K___H else Double.NaN; def H_7l6819266504806ZZOES = if high > Highest(high[1], MinorSwingPeriod) and high > Highest(high[-MinorSwingPeriod], MinorSwingPeriod) then 1 else 0; def U_70l1229240389915_OYJZ = if H_7l6819266504806ZZOES then high+__80l1805849900004K___H else Double.NaN; def _C92l5451349177242OL_P_ = if low < Lowest(low[1], MinorSwingPeriod) and low < Lowest(low[-MinorSwingPeriod], MinorSwingPeriod) then 1 else 0; def CW163l669724620964_L_YL = if _C92l5451349177242OL_P_ then low-__80l1805849900004K___H else Double.NaN; Alert(AlertsOn and J_82l6409464871467UA__R, GetSymbol() + " Major Swing High", Alert.BAR, Sound.Bell); Alert(AlertsOn and ZY_22l4351153575265NCR_I, GetSymbol() + " Major Swing Low", Alert.BAR, Sound.Bell); Alert(AlertsOn and H_7l6819266504806ZZOES, GetSymbol() + " Minor Swing High", Alert.BAR, Sound.Bell); Alert(AlertsOn and _C92l5451349177242OL_P_, GetSymbol() + " Minor Swing Low", Alert.BAR, Sound.Bell); plot MajorSwHigh = _J86l8420049411529GYFXI; MajorSwHigh.setpaintingStrategy(paintingStrategy.POINTS); MajorSwHigh.setLineWeight(5); MajorSwHigh.setdefaultColor(Color.BLUE); plot MajorSwLow = W_89l5965036025582KHFUS; MajorSwLow.setpaintingStrategy(paintingStrategy.POINTS); MajorSwLow.setLineWeight(5); MajorSwLow.setdefaultColor(Color.BLUE); plot MinorSwHigh = U_70l1229240389915_OYJZ; MinorSwHigh.setpaintingStrategy(paintingStrategy.POINTS); MinorSwHigh.setLineWeight(2); MinorSwHigh.setdefaultColor(Color.MAGENTA); plot MinorSwLow = CW163l669724620964_L_YL; MinorSwLow.setpaintingStrategy(paintingStrategy.POINTS); MinorSwLow.setLineWeight(2); MinorSwLow.setdefaultColor(Color.MAGENTA);