Indicator example
Aroon Indicator
Readonly source from tests/EasyLanguage/David_EasyLanguage, generated Pine Script v6, and an expiry-free example EX5.
Original EasyLanguage
{ Search Tag: WA-Aroon Indicator }{ Reference: Tushar S. Chande, "A Time Price Oscillator", Technical Analysis ofStocks & Commodities, V. 13:9 (369-374) }inputs:int AroonLength( 25 ) [DisplayName = "AroonLength",ToolTip = "Enter the number of bars to be used in the calculation of the indicator."],double OverBought( 70 ) [DisplayName = "OverBought",ToolTip = "Enter the level of the indicator at which you consider the market to be overbought (too high)."],double OverSold( 30 ) [DisplayName = "OverSold",ToolTip = "Enter the level of the indicator at which you consider the market to be oversold (too low)."];variables:double AroonUpValue( 0 ),double AroonDnValue( 0 );AroonUpValue = AroonUp( AroonLength );AroonDnValue = AroonDown( AroonLength );Plot1( AroonUpValue, !( "AroonUp" ) );Plot2( AroonDnValue, !( "AroonDn" ) );Plot3( OverBought, !( "OverBought" ) );Plot4( OverSold, !( "OverSold" ) );{ ** Copyright © TradeStation Technologies, Inc. All Rights Reserved **** TradeStation reserves the right to modify or overwrite this analysis techniquewith each release. ** }
Generated Pine Script v6
//@version=6indicator("AroonIndicator", overlay=true)// dependencies:__el_aroon_down(int length) =>length <= 1 ? 100 : 100 * (length - 1 + ta.lowestbars(low, length)) / (length - 1)// dependencies:__el_aroon_up(int length) =>length <= 1 ? 100 : 100 * (length - 1 + ta.highestbars(high, length)) / (length - 1)aroonlength = input.int(25, "aroonlength")overbought = input.float(70.0, "overbought")oversold = input.float(30.0, "oversold")var float aroonupvalue = 0var float aroondnvalue = 0float __el_plot1 = nacolor __el_plot1_color = color.bluefloat __el_plot2 = nacolor __el_plot2_color = color.bluefloat __el_plot3 = nacolor __el_plot3_color = color.bluefloat __el_plot4 = nacolor __el_plot4_color = color.blue__el_call1 = __el_aroon_up(aroonlength)__el_call2 = __el_aroon_down(aroonlength)if bar_index >= 24aroonupvalue := __el_call1aroondnvalue := __el_call2__el_plot1 := aroonupvalue__el_plot2 := aroondnvalue__el_plot3 := overbought__el_plot4 := oversoldplot(__el_plot1, title="AroonUp", color=__el_plot1_color)plot(__el_plot2, title="AroonDn", color=__el_plot2_color)plot(__el_plot3, title="OverBought", color=__el_plot3_color)plot(__el_plot4, title="OverSold", color=__el_plot4_color)
Compiled MetaTrader 5 example
The EX5 uses the original script filename stem and has no PineAnywhere expiration guard.