igorkrnic

Untitled

Jun 23rd, 2022
112
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.57 KB | None | 0 0
  1. //@version=5
  2.  
  3. //---------------------------------//YT: 1min Scalping Strategy\\---------------------------------\\
  4.  
  5. strategy('Minute Master Pro v5', process_orders_on_close=true, overlay = true)
  6.  
  7. //---------------------------------//Options\\---------------------------------\\
  8. // Session Filter
  9. showsession = input.bool(defval=false, title='', inline='Session')
  10. session2 = input.session(defval='0000-0000', title='Session Timings(to avoid trades)', inline='Session')
  11.  
  12. rr = input.float(defval=1, minval=0.1, step = 0.1, title = "Risk : Reward = 1 : ", group = "Strategy Options") // input rr for tp
  13. sloption = input.string(defval='ATR', title='SL ', group = "Strategy Options") // sl options
  14. sltext = input.float(defval=0.85,minval=0.1,step=0.1,title="ATR Multiplier", group = "Strategy Options") // atr multilier input
  15. atrlength = input.int(defval=14, title='ATR Length', group='Strategy Options')
  16. emaFilter = input.int(title='EMA Filter', defval=0, group='Strategy Options', tooltip='EMA length to filter trades - set to zero to disable')
  17. lookback = input.int(defval=1, minval=0, step=1, title='ADX Lookback', group='Strategy Options')
  18. candlesize = input.float(defval=0.009, minval=0, step=0.001, title='Big Ass Candle Filter', group='Strategy Options', tooltip='Please refer to Candle Size AP Indicator for reference')
  19. useexitcond = input(defval=false, title='Use Exit Condition', tooltip=' Set RR to 10! Strategy Dashboard Results inaccurate')
  20.  
  21. // Backtester Settings
  22. var g_tester = 'Backtester Settings'
  23. startBalance = input.float(title='Starting Balance', defval=10000.0, group=g_tester, tooltip='Your starting balance for the custom inbuilt tester system')
  24. riskPerTrade = input.float(title='Risk Per Trade', defval=1.0, group=g_tester, tooltip='Your desired % risk per trade (as a whole number)')
  25. drawTester = input.bool(title='Draw Backtester', defval=true, group=g_tester, tooltip='Turn on/off inbuilt backtester display')
  26.  
  27. //------------------------//Backtester Options\\------------------------\\
  28.  
  29. var g_filter = 'Filter Settings'
  30. i_startTime = input.time(title='Start Date Filter', defval=timestamp('01 Jan 2000 13:30 +0000'), group=g_filter, tooltip='Date & time to begin trading from')
  31. i_endTime = input.time(title='End Date Filter', defval=timestamp('1 Jan 2099 19:30 +0000'), group=g_filter, tooltip='Date & time to stop trading')
  32.  
  33.  
  34. //-----------------------------//EMA Filter\\---------------------------------\\
  35.  
  36. ema = ta.ema(close, emaFilter == 0 ? 1 : emaFilter)
  37.  
  38. //-----------------------------// Filter\\---------------------------------\\
  39.  
  40. TF_1_time = input.timeframe("1", "Timeframe 1")
  41. TF_2_time = input.timeframe("10", "Timeframe 2")
  42. TF_3_time = input.timeframe("15", "Timeframe 3")
  43. TF_4_time = input.timeframe("30", "Timeframe 4")
  44.  
  45. //========================================================================================================================================================================
  46. /// Making the colours
  47. //========================================================================================================================================================================
  48.  
  49. upcolor = #00FF00
  50. downcolor = #f23645
  51. sidecolor = #FFFF00
  52. whitecolor = #ffffff
  53. //========================================================================================================================================================================
  54. /// Calling HTF's
  55. //========================================================================================================================================================================
  56.  
  57.  
  58.  
  59. TF_1 = request.security(syminfo.tickerid, TF_1_time, open) < request.security(syminfo.tickerid, TF_1_time, close) ? true:false
  60. TF_2 = request.security(syminfo.tickerid, TF_2_time, open) < request.security(syminfo.tickerid, TF_2_time, close) ? true:false
  61. TF_3 = request.security(syminfo.tickerid, TF_3_time, open) < request.security(syminfo.tickerid, TF_3_time, close) ? true:false
  62. TF_4 = request.security(syminfo.tickerid, TF_4_time, open) < request.security(syminfo.tickerid, TF_4_time, close) ? true:false
  63.  
  64.  
  65.  
  66. TF_global = TF_1 and TF_2 and TF_3 and TF_4
  67. TF_global_bear = TF_1 == false and TF_2 == false and TF_3 == false and TF_4 == false
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. exitCondition_Long = TF_global_bear
  75. exitCondition_Short = TF_global
  76.  
  77.  
  78. //==========================================================================================================================================================================
  79. /// BULLTRADING HULL MA's
  80. //==========================================================================================================================================================================
  81. smooth = input(title='MTF Hull Smooth', defval=true)
  82. //==========================================================================================================================================================================
  83. //1st hull
  84. //==========================================================================================================================================================================
  85.  
  86. hull_1_res = '1'// input.timeframe('1', "Hull 1st Resolution")
  87. hull_1_src_fast = request.security(syminfo.tickerid, hull_1_res, close)
  88. hull_1_src_slow = request.security(syminfo.tickerid, hull_1_res, close[1])
  89.  
  90. hull_1_length = 840//input.int(840, minval=1) //2640
  91.  
  92. hull_1_fast = ta.wma(2*ta.wma(hull_1_src_fast, hull_1_length/2)-ta.wma(hull_1_src_fast, hull_1_length), math.floor(math.sqrt(hull_1_length)))
  93. hull_1_slow = ta.wma(2*ta.wma(hull_1_src_slow, hull_1_length/2)-ta.wma(hull_1_src_slow, hull_1_length), math.floor(math.sqrt(hull_1_length)))
  94.  
  95. hull_1_fast_Smooth = request.security(syminfo.tickerid, hull_1_res, hull_1_fast, barmerge.gaps_on, barmerge.lookahead_off)
  96. hull_1_fast_Step = request.security(syminfo.tickerid, hull_1_res, hull_1_fast, barmerge.gaps_off, barmerge.lookahead_off)
  97.  
  98. hull_1_slow_Smooth = request.security(syminfo.tickerid, hull_1_res, hull_1_slow, barmerge.gaps_on, barmerge.lookahead_off)
  99. hull_1_slow_Step = request.security(syminfo.tickerid, hull_1_res, hull_1_slow, barmerge.gaps_off, barmerge.lookahead_off)
  100.  
  101. //==========================================================================================================================================================================
  102. //2nd hull
  103. //==========================================================================================================================================================================
  104. hull_2_res = '1' //input.timeframe('1', "Hull 2nd Resolution")
  105. hull_2_src_fast = request.security(syminfo.tickerid, hull_2_res, close)
  106. hull_2_src_slow = request.security(syminfo.tickerid, hull_2_res, close[1])
  107.  
  108. hull_2_length = 144//input.int(144, minval=1)
  109.  
  110. hull_2_fast = ta.wma(2*ta.wma(hull_2_src_fast, hull_2_length/2)-ta.wma(hull_2_src_fast, hull_2_length), math.floor(math.sqrt(hull_2_length)))
  111. hull_2_slow = ta.wma(2*ta.wma(hull_2_src_slow, hull_2_length/2)-ta.wma(hull_2_src_slow, hull_2_length), math.floor(math.sqrt(hull_2_length)))
  112.  
  113. hull_2_fast_Smooth = request.security(syminfo.tickerid, hull_2_res, hull_2_fast, barmerge.gaps_on, barmerge.lookahead_off)
  114. hull_2_fast_Step = request.security(syminfo.tickerid, hull_2_res, hull_2_fast, barmerge.gaps_off, barmerge.lookahead_off)
  115.  
  116. hull_2_slow_Smooth = request.security(syminfo.tickerid, hull_2_res, hull_2_slow, barmerge.gaps_on, barmerge.lookahead_off)
  117. hull_2_slow_Step = request.security(syminfo.tickerid, hull_2_res, hull_2_slow, barmerge.gaps_off, barmerge.lookahead_off)
  118.  
  119. //==========================================================================================================================================================================
  120. //3rd hull
  121. //==========================================================================================================================================================================
  122.  
  123. hull_3_res = input.timeframe('1', "Hull 3rd Resolution")
  124. hull_3_src_fast = request.security(syminfo.tickerid, hull_3_res, close)
  125. hull_3_src_slow = request.security(syminfo.tickerid, hull_3_res, close[1])
  126.  
  127. hull_3_length = input.int(88, minval=1) //2640
  128.  
  129. hull_3_fast = ta.wma(2*ta.wma(hull_3_src_fast, hull_3_length/2)-ta.wma(hull_3_src_fast, hull_3_length), math.floor(math.sqrt(hull_3_length)))
  130. hull_3_slow = ta.wma(2*ta.wma(hull_3_src_slow, hull_3_length/2)-ta.wma(hull_3_src_slow, hull_3_length), math.floor(math.sqrt(hull_3_length)))
  131.  
  132. hull_3_fast_Smooth = request.security(syminfo.tickerid, hull_3_res, hull_3_fast, barmerge.gaps_on, barmerge.lookahead_off)
  133. hull_3_fast_Step = request.security(syminfo.tickerid, hull_3_res, hull_3_fast, barmerge.gaps_off, barmerge.lookahead_off)
  134.  
  135. hull_3_slow_Smooth = request.security(syminfo.tickerid, hull_3_res, hull_3_slow, barmerge.gaps_on, barmerge.lookahead_off)
  136. hull_3_slow_Step = request.security(syminfo.tickerid, hull_3_res, hull_3_slow, barmerge.gaps_off, barmerge.lookahead_off)
  137. //==========================================================================================================================================================================
  138. //Hull colors
  139. //==========================================================================================================================================================================
  140. col_hull_1 = hull_1_fast_Smooth > hull_1_slow_Smooth? color.lime : color.red
  141. col_hull_2 = hull_2_fast_Smooth > hull_2_slow_Smooth? color.lime : color.red
  142. col_hull_3 = hull_3_fast_Smooth > hull_3_slow_Smooth? color.lime : color.red
  143. //==========================================================================================================================================================================
  144. //Hull plots
  145. //==========================================================================================================================================================================
  146. //plot(smooth ? hull_1_fast_Smooth : hull_1_fast_Step, color= col_hull_1, style=plot.style_line, linewidth=1, title='1st Hull')
  147. //plot(smooth ? hull_2_fast_Smooth : hull_2_fast_Step, color= col_hull_2, style=plot.style_line, linewidth=1, title='2nd Hull')
  148. plot(smooth ? hull_3_fast_Smooth : hull_3_fast_Step, color= col_hull_3, style=plot.style_line, linewidth=1, title='3rd Hull')
  149.  
  150.  
  151.  
  152.  
  153. ////////////////////////////////////
  154. ////-ATR-///////////////////////////
  155. ////////////////////////////////////
  156.  
  157. length = input.int(title='Length', defval=14, minval=1)
  158. smoothing = input.string(title='Smoothing', defval='RMA', options=['RMA', 'SMA', 'EMA', 'WMA'])
  159. m = input(0.85, 'Multiplier')
  160. src1 = input(high)
  161. src2 = input(low)
  162. pline = input(false, 'Show Price Lines')
  163. col1 = input(color.blue, 'ATR Text Color')
  164. col2 = input.color(color.teal, 'Low Text Color', inline='1')
  165. col3 = input.color(color.red, 'High Text Color', inline='2')
  166.  
  167. collong = input.color(color.purple, 'Low Line Color', inline='1')
  168. colshort = input.color(color.purple, 'High Line Color', inline='2')
  169.  
  170. ma_function(source, length) =>
  171. if smoothing == 'RMA'
  172. ta.rma(source, length)
  173. else
  174. if smoothing == 'SMA'
  175. ta.sma(source, length)
  176. else
  177. if smoothing == 'EMA'
  178. ta.ema(source, length)
  179. else
  180. ta.wma(source, length)
  181.  
  182. a = ma_function(ta.tr(true), length) * m
  183. x = ma_function(ta.tr(true), length) * m + src1
  184. x2 = src2 - ma_function(ta.tr(true), length) * m
  185.  
  186. p1 = plot(x, title='ATR Short Stop Loss', color=colshort, trackprice=pline ? true : false, transp=20)
  187. p2 = plot(x2, title='ATR Long Stop Loss', color=collong, trackprice=pline ? true : false, transp=20)
  188.  
  189. longCondition = TF_global and hull_2_fast_Smooth > hull_2_fast_Step
  190.  
  191.  
  192. shortCondition = TF_global_bear and hull_2_fast_Smooth < hull_2_fast_Step
  193.  
  194. barcolor(TF_global?upcolor:TF_global_bear?downcolor:sidecolor)
  195.  
  196. //---------------------------------//ADX Code\\---------------------------------\\
  197.  
  198. len = input(14, title='ADX Length', group='ADX Settings')
  199. th = input(20, title='ADX threshold', group='ADX Settings')
  200.  
  201. TrueRange = math.max(math.max(high - low, math.abs(high - nz(close[1]))), math.abs(low - nz(close[1])))
  202. DirectionalMovementPlus = high - nz(high[1]) > nz(low[1]) - low ? math.max(high - nz(high[1]), 0) : 0
  203. DirectionalMovementMinus = nz(low[1]) - low > high - nz(high[1]) ? math.max(nz(low[1]) - low, 0) : 0
  204.  
  205. SmoothedTrueRange = 0.0
  206. SmoothedTrueRange := nz(SmoothedTrueRange[1]) - nz(SmoothedTrueRange[1]) / len + TrueRange
  207.  
  208. SmoothedDirectionalMovementPlus = 0.0
  209. SmoothedDirectionalMovementPlus := nz(SmoothedDirectionalMovementPlus[1]) - nz(SmoothedDirectionalMovementPlus[1]) / len + DirectionalMovementPlus
  210.  
  211. SmoothedDirectionalMovementMinus = 0.0
  212. SmoothedDirectionalMovementMinus := nz(SmoothedDirectionalMovementMinus[1]) - nz(SmoothedDirectionalMovementMinus[1]) / len + DirectionalMovementMinus
  213.  
  214. DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
  215. DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
  216. DX = math.abs(DIPlus - DIMinus) / (DIPlus + DIMinus) * 100
  217. ADX = ta.sma(DX, len)
  218.  
  219. //plot(DIPlus, color=color.new(color.green, 0), title='DI+')
  220. //plot(DIMinus, color=color.new(color.red, 0), title='DI-')
  221. //plot(ADX, color=color.new(color.navy, 0), title='ADX')
  222. //hline(th, color=color.black)
  223.  
  224. //---------------------------------//ATR Code\\---------------------------------\\
  225.  
  226. //lengthatr = input.int(title="Length", defval=14, minval=1, group = "ATR Settings")
  227. smoothing1 = input.string(title="Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"], group = "ATR Settings")
  228. ma_function1(source, lengthatr) =>
  229. switch smoothing1
  230. "RMA" => ta.rma(source, atrlength)
  231. "SMA" => ta.sma(source, atrlength)
  232. "EMA" => ta.ema(source, atrlength)
  233. => ta.wma(source, atrlength)
  234.  
  235. atr1=(ma_function1(ta.tr(true), atrlength))*sltext
  236.  
  237. //---------------------------------//Candle Size\\---------------------------------\\
  238.  
  239. open_pos = open * 1
  240. close_pos = close * 1
  241.  
  242. // Body size as a percentage of the total candle
  243. diffcandle = math.abs(close_pos - open_pos)
  244.  
  245. //---------------------------------//Logic\\---------------------------------\\
  246.  
  247. // See if bar's time happened within the time filter
  248. session = time('1', session2 + string(':1234567'), str.tostring(syminfo.timezone))
  249. sessioncond = showsession ? not session : true
  250.  
  251.  
  252. // See if this bar's time happened within date filter
  253. dateFilter = time >= i_startTime and time <= i_endTime
  254.  
  255. // Check Candle Size
  256. candlesizefilter= diffcandle <= candlesize
  257.  
  258. // Check EMA Filter
  259. emaFilterLong = emaFilter == 0 or close > ema
  260. emaFilterShort = emaFilter == 0 or close < ema
  261.  
  262. // Check ADX
  263. adxlongcond = ta.crossover(DIPlus, DIMinus) or ta.barssince(ta.crossover(DIPlus, DIMinus)) < lookback
  264. adxshortcond = ta.crossunder(DIPlus, DIMinus) or ta.barssince(ta.crossunder(DIPlus, DIMinus)) < lookback
  265.  
  266. // Check Trend Filter
  267. trendfilterlong= hull_3_fast_Smooth > hull_3_slow_Smooth
  268. trendfiltershort= hull_3_fast_Smooth < hull_3_slow_Smooth
  269.  
  270. // Check Candle Color
  271. longfilter=TF_global
  272. shortfilter=TF_global_bear
  273.  
  274. // Determine if we have a valid setup
  275. validBullSignal = trendfilterlong and longfilter and adxlongcond and emaFilterLong and sessioncond and dateFilter and candlesizefilter and close != open and close > open
  276. validBearSignal = trendfiltershort and shortfilter and adxshortcond and emaFilterShort and sessioncond and dateFilter and candlesizefilter and close != open and close < open
  277.  
  278. // Check if we have confirmation for our setup
  279. validLong = validBullSignal and strategy.position_size == 0 and barstate.isconfirmed
  280. validShort = validBearSignal and strategy.position_size == 0 and barstate.isconfirmed
  281.  
  282. // Calculate our stop distance & size for the current bar
  283. stopSize = atr1
  284. longStopPrice = low < low[1] ? low - stopSize : low[1] - stopSize
  285. longStopDistance = close - longStopPrice
  286. longTargetPrice = close + longStopDistance * rr
  287. shortStopPrice = high > high[1] ? high + stopSize : high[1] + stopSize
  288. shortStopDistance = shortStopPrice - close
  289. shortTargetPrice = close - shortStopDistance * rr
  290.  
  291. // Save trade stop & target & position size if a valid setup is detected
  292. var t_entry = 0.0
  293. var t_stop = 0.0
  294. var t_target = 0.0
  295. var t_direction = 0
  296.  
  297. // Detect valid long setups & trigger alert
  298. if validLong
  299. t_entry := close
  300. t_stop := longStopPrice
  301. t_target := longTargetPrice
  302. t_direction := 1
  303. strategy.entry(id='Long', direction=strategy.long, when=validLong)
  304. alert(message= "Long Entry", freq=alert.freq_once_per_bar_close)
  305.  
  306. // Detect valid short setups & trigger alert
  307. if validShort
  308. t_entry := close
  309. t_stop := shortStopPrice
  310. t_target := shortTargetPrice
  311. t_direction := -1
  312. strategy.entry(id='Short', direction=strategy.short, when=validShort)
  313. alert(message= "Short Entry", freq=alert.freq_once_per_bar_close)
  314.  
  315. longexitcond = useexitcond ? adxshortcond and strategy.openprofit >= 0 : false
  316. shortexitcond = useexitcond ? adxlongcond and strategy.openprofit >= 0 : false
  317.  
  318. if (strategy.position_size>0 and longexitcond)
  319. strategy.close_all(comment = "Exit Long", alert_message = "Exit Long")
  320.  
  321. if (strategy.position_size < 0 and shortexitcond)
  322. strategy.close_all(comment = "Exit Short", alert_message = "Exit Short")
  323.  
  324. // Exit trades whenever our stop or target is hit
  325. strategy.exit(id='Long Exit', from_entry='Long', limit=t_target, stop=t_stop, when=strategy.position_size > 0)
  326. strategy.exit(id='Short Exit', from_entry='Short', limit=t_target, stop=t_stop, when=strategy.position_size < 0)
  327.  
  328. // Draw trade data
  329. sl=plot(strategy.position_size != 0 or validLong or validShort ? t_stop : na, title='Trade Stop Price', color=color.new(color.red, 0), style=plot.style_linebr)
  330. entry=plot(strategy.position_size != 0 or validLong or validShort ? t_entry : na, title='Trade Stop Price', color=color.new(color.white, 50), style=plot.style_linebr)
  331. tp=plot(strategy.position_size != 0 or validLong or validShort ? t_target : na, title='Trade Target Price', color=color.new(color.green, 0), style=plot.style_linebr)
  332. fill(sl, entry, color=color.new(color.red, 80))
  333. fill(tp, entry, color=color.new(color.green, 80))
  334.  
  335. // Draw EMA if it's enabled
  336. plot(emaFilter == 0 ? na : ema, color=emaFilterLong ? color.green : color.red, linewidth=2, title='EMA')
  337.  
  338. //---------------------------------//Dashbaord\\---------------------------------\\
  339.  
  340. // Custom function to truncate (cut) excess decimal places
  341. truncate(_number, _decimalPlaces) =>
  342. _factor = math.pow(10, _decimalPlaces)
  343. int(_number * _factor) / _factor
  344.  
  345. // --- BEGIN TESTER CODE --- //
  346. // Declare performance tracking variables
  347. var balance = startBalance
  348. var drawdown = 0.0
  349. var maxDrawdown = 0.0
  350. var maxBalance = 0.0
  351. var totalPips = 0.0
  352. var totalWins = 0
  353. var totalLoss = 0
  354.  
  355. // Detect winning trades
  356. if strategy.wintrades != strategy.wintrades[1]
  357. balance += riskPerTrade / 100 * balance * rr
  358. //totalPips += math.abs(t_entry - t_target)
  359. totalWins += 1
  360. if balance > maxBalance
  361. maxBalance := balance
  362. maxBalance
  363.  
  364. // Detect losing trades
  365. if strategy.losstrades != strategy.losstrades[1]
  366. balance -= riskPerTrade / 100 * balance
  367. //totalPips -= math.abs(t_entry - t_stop)
  368. totalLoss += 1
  369. // Update drawdown
  370. drawdown := balance / maxBalance - 1
  371. if drawdown < maxDrawdown
  372. maxDrawdown := drawdown
  373. maxDrawdown
  374.  
  375. // ProfitFactor returns the strategy's current profit factor,
  376. ProfitFactor = strategy.grossprofit / strategy.grossloss
  377.  
  378. maxloss = math.round(maxDrawdown*(-100))/riskPerTrade
  379.  
  380. winrate = (strategy.wintrades / strategy.closedtrades) * 100
  381.  
  382. initbalance = startBalance
  383.  
  384.  
  385. // Prepare stats table
  386. var table testTable = table.new(position.top_right, 5, 3, border_width=1)
  387. f_fillCell(_table, _column, _row, _title, _value, _bgcolor, _txtcolor) =>
  388. _cellText = _title + '\n' + _value
  389. table.cell(_table, _column, _row, _cellText, bgcolor=_bgcolor, text_color=_txtcolor)
  390.  
  391. // Draw stats table
  392. var bgcolor = color.new(color.black, 0)
  393. if drawTester
  394. if barstate.islastconfirmedhistory
  395. // Update table
  396. dollarReturn = balance - startBalance
  397. f_fillCell(testTable, 0, 0, 'Backtest', str.tostring(syminfo.tickerid) , color.blue, color.white)
  398. f_fillCell(testTable, 0, 1, 'Minute Master', str.tostring(timeframe.period) + 'M' , color.blue, color.white)
  399. f_fillCell(testTable, 1, 0, 'Total Trades:', str.tostring(strategy.closedtrades), bgcolor, color.white)
  400. f_fillCell(testTable, 1, 1, 'Win Rate:', str.tostring(truncate(winrate, 2)) + '%', winrate > 40 ? color.green : color.red, color.white)// bgcolor, color.white)
  401. f_fillCell(testTable, 2, 0, 'Starting:', '$' + str.tostring(startBalance), bgcolor, color.white)
  402. f_fillCell(testTable, 2, 1, 'Ending:', '$' + str.tostring(truncate(balance, 2)), balance > initbalance ? color.green : color.red, color.white)
  403. f_fillCell(testTable, 3, 0, 'Profit Factor:', str.tostring(truncate(ProfitFactor, 2)), ProfitFactor > 0 ? color.green : color.red, color.white)
  404. f_fillCell(testTable, 3, 1, 'Consec. Loss:', str.tostring(maxloss), maxloss <= 5 ? color.green : color.red, color.white)//color.new(color.red,50), bgcolor, color.white)
  405. f_fillCell(testTable, 4, 0, 'Return:', (dollarReturn > 0 ? '+' : '') + str.tostring(truncate(dollarReturn / startBalance * 100, 2)) + '%', dollarReturn > 0 ? color.green : color.red, color.white)
  406. f_fillCell(testTable, 4, 1, 'Max DD:', str.tostring(truncate(maxDrawdown * 100, 2)) + '%', color.red, color.white)
  407.  
  408.  
  409.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment