# Support Board

Date/Time: Sun, 21 Apr 2024 19:52:29 +0000

## Swing High and Low

### View Count: 1018

 [2014-10-24 22:57:32] #1 jivetrader - Posts: 374 trying to write an alert using this study. Since i cannot just poll the previous bar and find a match, How might i identify the bar with the previous occurrence of the SG1 or SG2 ?
 [2014-10-24 23:57:01] #2 Sawtooth - Posts: 3976 Try one of these: =SG1[-4]>0 =SG2[-4]>0 or OR(SG1[-4]>0,SG2[-4]>0) where the [-4] value is one bar less than the Length setting of 5.
 [2014-10-25 00:23:19] #3 jivetrader - Posts: 374 thanks. so I would probably need a spreadsheet study to find the OHLC of whatever bar it finds is the previous swing high. ?
 [2014-10-25 00:43:34] #4 Sawtooth - Posts: 3976 Yes, because Simple Alerts are only T/F. Use a formula like this in a Formula Column on the spreadsheet, e.g. in cell M3: =IF(AA3>0,C3,M4) This will grab the High when there is a new swing high in column AA, and repeat it until the next swing high.
 [2014-10-25 01:21:13] #5 jivetrader - Posts: 374 great tip. saved me a lot of index & match. cheers mate