MTF Triangle Signal - ABX

Trading indicator by @leilei0128 · Free · 0 likes · 1 users

About

MTF Triangle Signal - ABX is an indicator drawn over the price chart. You can change one input: htftrendlen (default 50). It remembers globalstate, warningbarindex and lastsignaldir from one bar to the next. It calculates m5 as 5-minute bars, m15 as 15-minute bars, m30 as 30-minute bars, m60 as 1-hour bars, m240 as 4-hour bars, h4ema as the EMA of m240.close over htftrendlen bars, trendup as whether m240.close is above h4ema, trenddown as whether m240.close is below h4ema, bull5 as whether the previous bar's m5.close is below the previous bar's m5.open and m5.close is above m5.open, bull15 as whether the previous bar's m15.close is below the previous bar's m15.open and m15.close is above m15.open, bull30 as whether the previous bar's m30.close is below the previous bar's m30.open and m30.close is above m30.open, bull60 as whether the previous bar's m60.close is below the previous bar's m60.open and m60.close is above m60.open and 15 more values. It shares longsignal, shortsignal and signaldirection with scripts that use it. On each bar, it checks whether warninglong and, if so, sets globalstate to 1, sets warningbarindex to the bar number and sets lastsignaldir to 1. On each bar, it checks whether warningshort and, if so, sets globalstate to -1, sets warningbarindex to the bar number and sets lastsignaldir to -1. On each bar, it checks whether confirmlong or confirmshort and, if so, sets globalstate to 0.