Indicator example

Aroon Indicator

Readonly source from tests/EasyLanguage/David_EasyLanguage, generated Pine Script v6, and an expiry-free example EX5.

Original EasyLanguage

  1. { Search Tag: WA-Aroon Indicator }
  2. { Reference: Tushar S. Chande, "A Time Price Oscillator", Technical Analysis of
  3. Stocks & Commodities, V. 13:9 (369-374) }
  4. inputs:
  5. int AroonLength( 25 ) [
  6. DisplayName = "AroonLength",
  7. ToolTip = "Enter the number of bars to be used in the calculation of the indicator."],
  8. double OverBought( 70 ) [
  9. DisplayName = "OverBought",
  10. ToolTip = "Enter the level of the indicator at which you consider the market to be overbought (too high)."],
  11. double OverSold( 30 ) [
  12. DisplayName = "OverSold",
  13. ToolTip = "Enter the level of the indicator at which you consider the market to be oversold (too low)."];
  14. variables:
  15. double AroonUpValue( 0 ),
  16. double AroonDnValue( 0 );
  17. AroonUpValue = AroonUp( AroonLength );
  18. AroonDnValue = AroonDown( AroonLength );
  19. Plot1( AroonUpValue, !( "AroonUp" ) );
  20. Plot2( AroonDnValue, !( "AroonDn" ) );
  21. Plot3( OverBought, !( "OverBought" ) );
  22. Plot4( OverSold, !( "OverSold" ) );
  23. { ** Copyright © TradeStation Technologies, Inc. All Rights Reserved **
  24. ** TradeStation reserves the right to modify or overwrite this analysis technique
  25. with each release. ** }

Generated Pine Script v6

  1. //@version=6
  2. indicator("AroonIndicator", overlay=true)
  3. // dependencies:
  4. __el_aroon_down(int length) =>
  5. length <= 1 ? 100 : 100 * (length - 1 + ta.lowestbars(low, length)) / (length - 1)
  6. // dependencies:
  7. __el_aroon_up(int length) =>
  8. length <= 1 ? 100 : 100 * (length - 1 + ta.highestbars(high, length)) / (length - 1)
  9. aroonlength = input.int(25, "aroonlength")
  10. overbought = input.float(70.0, "overbought")
  11. oversold = input.float(30.0, "oversold")
  12. var float aroonupvalue = 0
  13. var float aroondnvalue = 0
  14. float __el_plot1 = na
  15. color __el_plot1_color = color.blue
  16. float __el_plot2 = na
  17. color __el_plot2_color = color.blue
  18. float __el_plot3 = na
  19. color __el_plot3_color = color.blue
  20. float __el_plot4 = na
  21. color __el_plot4_color = color.blue
  22. __el_call1 = __el_aroon_up(aroonlength)
  23. __el_call2 = __el_aroon_down(aroonlength)
  24. if bar_index >= 24
  25. aroonupvalue := __el_call1
  26. aroondnvalue := __el_call2
  27. __el_plot1 := aroonupvalue
  28. __el_plot2 := aroondnvalue
  29. __el_plot3 := overbought
  30. __el_plot4 := oversold
  31. plot(__el_plot1, title="AroonUp", color=__el_plot1_color)
  32. plot(__el_plot2, title="AroonDn", color=__el_plot2_color)
  33. plot(__el_plot3, title="OverBought", color=__el_plot3_color)
  34. 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.

Download AroonIndicator.ex5
An unexpected error occurred. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.