Advertisement
Maurizio-Ciullo

Bot Over The Clouds ETH/USDT.P BYBIT 4H LONG E SHORT

Jun 8th, 2023 (edited)
1,644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © Maurizio-Ciullo
  3.  
  4.                                     // Versione con uscita chiusuara sotto la baseline //
  5.  
  6. // Il trading system completo - Over The Clouds ETH/USDT.P BYBIT 4H LONG E SHORT (Trend Following)
  7. // (Sviluppo Dati Exchange = BINANCE + BYBIT) (BINANCE Dal=18/08/2017 Al 21/10/2020) (BYBIT Dal=21/10/2020 Al 20/05/2023)
  8. // (Exchange= BYBIT) (Sottostante ETH-USDT.P) (Timeframe= 4H) (Direzione= LONG E SHORT) (Swing Posizione= SI) (Esclusione Ore=NO) (Esclusione Giorni=NO) (Esclusione Mesi=NO)
  9. // (Take Profit Long/Short Market = NO) (Take Profit Limit Long/Short= NO)
  10. // (Stop Loss Limit Long= NO) (Stop Loss Limit Short= NO) (Stop Loss Market Long/Short= SI) (Trailing Stop Market=SI) (Stop Emergenza= NO)
  11. // (Rischio Operazione 2% Perdita Media Calcolato Sul Ticker: ETHUSDT BINANCE SPOT) (Max Drawdown Permesso 10,03% Calcolato Sul Ticker: ETHUSDT.P BYBIT CHE E' IL PEGGIORE DELLE ENTRIES MODE)
  12. // (In Sample Dal=18/08/17 Al 12/07/22) (Out Of Sample Dal=12/07/22 Al 20/05/23)
  13. // (Money Management = 23% Del Capitale)
  14. // (Money Management = 25% Del Capitale Tradestation)
  15. // (Progettatta Il=07/07/23)
  16.  
  17. // Caricamento Dati Bybit Su Tradestation: Exchange Time, Regular Session, 7x7 23:00 23:00, Session Hour.
  18. // Auentare il Max Bars Back A 75 Su Tradestation Altrimenti Non Funziona E Cliccare Su Enable Strategy Altrimenti Non Parte
  19.  
  20.                                                     // ATTENZIONE //
  21. // Quando si mette la strategia live, ricordarsi di impostare 1 solo input "quello che vogliamo utilizzare come normal/ more_aggressive/less_aggressive entries" su true e
  22. // impostare gli altri su false. Commentare anche i BUY COMMAND che non utilizziamo.
  23.  
  24. //@version=5
  25. strategy(title='Bot Over-The-Clouds ETH/USDT.P BYBIT 4H LONG E SHORT', overlay=true,
  26.          //max_bars_back=5000, // Serve Per Caricare Più Storico Per Il Trailing Stop
  27.          pyramiding=0,
  28.          initial_capital=1000,
  29.          commission_type=strategy.commission.percent,
  30.          commission_value=0.1,
  31.          slippage=3,
  32.          default_qty_type=strategy.percent_of_equity,
  33.          precision=2,
  34.          default_qty_value=23)
  35.  
  36.  
  37. // Inputs
  38. onlyLong = input.bool(title='Solo long', defval=false, inline='1', group='Direction')
  39. onlyShort = input.bool(title='Solo short', defval=false, inline='1', group='Direction')
  40. in_normal = input.bool(title="normal entry mode", defval=true, tooltip = "Entry Conditions Choice", inline='1', group='Aggresivity Entries Noraml')
  41. in_more_aggressive = input.bool(title="more aggressive entry mode", defval=false, tooltip = "Entry Conditions Choice", inline='1', group='Aggresivity Entries Aggresive')
  42. in_less_aggressive = input.bool(title="less aggressive entry mode", defval=false, tooltip = "Entry Conditions Choicee", inline='1', group='Aggresivity Entries Less Aggressive')
  43. in_ema_long = input.int(title='in_ema_long', defval=84, minval=0, maxval=300, step=1, inline='1', group='Ema Lenght')
  44. in_ema_short = input.int(title='in_ema_short', defval=83, minval=0, maxval=300, step=1, inline='1', group='Ema Lenght')
  45.  
  46.  
  47. // Calcolo del range del backtest
  48. startDate = input.int(title='Start Date', defval=17, minval=1, maxval=31, group='Time Window')
  49. startMonth = input.int(title='Start Month', defval=08, minval=1, maxval=12, group='Time Window')
  50. startYear = input.int(title='Start Year', defval=2000, minval=1800, maxval=2100, group='Time Window')
  51.  
  52. endDate = input.int(title='End Date', defval=01, minval=1, maxval=31, group='Time Window')
  53. endMonth = input.int(title='End Month', defval=01, minval=1, maxval=12, group='Time Window')
  54. endYear = input.int(title='End Year', defval=2121, minval=1800, maxval=2150, group='Time Window')
  55.  
  56.  
  57. inDateRange = time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0) and time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0)
  58.  
  59.  
  60. // Start Hour Range Trading Non Attivo /////////////////////
  61. //hourTrading = input(title='sessione valida di trading', defval='0600-2300:23456')
  62. //hourRangeTrading = time(timeframe.period, hourTrading)
  63.  
  64.  
  65. // Start Detecting Ichimoku Cloud //
  66. conversionPeriods = input.int(9, minval=1, title="Conversion Line Periods", group='Ichomoku'),
  67. basePeriods = input.int(26, minval=1, title="Base Line Periods", group='Ichomoku')
  68. laggingSpan2Periods = input.int(52, minval=1, title="Lagging Span 2 Periods", group='Ichomoku'),
  69. displacement = input.int(26, minval=1, title="Displacement", group='Ichomoku')
  70.  
  71. donchian(len) => math.avg(ta.lowest(len), ta.highest(len))
  72.  
  73. conversionLine = donchian(conversionPeriods)
  74. baseLine = donchian(basePeriods)
  75. spanA = math.avg(conversionLine, baseLine)
  76. spanB = donchian(laggingSpan2Periods)
  77. StdLine = (ta.highest(high, 52) + ta.lowest(low, 52)) / 2
  78. plot(conversionLine, title="Conversion Line", color=#0496ff)
  79. plot(baseLine, color=#991515, title="Base Line")
  80. plot(close, title="Lagging Span", offset = -displacement + 1, color=#459915)
  81.  
  82. p1 = plot(spanA, offset = displacement - 1, color=color.green,
  83.  title="Plot Span A")
  84. p2 = plot(spanB, offset = displacement - 1, color=color.red,
  85.  title="Plot Span B")
  86. fill(p1, p2, color = spanA > spanB ? color.green : color.red)
  87. // plot(spanA[25], title="Span A", color=color.orange)
  88. // plot(spanB[25],  title="Span B",color=color.yellow)
  89. // plot(spanA, title="Span A No 25 Offset", color=color.rgb(218, 16, 253))
  90. // plot(spanB, title="Span B No 25 Offset", color=color.rgb(218, 16, 253))
  91. // End Detecting Ichimoku Cloud //
  92.  
  93.  
  94. // Start Detecting ATR Long Normal //
  95. in_length_atr_long_normal = input.int(title="Atr Length_long_normal", defval=11, minval=0, group='Atr Long Normal')
  96. in_smoothing_atr_long_normal = input.string(title="Smoothing_atr_long_normal", defval="SMA", options=["RMA", "SMA", "EMA", "WMA"], group='Atr Long Normal')
  97. ma_function_long(source, in_length_atr_long_normal) =>
  98.     switch in_smoothing_atr_long_normal
  99.         "RMA" => ta.rma(source, in_length_atr_long_normal)
  100.         "SMA" => ta.sma(source, in_length_atr_long_normal)
  101.         "EMA" => ta.ema(source, in_length_atr_long_normal)
  102.         => ta.wma(source, in_length_atr_long_normal)
  103. plot(ma_function_long(ta.tr(true), in_length_atr_long_normal), title = "ATR_long_normal", color=color.new(#ca5555, 0))
  104. // End Detecting ATR Long Normal //
  105.  
  106. // Start Detecting ATR Long More Aggressive //
  107. in_length_atr_long_more_aggressive = input.int(title="Atr Length_long_more_aggressive", defval=7, minval=0, group='Atr Long More Aggresive')
  108. in_smoothing_atr_long_more_aggressive = input.string(title="Smoothing_atr_long_more_aggressive", defval="SMA", options=["RMA", "SMA", "EMA", "WMA"], group='Atr Long More Aggresive')
  109. ma_function_long_more_aggressive(source, in_length_atr_long_more_aggressive) =>
  110.     switch in_smoothing_atr_long_more_aggressive
  111.         "RMA" => ta.rma(source, in_length_atr_long_more_aggressive)
  112.         "SMA" => ta.sma(source, in_length_atr_long_more_aggressive)
  113.         "EMA" => ta.ema(source, in_length_atr_long_more_aggressive)
  114.         => ta.wma(source, in_length_atr_long_more_aggressive)
  115. plot(ma_function_long_more_aggressive(ta.tr(true), in_length_atr_long_more_aggressive), title = "ATR_long_more_aggressive", color=color.new(#ff4646, 0))
  116. // End Detecting ATR Long More Aggressive //
  117.  
  118. // Start Detecting ATR Long Less Aggressive //
  119. in_length_atr_long_less_aggressive = input.int(title="Atr Length_long_less_aggressive", defval=12, minval=0, group='Atr Long Less Aggresive')
  120. in_smoothing_atr_long_less_aggressive = input.string(title="Smoothing_atr_long_less_aggressive", defval="SMA", options=["RMA", "SMA", "EMA", "WMA"], group='Atr Long Less Aggresive')
  121. ma_function_long_less_aggressive(source, in_length_atr_long_less_aggressive) =>
  122.     switch in_smoothing_atr_long_less_aggressive
  123.         "RMA" => ta.rma(source, in_length_atr_long_less_aggressive)
  124.         "SMA" => ta.sma(source, in_length_atr_long_less_aggressive)
  125.         "EMA" => ta.ema(source, in_length_atr_long_less_aggressive)
  126.         => ta.wma(source, in_length_atr_long_less_aggressive)
  127. plot(ma_function_long_less_aggressive(ta.tr(true), in_length_atr_long_less_aggressive), title = "ATR_long_less__aggressive", color=color.new(#ff4646, 0))
  128. // End Detecting ATR Long Less Aggressive //
  129.  
  130.  
  131. // Start Detecting ATR Short //
  132. in_length_atr_short = input.int(title="Atr Length_short", defval=11, minval=0, group='Atr Short')
  133. in_smoothing_atr_short = input.string(title="Smoothing_atr_short", defval="SMA", options=["RMA", "SMA", "EMA", "WMA"], group='Atr Short')
  134. ma_function_short(source, in_length_atr_short) =>
  135.     switch in_smoothing_atr_short
  136.         "RMA" => ta.rma(source, in_length_atr_short)
  137.         "SMA" => ta.sma(source, in_length_atr_short)
  138.         "EMA" => ta.ema(source, in_length_atr_short)
  139.         => ta.wma(source, in_length_atr_short)
  140. plot(ma_function_short(ta.tr(true), in_length_atr_short), title = "ATR_short", color=color.new(#B71C1C, 0))
  141. // End Detecting ATR Short //
  142.  
  143.  
  144. // Start Detecting Boom Bar Long (Normal-Aggressive-Less_aggressive//
  145. atr_long_normal = ma_function_long(ta.tr(true), in_length_atr_long_normal)
  146. atr_long_more_aggressive = ma_function_long_more_aggressive(ta.tr(true), in_length_atr_long_more_aggressive)
  147. atr_long_less_aggressive = ma_function_long_less_aggressive(ta.tr(true), in_length_atr_long_less_aggressive)
  148. in_atr_Mult_long_normal = input.float(title='atr_Mult_long_normal', minval=0, maxval=5, defval=1.2, step=0.1, group='Atr Long Normal')
  149. in_atr_Mult_long_more_aggressive = input.float(title='atr_Mult_long_more_aggressive', minval=0, maxval=5, defval=1.2, step=0.1, group='Atr Long More Aggresive')
  150. in_atr_Mult_long_less_aggressive = input.float(title='atr_Mult_long_less_aggressive', minval=0, maxval=5, defval=1.2, step=0.1, group='Atr Long Less Aggresive')
  151. boom_bar_long_normal = math.abs(open - close) > atr_long_normal * in_atr_Mult_long_normal
  152. boom_bar_long_more_aggressive = math.abs(open - close) > atr_long_more_aggressive * in_atr_Mult_long_more_aggressive
  153. boom_bar_long_less_aggressive = math.abs(open - close) > atr_long_less_aggressive * in_atr_Mult_long_less_aggressive
  154. // End Detecting Boom Bar Long //
  155.  
  156.  
  157. // Start Detecting Boom Bar Short //
  158. atr_short = ma_function_short(ta.tr(true), in_length_atr_short)
  159. in_atr_Mult_short = input.float(title='atr_Mult_short', minval=0, maxval=5, defval=1.2, step=0.1, group='Atr Short')
  160. boom_bar_short = math.abs(open - close) > atr_short * in_atr_Mult_short
  161. // End Detecting Boom Bar Short //
  162.  
  163. barcolor(boom_bar_long_normal and in_normal and not in_more_aggressive and not in_less_aggressive ? color.lime : boom_bar_short and in_normal and not in_more_aggressive and not in_less_aggressive ? color.lime : na)
  164. barcolor(boom_bar_long_more_aggressive and in_more_aggressive and not in_normal and not in_less_aggressive ? color.lime : boom_bar_short and in_more_aggressive and not in_normal and not in_less_aggressive ? color.lime : na)
  165. barcolor(boom_bar_long_less_aggressive and in_less_aggressive and not in_normal and not in_more_aggressive ? color.lime : boom_bar_short and in_less_aggressive and not in_normal and not in_more_aggressive ? color.lime : na)
  166.  
  167.  
  168. // Start Detecting Ema Long And Short //
  169. ema_long = ta.ema(close, in_ema_long)
  170. plot(ema_long, title="ema_long", color=color.green, linewidth = 2)
  171.  
  172. ema_short = ta.ema(close, in_ema_short)
  173. plot(ema_short, title="ema_short", color=color.red, linewidth = 2)
  174. // End Detecting Ema Long And Short //
  175.  
  176.  
  177. plot(strategy.position_size != 0 ? strategy.opentrades.entry_price(0) : na , color=strategy.position_size > 0 ? color.blue : strategy.position_size < 0 ? color.red : na, style=plot.style_linebr, title="entry_price") // stampa l'entry price in rosso se short in blu se long
  178. //plot(strategy.position_size > 0 ?  take_profit_long_price : strategy.position_size < 0 ? take_profit_short_price: na, color=color.green, style=plot.style_cross, linewidth=2, title="tk_limit")
  179. //plot(strategy.position_size > 0 ?  stop_loss_long_price : strategy.position_size < 0 ? stop_loss_short_price: na, color=color.red, style=plot.style_cross, linewidth=2, title="sl_limit")
  180.  
  181. bgcolor(strategy.position_size > 0 ? color.green : strategy.position_size < 0 ? color.red : na, transp=90)// sfondo verde quando siamo long, sfondo rosso quando siamo short, no sfondo quando non siamo in posizione //color.new(color.red, 99): na)
  182.  
  183.  
  184. // Plot No Trading Allowed giorni da 1 a 7 1 è domenica. Mesi da 1 a 12 1 è Gennaio. //
  185.  
  186. // giorni_esclusi = dayofweek(time)
  187. // plotshape(giorni_esclusi[1] == 2 ? giorni_esclusi : na, color=color.green, title="giorni_esclusi")
  188. // mesi_esclusi = month(time)
  189. // plotshape(mesi_esclusi[1] == 9 ? mesi_esclusi : na, color=color.yellow, title="mesi_esclusi")
  190.  
  191.  
  192. // Qui abbiamo in delay buy, sell, close command: ,"delay":"15" per dare il tempo di cancellare prima eventuali ordini pendenti e poi entrare in posizione
  193. // Il cancel command non deve avere il delay.
  194. buy_command = 'BUY COMMAND'
  195. sell_command = 'SELL COMMAND'
  196. close_command = 'CLOSE COMMAND'
  197. //cancel_command = 'CANCEL COMMAND'
  198.  
  199.  
  200. // Start Entry Conditions Long And Short //
  201. entry_long = close > baseLine and conversionLine>baseLine and close>spanB  and close > ema_long  and boom_bar_long_normal and inDateRange and not onlyShort and in_normal and not in_more_aggressive and not in_less_aggressive
  202. entry_long_more_aggressive = close > baseLine and conversionLine>baseLine and close>spanB  and close > ema_long  and boom_bar_long_more_aggressive and inDateRange and not onlyShort and in_more_aggressive and not in_normal and not in_less_aggressive
  203. entry_long_less_aggressive = close > baseLine and conversionLine>baseLine and close>spanB  and close > ema_long  and boom_bar_long_less_aggressive and inDateRange and not onlyShort and in_less_aggressive and not in_normal and not in_more_aggressive
  204. entry_short = close < baseLine and conversionLine<baseLine and close<spanB  and close < ema_short and boom_bar_short and inDateRange and not onlyLong and ((in_normal and not in_more_aggressive and not in_less_aggressive) or (in_more_aggressive and not in_normal and not in_less_aggressive) or (in_less_aggressive and not in_normal and not in_more_aggressive))
  205. //  End Entry Conditions Long And Short //
  206.  
  207.  
  208. // Start Exit Conditions Long And Short //
  209. exit_long = close < baseLine
  210. exit_short = close > baseLine
  211. // End Exit Conditions Long And Short //
  212.  
  213. plot(strategy.opentrades)
  214.  
  215.  
  216. // Entry Exit Long / Short
  217. if entry_long // and strategy.opentrades == 0
  218.     strategy.entry('long', strategy.long, alert_message = "Open Long Position")//, comment = buy_command)
  219. if entry_long_more_aggressive
  220.     strategy.entry('long', strategy.long, alert_message = "Open Long Position More Aggressive")//, comment = buy_command)
  221. if entry_long_less_aggressive
  222.     strategy.entry('long', strategy.long, alert_message = "Open Long Position Less Aggressive")//, comment = buy_command)
  223. if exit_long
  224.     strategy.close(id='long', alert_message = "Close Long Position")//, comment = close_command)
  225.  
  226. if entry_short // and strategy.opentrades == 0
  227.     strategy.entry('short', strategy.short, alert_message = "Open Short Position")//, comment = sell_command)
  228. if exit_short
  229.     strategy.close(id='short', alert_message = "Close Short Position")//, comment = close_command)
  230.  
  231.  
  232. // Nome Alert: Over-The-Clouds ETH/USDT.P BYBIT 4H
  233. // Commento Alert: {{strategy.order.comment}}
  234. // Webhook Classico Più Sicuro Ma Più Lento: https://alerts.tv-hub.org  
  235. // Webhook Nuovo Meno Sicuro Ma Più Veloce: https://alerts.tv-hub.org/api/ExecuteTradeSignalClassic
  236.  
  237.  
  238. // ------- Inizio Calcolatore Size Posizioni Aperte E Size Posizioni Residue E Segna Con Una Croce Se Abbiamo Realizzato Un Profitto ------- //
  239.                                    // Il Segno Croce Profitto Realizzato Non Funziona Sullo Swing Posizione //
  240.  
  241. // bought = strategy.position_size[0]> strategy.position_size[1]
  242. // Close_TP = false    
  243. // Close_TP := strategy.position_size[1] - strategy.position_size[0] and strategy.position_size[1] != 0 and strategy.position_size[0] != 0
  244.    
  245. // plotshape(Close_TP,title="Close_TP", style=shape.xcross, color=color.blue, size =size.small, editable = true)
  246. // plot(strategy.position_size[1],"Position Old")
  247. // plot(strategy.position_size,"Position")
  248.  
  249. // ------- Fine Calcolatore Size Posizioni Aperte E Size Posizioni Residue E Segna Con Una Croce Se Abbiamo Realizzato Un Profitto ------- //
  250.  
  251.  
  252. // ----------------- Inizio Tabella risultati mensili. Per visualizzare andare nelle impostazioni proprietà e spuntare ad ogni tick -----------------
  253.  
  254. // new_month = month(time) != month(time[1])
  255. // new_year  = year(time)  != year(time[1])
  256.  
  257. // eq = strategy.equity
  258.  
  259. // bar_pnl = eq / eq[1] - 1
  260.  
  261. // cur_month_pnl = 0.0
  262. // cur_year_pnl  = 0.0
  263.  
  264. // // Current Monthly P&L
  265. // cur_month_pnl := new_month ? 0.0 :
  266. //                  (1 + cur_month_pnl[1]) * (1 + bar_pnl) - 1
  267.  
  268. // // Current Yearly P&L
  269. // cur_year_pnl := new_year ? 0.0 :
  270. //                  (1 + cur_year_pnl[1]) * (1 + bar_pnl) - 1  
  271.  
  272. // // Arrays to store Yearly and Monthly P&Ls
  273. // var month_pnl  = array.new_float(0)
  274. // var month_time = array.new_int(0)
  275.  
  276. // var year_pnl  = array.new_float(0)
  277. // var year_time = array.new_int(0)
  278.  
  279. // last_computed = false
  280.  
  281. // if (not na(cur_month_pnl[1]) and (new_month or barstate.islast))
  282. //     if (last_computed[1])
  283. //         array.pop(month_pnl)
  284. //         array.pop(month_time)
  285.  
  286. //     array.push(month_pnl , cur_month_pnl[1])
  287. //     array.push(month_time, time[1])
  288.  
  289. // if (not na(cur_year_pnl[1]) and (new_year or barstate.islast))
  290. //     if (last_computed[1])
  291. //         array.pop(year_pnl)
  292. //         array.pop(year_time)
  293.  
  294. //     array.push(year_pnl , cur_year_pnl[1])
  295. //     array.push(year_time, time[1])
  296.  
  297. // last_computed := barstate.islast ? true : nz(last_computed[1])
  298.  
  299. // // Monthly P&L Table    
  300. // var monthly_table = table(na)
  301. // prec      = input(2, title = "Return Precision")
  302.  
  303. // if (barstate.islast)
  304. //     monthly_table := table.new(position.bottom_right, columns = 14, rows = array.size(year_pnl) + 1, bgcolor=#0F0F0F,border_width=1,border_color=#000000)
  305.  
  306. //     table.cell(monthly_table, 0,  0, "",     text_color=#D3D3D3, bgcolor=#0F0F0F)
  307. //     table.cell(monthly_table, 1,  0, "Jan",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  308. //     table.cell(monthly_table, 2,  0, "Feb",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  309. //     table.cell(monthly_table, 3,  0, "Mar",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  310. //     table.cell(monthly_table, 4,  0, "Apr",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  311. //     table.cell(monthly_table, 5,  0, "May",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  312. //     table.cell(monthly_table, 6,  0, "Jun",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  313. //     table.cell(monthly_table, 7,  0, "Jul",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  314. //     table.cell(monthly_table, 8,  0, "Aug",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  315. //     table.cell(monthly_table, 9,  0, "Sep",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  316. //     table.cell(monthly_table, 10, 0, "Oct",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  317. //     table.cell(monthly_table, 11, 0, "Nov",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  318. //     table.cell(monthly_table, 12, 0, "Dec",  text_color=#D3D3D3, bgcolor=#0F0F0F)
  319. //     table.cell(monthly_table, 13, 0, "Year", text_color=#D3D3D3, bgcolor=#0F0F0F)
  320.  
  321.  
  322. //     for yi = 0 to array.size(year_pnl) - 1
  323. //         table.cell(monthly_table, 0,  yi + 1, str.tostring(year(array.get(year_time, yi))), text_color=#D3D3D3, bgcolor=#0F0F0F)
  324.  
  325. //         y_color = array.get(year_pnl, yi) > 0 ? color.lime : color.red
  326. //         table.cell(monthly_table, 13, yi + 1, str.tostring(math.round(array.get(year_pnl, yi) * 100, prec)), bgcolor = y_color)
  327.  
  328. //     for mi = 0 to array.size(month_time) - 1
  329. //         m_row   = year(array.get(month_time, mi))  - year(array.get(year_time, 0)) + 1
  330. //         m_col   = month(array.get(month_time, mi))
  331. //         m_color = array.get(month_pnl, mi) > 0 ? color.lime : color.red
  332.  
  333. //         table.cell(monthly_table, m_col, m_row, str.tostring(math.round(array.get(month_pnl, mi) * 100, prec)), bgcolor = m_color)
  334.  
  335. // ----------------- Fine Tabella risultati mensili. Per visualizzare andare nelle impostazioni proprietà e spuntare ad ogni tick -----------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement