Advertisement
NKactive

NEO Aroon

Nov 10th, 2023
72
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © NKactive
  3. // Original code from Neo
  4. //@version=5
  5.  
  6. strategy("NEO Aroon", overlay=false, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, pyramiding=0, slippage=1)
  7. import EliCobra/CobraMetrics/4 as cobra
  8. //// PLOT DATA
  9. disp_ind = input.string ("None" , title = "Display Curve" , tooltip = "Choose which data you would like to display", options=["Strategy", "Equity", "Open Profit", "Gross Profit", "Net Profit", "None"], group = "🐍 𝓒𝓸𝓫𝓻𝓪 𝓜𝓮𝓽𝓻𝓲𝓬𝓼 🐍")
  10. pos_table = input.string("Middle Left", "Table Position", options = ["Top Left", "Middle Left", "Bottom Left", "Top Right", "Middle Right", "Bottom Right", "Top Center", "Bottom Center"], group = "🐍 𝓒𝓸𝓫𝓻𝓪 𝓜𝓮𝓽𝓻𝓲𝓬𝓼 🐍")
  11. type_table = input.string("None", "Table Type", options = ["Full", "Simple", "None"], group = "🐍 𝓒𝓸𝓫𝓻𝓪 𝓜𝓮𝓽𝓻𝓲𝓬𝓼 🐍")
  12. plot(cobra.curve(disp_ind))
  13. cobra.cobraTable(type_table, pos_table)
  14. //
  15. // ****************************************************************************************************************************************************************
  16. //
  17.  
  18. //Aroon
  19. aroonlength = input.int(27, "Aroon UP", group = "Aroon")
  20. lowerlength = input.int(28,"Aroon Down", group = "Aroon")
  21. aroonup = input.int(7, "AroonUP lvl", group = "Aroon")
  22. aroondn = input.int(14,"AroonDN lvl", group = "Aroon")
  23.  
  24. upper = 100 * (ta.highestbars(high, aroonlength+1) + aroonlength)/aroonlength
  25. lower = 100 * (ta.lowestbars(low, lowerlength+1) + lowerlength)/lowerlength
  26. oscillator1 = upper - lower
  27. smoothing1 = input.int(14, "Aroon Smoothing", group = "Aroon")
  28. oscillator = ta.ema(oscillator1, smoothing1)
  29.  
  30.  
  31.  
  32. aroon_long = upper < aroonup
  33. aroon_short = lower < aroondn and oscillator < 75
  34.  
  35.  
  36.  
  37. plot(upper, color=color.green, title = "upper")
  38. plot(lower, color=color.red, title = "lower")
  39. plot(oscillator, color=color.yellow, title = "oscillator")
  40. plot(oscillator1, color=color.orange, title = "oscillator1")
  41. plot(smoothing1, color=color.gray, title = "smoothing1")
  42. plot(aroonup, color=color.gray, title = "aroonup")
  43. plot(aroondn, color=color.gray, title = "aroondn")
  44. plot(75)
  45.  
  46.  
  47.  
  48. // ****************************************************************************************************************************************************************
  49.  
  50.  
  51.  
  52.  
  53. // ****************************************************************************************************************************************************************
  54. // Call combine signals and execute buy/sell positions within timeframe
  55. //.****************************************************************************************************************************************************************
  56. // Date Range To Include
  57. startDate = timestamp("2018-01-01T00:00")
  58. endDate = time
  59. // Check if the current timestamp is within the restricted range
  60. inRestrictedRange = time >= startDate and time <= endDate
  61. //
  62. // Buy Signals on overbought and oversold
  63. //
  64. if inRestrictedRange and aroon_long // ADD OTHER BUY SIGNAL BOOLS
  65. strategy.entry("My Long Entry Id", strategy.long, 100)
  66. if inRestrictedRange and aroon_short // ADD OTHER BUY SIGNAL BOOLS
  67. strategy.entry("My Short Entry Id", strategy.short, 100)
  68.  
  69.  
  70.  
Advertisement
Comments
  • # text 0.12 KB | 0 0
    1. download all types of premium tradingview indicators codes available on telegram - https://t.me/tradingview_premium_indicator
Add Comment
Please, Sign In to add comment
Advertisement