Advertisement
danucante

Untitled

Nov 9th, 2023
321
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.13 KB | None | 0 0
  1.  
  2. //@version=5
  3. strategy("neo test", overlay=true, pyramiding = 0, slippage = 1, initial_capital = 100, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
  4.  
  5. // Plot Cobra Metrics Table
  6. import EliCobra/CobraMetrics/4 as cobra
  7.  
  8.  
  9.  
  10.  
  11. disp_ind = input.string ("Equity" , title = "Display Curve" , tooltip = "Choose which data you would like to display", options=["Strategy", "Equity", "Open Profit", "Gross Profit", "Net Profit", "None"], group = "🐍 𝓒𝓸𝓫𝓻𝓪 𝓜𝓮𝓽𝓻𝓲𝓬𝓼 🐍")
  12. pos_table = input.string("Bottom Right", "Table Position", options = ["Top Left", "Middle Left", "Bottom Left", "Top Right", "Middle Right", "Bottom Right", "Top Center", "Bottom Center"], group = "🐍 𝓒𝓸𝓫𝓻𝓪 𝓜𝓮𝓽𝓻𝓲𝓬𝓼 🐍")
  13. type_table = input.string("Full", "Table Type", options = ["Full", "Simple", "None"], group = "🐍 𝓒𝓸𝓫𝓻𝓪 𝓜𝓮𝓽𝓻𝓲𝓬𝓼 🐍")
  14.  
  15. plot(cobra.curve(disp_ind))
  16. cobra.cobraTable(type_table, pos_table)
  17.  
  18. // Time Range
  19. startTime = input.time(defval = timestamp("01 January 2011"), title = "Start Date")
  20. isInTimeRange = time >= startTime
  21.  
  22.  
  23.  
  24.  
  25. // rsi
  26. rsiLengthInput = input.int(14, minval=1, title="RSI Length", group="RSI Settings")
  27. rsiSourceInput = input.source(close, group="RSI Settings")
  28. uprsi = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
  29. downrsi = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
  30. rsi = downrsi == 0 ? 100 : uprsi == 0 ? 0 : 100 - (100 / (1 + uprsi / downrsi))
  31. lengthrsiema = input.int(14, group="RSI Settings")
  32. RSIEMA = ta.ema(rsi,lengthrsiema)
  33.  
  34. // RSIema_long = RSIEMA > 50
  35. RSIema_short = RSIEMA < 50
  36. RSIema_long = ta.crossover(RSIEMA, 50)
  37. // RSIema_short = ta.crossunder(RSIEMA, 50)
  38.  
  39. rsi2 = ta.rsi(close, 21)
  40.  
  41. RSI_long = rsi2 > 50
  42. RSI_short = rsi2 < 50
  43. // RSI_long = ta.crossover(rsi2, 50)
  44. // RSI_short = ta.crossunder(rsi2, 50)
  45.  
  46.  
  47.  
  48.  
  49. // DMI
  50. LengthDMI = input.int(defval = 16, title = "DMI Length", group = 'DMI')
  51. LengthDMI_2 = input.int(defval = 16, title = "DMI Length_2", group = 'DMI')
  52. smoothing_lengthDMI = input.int(defval = 12, title = "DMI ADX Smoothing", group = 'DMI')
  53.  
  54. [diplus, diminus, adx] = ta.dmi(LengthDMI, smoothing_lengthDMI)
  55. [diplus_2, diminus_2, adx_2] = ta.dmi(LengthDMI_2, smoothing_lengthDMI)
  56.  
  57. DMIlong = diplus > diminus and adx > adx[1]
  58. DMIshort = diminus > diplus
  59. // DMIlong = ta.crossover(diplus, diminus) and ta.crossover(adx, adx[1])
  60. // DMIshort = ta.crossunder(diplus, diminus)
  61. DMIlong_2 = diplus_2 > diminus_2 and adx_2 > adx_2[1]
  62. DMIshort_2 = diminus_2 > diplus_2
  63.  
  64.  
  65. //STC
  66. EEEEEE = input(17, 'STC Length', group = "STC")
  67. BBBB = input(38, 'STC FastLength', group = "STC")
  68. BBBBB = input(55, 'STC SlowLength', group = "STC")
  69.  
  70. AAAA(BBB, BBBB, BBBBB) =>
  71. fastMA = ta.ema(BBB, BBBB)
  72. slowMA = ta.ema(BBB, BBBBB)
  73. AAAA = fastMA - slowMA
  74. AAAA
  75.  
  76. AAAAA(EEEEEE, BBBB, BBBBB) =>
  77. AAA = input(0.5)
  78. var CCCCC = 0.0
  79. var DDD = 0.0
  80. var DDDDDD = 0.0
  81. var EEEEE = 0.0
  82. BBBBBB = AAAA(close, BBBB, BBBBB)
  83. CCC = ta.lowest(BBBBBB, EEEEEE)
  84. CCCC = ta.highest(BBBBBB, EEEEEE) - CCC
  85. CCCCC := CCCC > 0 ? (BBBBBB - CCC) / CCCC * 100 : nz(CCCCC[1])
  86. DDD := na(DDD[1]) ? CCCCC : DDD[1] + AAA * (CCCCC - DDD[1])
  87. DDDD = ta.lowest(DDD, EEEEEE)
  88. DDDDD = ta.highest(DDD, EEEEEE) - DDDD
  89. DDDDDD := DDDDD > 0 ? (DDD - DDDD) / DDDDD * 100 : nz(DDDDDD[1])
  90. EEEEE := na(EEEEE[1]) ? DDDDDD : EEEEE[1] + AAA * (DDDDDD - EEEEE[1])
  91. EEEEE
  92.  
  93. mAAAAA = AAAAA(EEEEEE, BBBB, BBBBB)
  94. mColor = mAAAAA > mAAAAA[1] ? color.new(color.green, 20) : color.new(color.red, 20)
  95.  
  96. stc = mAAAAA > mAAAAA[1] ? true : false
  97. stc_long = mAAAAA > mAAAAA[1]
  98. stc_short = mAAAAA < mAAAAA[1]
  99.  
  100.  
  101.  
  102.  
  103. // GET INPUTS //----------------------------------------------------------------------------------
  104.  
  105. src0 = input.source (close , 'Source', group = "VZO" )
  106. len = input.int (45 , 'VZO Length', group = "VZO" , minval=1)
  107. malen = input.int (7 , 'MA Length', group = "VZO" , minval=1)
  108. flen = input.int (7 , 'Fisher Length', group = "VZO", minval=1)
  109.  
  110. col_1 = input.color(#22ab94,'Color 1')
  111. col_2 = input.color(#f7525f,'Color 2')
  112.  
  113.  
  114. // CALC VZO //------------------------------------------------------------------------------------
  115.  
  116.  
  117. zone(_src, _len) =>
  118. vol = volume
  119. src = ta.wma(2 * ta.wma(_src, malen / 2) - ta.wma(_src, malen), math.round(math.sqrt(malen)))
  120. vp = src > src[1] ? vol : src < src[1] ? -vol : src == src[1] ? 0 : 0
  121. z = 100 * (ta.ema(vp, _len) / ta.ema(vol, _len))
  122.  
  123.  
  124. vzo = request.security(syminfo.tickerid,"",zone(src0, len))
  125.  
  126.  
  127. // CALC FISHER //---------------------------------------------------------------------------------
  128.  
  129. fsrc = vzo
  130. MaxH = ta.highest (fsrc , flen)
  131. MinL = ta.lowest (fsrc , flen)
  132. var nValue1 = 0.0
  133. var nFish = 0.0
  134.  
  135.  
  136. nValue1 := 0.33 * 2 * ((fsrc - MinL) / (MaxH - MinL) - 0.5) + 0.67 * nz(nValue1[1])
  137. nValue2 = (nValue1 > 0.99 ? 0.999 : (nValue1 < -0.99 ? -0.999: nValue1))
  138. nFish := 0.5 * math.log((1 + nValue2) / (1 - nValue2)) + 0.5 * nz(nFish[1])
  139.  
  140. f1 = nFish
  141. f2 = nz(nFish[1])
  142.  
  143.  
  144. // PLOT //----------------------------------------------------------------------------------------
  145.  
  146. fzvzo_down = f1<f2
  147. fzvzo_up = f1 > f2
  148. //plot(f1 , color=col , title="Fisher" )
  149. //plot(f2 , color=col , title="Trigger" )
  150.  
  151.  
  152.  
  153.  
  154. //Aroon
  155. aroonlength = input.int(27, "Aroon UP", group = "Aroon")
  156. lowerlength = input.int(28,"Aroon Down", group = "Aroon")
  157.  
  158. upper = 100 * (ta.highestbars(high, aroonlength+1) + aroonlength)/aroonlength
  159. lower = 100 * (ta.lowestbars(low, lowerlength+1) + lowerlength)/lowerlength
  160. oscillator1 = upper - lower
  161. smoothing1 = input.int(14, "Aroon Smoothing", group = "Aroon")
  162. oscillator = ta.ema(oscillator1, smoothing1)
  163. aroonup = input.int(7, "AroonUP lvl", group = "Aroon")
  164. aroondn = input.int(14,"AroonDN lvl", group = "Aroon")
  165.  
  166. //Trading
  167.  
  168.  
  169. aroon_long = upper > aroonup
  170. aroon_short = lower > aroondn and oscillator < 75
  171.  
  172.  
  173.  
  174.  
  175. //adx
  176. adxlen = input(7, title="ADX Smoothing", group = "ADX")
  177. dilen = input(6, title="ADX_DI Length", group = "ADX")
  178. adx_crit = input(27, title="ADX Crit", group = "ADX")
  179. dirmov(len) =>
  180. up = ta.change(high)
  181. down = -ta.change(low)
  182. plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
  183. minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
  184. truerange = ta.rma(ta.tr, len)
  185. plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
  186. minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
  187. [plus, minus]
  188. adx(dilen, adxlen) =>
  189. [plus, minus] = dirmov(dilen)
  190. sum = plus + minus
  191. //adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
  192. sig = adx(dilen, adxlen)
  193. adx_up = sig > adx_crit
  194. adx_down = sig > adx_crit
  195.  
  196. // RTI
  197. trend_data_count = input.int(113, step=4, minval=10, title="Trend Length", inline = "RT", group="RTI")
  198. trend_sensitivity_percentage = input.int(95, step=1,minval=50, maxval=98,title='Sensitivity', inline = "RT1", group="RTI")
  199.  
  200. upper_trend = close + ta.stdev(close, 2)
  201. lower_trend = close - ta.stdev(close, 2)
  202.  
  203. upper_array = array.new<float>(0)
  204. lower_array = array.new<float>(0)
  205. for i = 0 to trend_data_count - 1
  206. upper_array.push(upper_trend[i])
  207. lower_array.push(lower_trend[i])
  208. upper_array.sort()
  209. lower_array.sort()
  210.  
  211. upper_index = math.round(trend_sensitivity_percentage / 100 * trend_data_count) - 1
  212. lower_index = math.round((100 - trend_sensitivity_percentage) / 100 * trend_data_count) - 1
  213. UpperTrend = upper_array.get(upper_index)
  214. LowerTrend = lower_array.get(lower_index)
  215. RelativeTrendIndex = ((close - LowerTrend) / (UpperTrend - LowerTrend))*100
  216.  
  217.  
  218. RTIlong = RelativeTrendIndex > 21
  219. RTIshort = RelativeTrendIndex < 79
  220.  
  221.  
  222.  
  223.  
  224. atrSupertrend = input.int(10, "ATR", group="Supertrend")
  225. factor = input.float(3, "Factor", step=0.05,group="Supertrend")
  226. [a, direction] = ta.supertrend(factor, atrSupertrend)
  227.  
  228. // supertrend_Long = direction < 0
  229. // supertrend_Short = direction > 0
  230. supertrend_Long = ta.crossunder(direction, 0)
  231. supertrend_Short = ta.crossover(direction, 0)
  232.  
  233. // ** ---> Inputs ------------- {
  234. var bool positive = false
  235. var bool negative = false
  236. string RSI_group = "RSI Settings"
  237. string mom_group = "Momentum Vales"
  238. string visual = "Visuals"
  239. int Len2 = input(14,"RSI 1️⃣",inline = "rsi",group = RSI_group)
  240. int pmom = input(65," Positive above",inline = "rsi1",group =RSI_group )
  241. int nmom = input(32,"Negative below",inline = "rsi1",group =RSI_group )
  242. bool showlabels = input(true,"Show Momentum ❓",inline = "001",group =visual )
  243. //color p = input(color.rgb(76, 175, 79, 62),"Positive",inline = "001",group =visual )
  244. //color n = input(color.rgb(255, 82, 82, 66),"Negative",inline = "001",group =visual )
  245. bool filleshow = input(true,"Show highlighter ❓",inline = "002",group =visual )
  246. color bull = input(color.rgb(76, 175, 79, 62),"Bull",inline = "002",group =visual )
  247. color bear = input(color.rgb(255, 82, 82, 66),"Bear",inline = "002",group =visual )
  248. //rsi = ta.rsi(close, Len2)
  249. //------------------- }
  250.  
  251. // ** ---> Momentums ------------- {
  252.  
  253. p_mom = rsi[1] < pmom and rsi > pmom and rsi > nmom and ta.change(ta.ema(close,5)) > 0
  254. n_mom = rsi < nmom and ta.change(ta.ema(close,5)) < 0
  255. if p_mom
  256. positive:= true
  257. negative:= false
  258.  
  259. if n_mom
  260. positive:= false
  261. negative:= true
  262.  
  263. // ** ---> Entry Conditions ------------- {
  264.  
  265. //a = plot(filleshow ? ta.ema(high,5) : na,display = display.none,editable = false)
  266. //b = plot(filleshow ? ta.ema(low,10) : na,style = plot.style_stepline,color = color.red,display = display.none,editable = false)
  267.  
  268. // fill(a,b,color = color.from_gradient(rsi14,35,pmom,color.rgb(255, 82, 82, 66),color.rgb(76, 175, 79, 64)) )
  269. //fill(a,b,color = positive ? bull :bear ,editable = false)
  270.  
  271. //plotting
  272. longcondition = positive and not positive[1]
  273. shortcondition = negative and not negative[1]
  274.  
  275. //MACD
  276. FastLength = input(title="MACD Fast Length", group="MACD", defval=47)
  277. Slowlength = input(title="MACD Slow Length", group="MACD", defval=79)
  278. MACDLength = input(title="MACD Signal Length", group="MACD", defval=30)
  279.  
  280. MACD = ta.ema(close, FastLength) - ta.ema(close, Slowlength)
  281. aMACD = ta.ema(MACD, MACDLength)
  282. delta = MACD - aMACD
  283.  
  284.  
  285.  
  286. LongMACD = ta.crossover(delta, 0)
  287. ShortMACD = ta.crossunder(delta, 0)
  288.  
  289.  
  290.  
  291.  
  292. // Loxx supertrend
  293.  
  294. RMA(x, t) =>
  295. EMA1 = x
  296. EMA1 := na(EMA1[1]) ? x : (x - nz(EMA1[1])) * (1/t) + nz(EMA1[1])
  297. EMA1
  298.  
  299. fdip(float srcloxx, int per, int speedin)=>
  300. float fmax = ta.highest(srcloxx, per)
  301. float fmin = ta.lowest(srcloxx, per)
  302. float lengthloxx = 0
  303. float diff = 0
  304. for i = 1 to per - 1
  305. diff := (nz(srcloxx[i]) - fmin) / (fmax - fmin)
  306. if i > 0
  307. lengthloxx += math.sqrt( math.pow(nz(diff[i]) - nz(diff[i + 1]), 2) + (1 / math.pow(per, 2)))
  308. float fdi = 1 + (math.log(lengthloxx) + math.log(2)) / math.log(2 * per)
  309. float traildim = 1 / (2 - fdi)
  310. float alpha = traildim / 2
  311. int speed = math.round(speedin * alpha)
  312. speed
  313.  
  314. pine_supertrend(float srcloxx, float factor, int atrPeriod) =>
  315. float atr = RMA(ta.tr(true), atrPeriod)
  316. float upperBand = srcloxx + factor * atr
  317. float lowerBand = srcloxx - factor * atr
  318. float prevLowerBand = nz(lowerBand[1])
  319. float prevUpperBand = nz(upperBand[1])
  320.  
  321. lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
  322. upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
  323. int directionloxx = na
  324. float superTrend = na
  325. float prevSuperTrend = superTrend[1]
  326. if na(atr[1])
  327. directionloxx := 1
  328. else if prevSuperTrend == prevUpperBand
  329. directionloxx := close > upperBand ? -1 : 1
  330. else
  331. directionloxx := close < lowerBand ? 1 : -1
  332. superTrend := directionloxx == -1 ? lowerBand : upperBand
  333. [superTrend, directionloxx]
  334.  
  335. srcloxx = input.source(hl2, group = "Loxx")
  336. per = input.int(30, "Fractal Period Ingest", group = "Loxx")
  337. speed = input.int(20, "Speed", group = "Loxx")
  338.  
  339. //Loxx input
  340. multloxx5 = input.float(5 , "1st Multiplier", group = "Loxx", step=0.1) //~using the same step as supertrend and *2 to test the robustness = 0.05*2 = 0.1
  341. multloxx2 = input.float(2 , "2nd Multiplier", group = "Loxx", step=0.1) //~
  342. multloxx3 = input.float(3 , "3rd Multiplier", group = "Loxx", step=0.1) //~
  343. multloxx1825 = input.float(1.825, "4th Multiplier", group = "Loxx", step=0.1) //~
  344. adaptloxx = input.bool(true)
  345.  
  346. masterdom = fdip(srcloxx, per, speed)
  347. int lenloxx = math.floor(masterdom) < 1 ? 1 : math.floor(masterdom)
  348. lenloxx := nz(lenloxx, 1)
  349.  
  350. [supertrendloxx5, directionloxx] = pine_supertrend(srcloxx, multloxx5, adaptloxx ? lenloxx : per)
  351.  
  352. [supertrendloxx3, directionloxx3] = pine_supertrend(srcloxx, multloxx3, adaptloxx ? lenloxx : per)
  353.  
  354. [supertrendloxx2, directionloxx2] = pine_supertrend(srcloxx, multloxx2, adaptloxx ? lenloxx : per)
  355.  
  356. [supertrendloxx1825, directionloxx1825] = pine_supertrend(srcloxx, multloxx1825, adaptloxx ? lenloxx : per)
  357. // loxx_long = directionloxx == -1 and directionloxx[1] == 1
  358. // loxx_short = directionloxx == 1 and directionloxx[1] == -1
  359.  
  360. loxx_long = close > supertrendloxx5
  361. loxx_short = close < supertrendloxx5
  362.  
  363. loxx_long_2 = directionloxx2 == -1 and directionloxx2[1] == 1
  364. loxx_short_2 = directionloxx == 1 and directionloxx[1] == -1
  365.  
  366. loxx_long_3 = directionloxx3 == -1 and directionloxx3[1] == 1
  367. loxx_short_3 = close < supertrendloxx3
  368.  
  369. loxx_long_1_825 = close > supertrendloxx1825
  370. loxx_short_1_825 = close < supertrendloxx1825
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393. // {Gunzo} Trend Sniper
  394.  
  395. float ma_source = input(title='MA Source', defval=close,group = "Trend Sniper Settings")
  396. int ma_length = input.int(title='MA Length', defval=31, minval=1,group = "Trend Sniper Settings")
  397. int smoothing_length = input.int(title='MA Smooth ', defval=10, minval=1, maxval=10,group = "Trend Sniper Settings")
  398. coefficient = ma_length / 3.0
  399.  
  400. fn_calculate_wma_with_coefficient(source, length, coefficient) =>
  401.  
  402. candle_weighted_sum = 0.0
  403. total_weight = 0.0
  404.  
  405.  
  406. for i = 0 to length by 1
  407. candle_weight = length - i
  408. candle_weighted_sum += (candle_weight - coefficient) * source[i]
  409. total_weight += candle_weight - coefficient
  410. total_weight
  411.  
  412.  
  413. weighted_line = candle_weighted_sum / total_weight
  414.  
  415. [weighted_line]
  416.  
  417. [weighted_line] = fn_calculate_wma_with_coefficient(ma_source, ma_length, coefficient)
  418. weighted_line_smooth = ta.ema(weighted_line, smoothing_length)
  419.  
  420.  
  421. trend_up = weighted_line_smooth > weighted_line_smooth[1]
  422. trend_down = weighted_line_smooth < weighted_line_smooth[1]
  423.  
  424. //trend_up = ta.crossover(weighted_line_smooth, weighted_line_smooth[1])
  425. //t//rend_down = ta.crossunder(weighted_line_smooth, weighted_line_smooth[1])
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434. //longCondition =
  435. // STClong and ((DMIlong and DMIlong_2) or ((loxx_long_2 or loxx_long_3) and supertrend_Long and trend_up))
  436. // and (RSIema_long or RTIlong or roughlong or loxx_long or loxx_long_2 )
  437.  
  438. //shortCondition =
  439. // STCshort and (DMIshort and DMIshort_2) and (loxx_short_1_825 or loxx_short_3)
  440. // and (RSIema_short or RTIshort or roughshort or loxx_short or loxx_short_2 or (trend_down2 and trend_down2_2))
  441.  
  442.  
  443.  
  444.  
  445.  
  446. // Buy, Sell
  447. //psar
  448. start = input(0.02)
  449. increment = input(0.02)
  450. maximum = input(0.2)
  451.  
  452.  
  453.  
  454.  
  455. psar = ta.sar(start, increment, maximum)
  456.  
  457. // Signals
  458. psar_long = high[1] < psar[2] and high > psar[1]
  459. psar_short = low[1] > psar[2] and low < psar[1]
  460.  
  461.  
  462.  
  463. //RSI
  464. //RSI_Length = input.int(14, minval=1, group="RSI - Confluence 3")
  465. rsi1 = ta.rsi(close, 14)
  466. rsi_over_sold = rsi < 80
  467. rsi_over_bought = rsi > 20
  468. rsi_high = rsi1 > 21
  469. rsi_low = rsi1 < 79
  470.  
  471. //Momentum
  472. length4 = input.int(10, title="Momentum Length", minval=1, group="Momentum Indicator")
  473. price = close
  474. momentum(seria, length4) =>
  475. mom = seria - seria[length4]
  476. mom
  477. mom0 = momentum(price, length4)
  478. mom1 = momentum( mom0, 1)
  479. mom_long = (mom0 > 0 and mom1 > 0)
  480.  
  481.  
  482. mom_short = (mom0 < 0 and mom1 < 0)
  483.  
  484.  
  485. ///mfi
  486. length = input.int(title="Length", defval=14, minval=1, maxval=2000)
  487. src = hlc3
  488. mf = ta.mfi(src, length)
  489. plot(mf, "MF", color=#7E57C2)
  490. overbought=hline(80, title="Overbought", color=#787B86)
  491. hline(50, "Middle Band", color=color.new(#787B86, 50))
  492. oversold=hline(20, title="Oversold", color=#787B86)
  493. fill(overbought, oversold, color=color.rgb(126, 87, 194, 90), title="Background")
  494.  
  495. longmfi=ta.crossover(mf,50)
  496. shortmfi=ta.crossunder(mf,50)
  497.  
  498. length1 = input.int(12, minval=1)
  499. source = input(close, "Source")
  500. roc = 100 * (source - source[length1])/source[length1]
  501. plot(roc, color=#2962FF, title="ROC")
  502. hline(0, color=#787B86, title="Zero Line")
  503.  
  504. longroc=ta.crossover(roc,0)
  505. shortroc=ta.crossunder(roc,0)
  506.  
  507.  
  508.  
  509.  
  510.  
  511. buy_signal = stc_long and aroon_long
  512.  
  513. sell_signal = stc_short and aroon_short
  514.  
  515.  
  516. if barstate.isconfirmed and isInTimeRange and buy_signal
  517. strategy.entry("Long", strategy.long)
  518.  
  519.  
  520. if barstate.isconfirmed and isInTimeRange and sell_signal
  521. strategy.entry("Short", strategy.short)
  522.  
  523.  
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