[
  {
    "path": "Failure Swing (stop hunting) Strategy",
    "content": "//@version=3\n//\n// GitHub: https://github.com/Heavy91/TradingView_Indicators\n//\n// TradingView: https://www.tradingview.com/u/Heavy91/#published-scripts\n//\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// If you like my work, you can support me with a donation:\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// €: http://pinescripts.fetchapp.com/sell/d15d4740\n//\n// $: http://pinescripts.fetchapp.com/sell/0f9153a5\n//\n// BTC: bc1q8e4wav3t55plp6ar0xc7gh4uqrzlxc7g97ywrg\n//\n// LTC: ltc1qagcys3pyluke3xdlq94qx8p7fd3z3mj2w32grs\n//\n// ----------------------------------------------------------------------------\n// Failure Swing Strategy\n// ----------------------------------------------------------------------------\n// This strategy is a first attempt to countertrade the false break of a key support/resistance. \n// If a candle breaks the level, but it comes back before the close, it will trigger an order. \n// The Stop Loss is in %, the Take Profit is near the EMA. \n// The volatility filter is used to block new orders when the price is near the EMA. \n// The volatility adjustment coefficients calibrate Stop Loss and Take Profit values according to the current volatility.\n\nstrategy(\"Failure Swing Strategy V1\", overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity , pyramiding=0,default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.2 )\nperiod = input( 84, minval=1, title='Support & Resistance' )\n\nEMAp = input( 120, minval=1, title='EMA' )\nThreshold = input( 5, minval=1, title='VolatilityFilter' )\ncoefficientTP = input( 0.05,title='TP_VolatilityAdjustment', type=float , step=0.01)\ncoefficientSL = input( 0.02,title='SL_VolatilityAdjustment', type=float , step=0.01)\n\nsl_inp = input(2, title='Stop Loss %', type=float)/100\n\n\n//STATEGY SETTINGS\n// === BACKTEST RANGE ===\nFromMonth = input(defval = 8, title = \"From Month\", minval = 1)\nFromDay   = input(defval = 1, title = \"From Day\", minval = 1)\nFromYear  = input(defval = 2018, title = \"From Year\", minval = 2014)\nToMonth   = input(defval = 1, title = \"To Month\", minval = 1)\nToDay     = input(defval = 1, title = \"To Day\", minval = 1)\nToYear    = input(defval = 9999, title = \"To Year\", minval = 2014)\n\nAllowShort = input(type=bool, defval=true, title=\"Allow Short\")\nstrategy.risk.allow_entry_in(AllowShort ? strategy.direction.all : strategy.direction.long)\n\nresistance = highest(high[1], period)\nsupport = lowest(low[1], period)\nplot(resistance, color=gray, linewidth=1)\nplot(support, color=gray, linewidth=1)\nemaBase = ema(close,EMAp)\nplot(emaBase, color=yellow, linewidth=1)\nvolatility = (((open-emaBase)*sign(open-emaBase))/emaBase)\nema = emaBase*(1+volatility*coefficientTP*sign(open-emaBase))\nplot(ema, color=green, linewidth=2, style=circles)\n\nstop_level_L = strategy.position_avg_price * (1 - sl_inp-volatility*coefficientSL)\nstop_level_S = strategy.position_avg_price * (1 + sl_inp + volatility*coefficientSL)\n\n\n//STRATEGY\nif( (time > timestamp(FromYear, FromMonth, FromDay, 00, 00)) and (time < timestamp(ToYear, ToMonth, ToDay, 23, 59)) )\n//OPEN SHORT\n    if(volatility>(Threshold/100))//filter volatility\n        if(resistance[1]==resistance[2])//filter resistance \n            if((high>=resistance[1])and(close<resistance[1]))//failed swing\n                strategy.entry(\"Short\", strategy.short,comment=\"Short\")\n                \n//OPEN LONG \n    if(volatility>(Threshold/100))//filter volatility\n        if(support[1]==support[2])//filter support \"piatto\"\n            if((low<=support[1])and(close>support[1]))//failed swing\n                strategy.entry(\"Long\", strategy.long,comment=\"Long\")\n                \n//STOP LOSS\n    if((high>stop_level_S) or (low<ema))\n        strategy.close(\"Short\")\n    if((low<stop_level_L) or (high>ema))\n        strategy.close(\"Long\")  \n//TAKE PROFIT\n    if(low<ema)\n        strategy.close(\"Short\")\n    if(high>ema)\n        strategy.close(\"Long\")  \n\nplot((strategy.position_size < 0)?stop_level_S:na, color=red, style=circles, linewidth=2)\nplot((strategy.position_size > 0)?stop_level_L:na, color=red, style=circles, linewidth=2)\n"
  },
  {
    "path": "MultiAverages MultiTimeframe Indicator",
    "content": "//@version=3\n//\n// GitHub: https://github.com/Heavy91/TradingView_Indicators\n//\n// TradingView: https://www.tradingview.com/u/Heavy91/#published-scripts\n//\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// If you like my work, you can support me with a donation:\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// €: http://pinescripts.fetchapp.com/sell/d15d4740\n//\n// $: http://pinescripts.fetchapp.com/sell/0f9153a5\n//\n// BTC: bc1q8e4wav3t55plp6ar0xc7gh4uqrzlxc7g97ywrg\n//\n// LTC: ltc1qagcys3pyluke3xdlq94qx8p7fd3z3mj2w32grs\n//\n// ----------------------------------------------------------------------------\n// MultiAverages MultiTimeframe\n// ----------------------------------------------------------------------------\n// Plots different kinds of averages ( EMA , SMA , SMMA , WMA , VWMA ) referred to a fixed timeframe, \n// indipendent from the one that you are watching, e.g. plot daily EMA on the 1h chart. \n// Highlights the crossing of averages.\n\nstudy(title=\"Ultimate 'Multi-Timeframe' Multi-Averages\", shorttitle=\"MultiTF MultiAVGs\", overlay=true)\nsrc = input(close, title=\"Source\")\n\n//FIRST MODULE/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\nI_ModuleType = input(title=\"Module_1: Type\", type=string, defval=\"EMA\", options=[\"EMA\", \"SMMA\", \"SMA\", \"WMA\", \"VolumeWMA\"])\nI_ModuleTF = input(title=\"Module_1: Timeframe (W, D, [minutes])\", type=string, defval=\"D\")\nI_PlotAVGcross = input(title=\"Module_I: Highlight the crossing(AVGs 2 & 3)\", type=bool, defval=true)\n\nI_AVGLenght = input(title=\"Average_1.1: Lenght\", type=integer, defval=9, minval=1) \nII_AVGLenght = input(title=\"Average_1.2: Lenght\", type=integer, defval=50, minval=1)\nIII_AVGLenght = input(title=\"Average_1.3: Lenght\", type=integer, defval=200, minval=1)\n\n//1st Average//////////////////////////////////////////////////////////////////////////////\nI_EMA = security(tickerid, I_ModuleTF, ema(src, I_AVGLenght))\nI_SMA = security(tickerid, I_ModuleTF, sma(src, I_AVGLenght))\nI_SMMA = security(tickerid, I_ModuleTF, rma(src, I_AVGLenght))\nI_VWMA = security(tickerid, I_ModuleTF, vwma(src, I_AVGLenght))\nI_WMA = security(tickerid, I_ModuleTF, wma(src, I_AVGLenght))\n\nI_AVG = if (I_ModuleType == 'EMA')\n    I_EMA\nelse \n    if (I_ModuleType == \"SMA\")\n        I_SMA\n    else\n        if (I_ModuleType == \"SMMA\")\n            I_SMMA\n        else\n            if (I_ModuleType == \"VolumeWMA\")\n                I_VWMA\n            else\n                if (I_ModuleType == \"WMA\")\n                    I_WMA\n                else\n                    na\nplot(I_AVG,title=\"AVG_1.1\",  color=red, transp=0, linewidth=3)\n\n////2nd Average////////////////////////////////////////////////////////////////////////\nII_EMA = security(tickerid, I_ModuleTF, ema(src, II_AVGLenght))\nII_SMA = security(tickerid, I_ModuleTF, sma(src, II_AVGLenght))\nII_SMMA = security(tickerid, I_ModuleTF, rma(src, II_AVGLenght))\nII_VWMA = security(tickerid, I_ModuleTF, vwma(src, II_AVGLenght))\nII_WMA = security(tickerid, I_ModuleTF, wma(src, II_AVGLenght))\n\nII_AVG = if (I_ModuleType == 'EMA')\n    II_EMA\nelse \n    if (I_ModuleType == \"SMA\")\n        II_SMA\n    else\n        if (I_ModuleType == \"SMMA\")\n            II_SMMA\n        else\n            if (I_ModuleType == \"VolumeWMA\")\n                II_VWMA\n            else\n                if (I_ModuleType == \"WMA\")\n                    II_WMA\n                else\n                    na\n                \nplot(II_AVG, title=\"AVG_1.2\", color=green, transp=0, linewidth=3)\n\n//3rd Average//////////////////////////////////////////////////////////////////////////////\nIII_EMA = security(tickerid, I_ModuleTF, ema(src, III_AVGLenght))\nIII_SMA = security(tickerid, I_ModuleTF, sma(src, III_AVGLenght))\nIII_SMMA = security(tickerid, I_ModuleTF, rma(src, III_AVGLenght))\nIII_VWMA = security(tickerid, I_ModuleTF, vwma(src, III_AVGLenght))\nIII_WMA = security(tickerid, I_ModuleTF, wma(src, III_AVGLenght))\n\nIII_AVG = if (I_ModuleType == 'EMA')\n    III_EMA\nelse \n    if (I_ModuleType == \"SMA\")\n        III_SMA\n    else\n        if (I_ModuleType == \"SMMA\")\n            III_SMMA\n        else\n            if (I_ModuleType == \"VolumeWMA\")\n                III_VWMA\n            else\n                if (I_ModuleType == \"WMA\")\n                    III_WMA\n                else\n                    na\nplot(III_AVG, title=\"AVG_1.3\", color=blue, transp=0, linewidth=3)  \n\n//plot ((cross(I_AVG, II_AVG) and I_PlotAVGcross) ? I_AVG : na, title=\"Cross 1.1 & 1.2\", style = circles, color = yellow,  linewidth = 5, trackprice = false)\n//plot ((cross(I_AVG, III_AVG) and I_PlotAVGcross) ? I_AVG : na, title=\"Cross 1.1 & 1.3\", style = circles, color = yellow,  linewidth = 5, trackprice = false)\nplot ((cross(II_AVG, III_AVG) and I_PlotAVGcross) ? II_AVG : na, title=\"Cross 1.2 & 1.3\", style = circles, color = ((II_AVG > III_AVG) ? green : red),  linewidth = 5, trackprice = false)\n\n//SECOND MODULE/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\nII_ModuleType = input(title=\"Module_2: Type\", type=string, defval=\"SMMA\", options=[\"EMA\", \"SMMA\", \"SMA\", \"WMA\", \"VolumeWMA\"])\nTFfromChart = input(title=\"use timeframe of the chart\", type=bool, defval=true)\nII_ModuleTF = if(TFfromChart)\n    period\nelse\n    input(title=\"Module_2: Timeframe (W, D, [minutes])\", type=string, defval=\"240\")\n\nII_PlotAVGcross = input(title=\"Module_II: Highlight the crossing(AVGs 2 & 3)\", type=bool, defval=true)\n\nI2_AVGLenght = input(title=\"Average_2.1: Lenght\", type=integer, defval=9, minval=1) \nII2_AVGLenght = input(title=\"Average_2.2: Lenght\", type=integer, defval=50, minval=1)\nIII2_AVGLenght = input(title=\"Average_2.3: Lenght\", type=integer, defval=200, minval=1)\n\n//1st Average//////////////////////////////////////////////////////////////////////////////\nI2_EMA = security(tickerid, II_ModuleTF, ema(src, I2_AVGLenght))\nI2_SMA = security(tickerid, II_ModuleTF, sma(src, I2_AVGLenght))\nI2_SMMA = security(tickerid, II_ModuleTF, rma(src, I2_AVGLenght))\nI2_VWMA = security(tickerid, II_ModuleTF, vwma(src, I2_AVGLenght))\nI2_WMA = security(tickerid, II_ModuleTF, wma(src, I2_AVGLenght))\n\nI2_AVG = if (II_ModuleType == 'EMA')\n    I2_EMA\nelse \n    if (II_ModuleType == \"SMA\")\n        I2_SMA\n    else\n        if (II_ModuleType == \"SMMA\")\n            I2_SMMA\n        else\n            if (II_ModuleType == \"VolumeWMA\")\n                I2_VWMA\n            else\n                if (II_ModuleType == \"WMA\")\n                    I2_WMA\n                else\n                    na\nplot(I2_AVG,title=\"AVG_2.1\",  color=orange, transp=0, linewidth=1)\n\n////2nd Average////////////////////////////////////////////////////////////////////////\nII2_EMA = security(tickerid, II_ModuleTF, ema(src, II2_AVGLenght))\nII2_SMA = security(tickerid, II_ModuleTF, sma(src, II2_AVGLenght))\nII2_SMMA = security(tickerid, II_ModuleTF, rma(src, II2_AVGLenght))\nII2_VWMA = security(tickerid, II_ModuleTF, vwma(src, II2_AVGLenght))\nII2_WMA = security(tickerid, II_ModuleTF, wma(src, II2_AVGLenght))\n\nII2_AVG = if (II_ModuleType == 'EMA')\n    II2_EMA\nelse \n    if (II_ModuleType == \"SMA\")\n        II2_SMA\n    else\n        if (II_ModuleType == \"SMMA\")\n            II2_SMMA\n        else\n            if (II_ModuleType == \"VolumeWMA\")\n                II2_VWMA\n            else\n                if (II_ModuleType == \"WMA\")\n                    II2_WMA\n                else\n                    na\n                \nplot(II2_AVG, title=\"AVG_2.2\", color=lime, transp=0, linewidth=1)\n\n//3rd Average//////////////////////////////////////////////////////////////////////////////\nIII2_EMA = security(tickerid, II_ModuleTF, ema(src, III2_AVGLenght))\nIII2_SMA = security(tickerid, II_ModuleTF, sma(src, III2_AVGLenght))\nIII2_SMMA = security(tickerid, II_ModuleTF, rma(src, III2_AVGLenght))\nIII2_VWMA = security(tickerid, II_ModuleTF, vwma(src, III2_AVGLenght))\nIII2_WMA = security(tickerid, II_ModuleTF, wma(src, III2_AVGLenght))\n\nIII2_AVG = if (II_ModuleType == 'EMA')\n    III2_EMA\nelse \n    if (II_ModuleType == \"SMA\")\n        III2_SMA\n    else\n        if (II_ModuleType == \"SMMA\")\n            III2_SMMA\n        else\n            if (II_ModuleType == \"VolumeWMA\")\n                III2_VWMA\n            else\n                if (II_ModuleType == \"WMA\")\n                    III2_WMA\n                else\n                    na\nplot(III2_AVG, title=\"AVG_2.3\", color=aqua, transp=0, linewidth=1)  \n\n//plot ((cross(I2_AVG, II2_AVG) and II_PlotAVGcross) ? I2_AVG : na, title=\"Cross 2.1 & 2.2\", style = circles, color = aqua,  linewidth = 4, trackprice = false)\n//plot ((cross(I2_AVG, III2_AVG) and II_PlotAVGcross) ? I2_AVG : na, title=\"Cross 2.1 & 2.3\", style = circles, color = aqua,  linewidth = 4, trackprice = false)\nplot ((cross(II2_AVG, III2_AVG) and II_PlotAVGcross) ? II2_AVG : na, title=\"Cross 2.2 & 2.3\", style = cross, color = ((II2_AVG > III2_AVG) ? green : red),  linewidth = 4, trackprice = false)\n"
  },
  {
    "path": "README.md",
    "content": "# TradingView Indicators and Strategies (pinescript)\n\n###### GitHub: https://github.com/Heavy91/TradingView_Indicators\n\n###### TradingView: https://www.tradingview.com/u/Heavy91/#published-scripts\n\n## If you like my work, you can support me with a donation:\n**€:** http://pinescripts.fetchapp.com/sell/d15d4740\n\n**$:** http://pinescripts.fetchapp.com/sell/0f9153a5\n\n**BTC:** bc1q8e4wav3t55plp6ar0xc7gh4uqrzlxc7g97ywrg\n\n**LTC:** ltc1qagcys3pyluke3xdlq94qx8p7fd3z3mj2w32grs\n\n-------------------------------------------------------------------------------------\n\n## Indicators:\n\n- **RSI MultiTimeframe:**\n  Plots 3 RSI (Weekly, Daily, 4h) at the same time, regardless of the Chart Timeframe.\n  Highlights in green (or red) if all RSI are oversold (or overbought).\n  Can trigger custom oversold and overbought alerts.\n  ![alt text](https://github.com/Heavy91/TradingView_Indicators/blob/master/%5Bpreview%5D%20RSI%20MultiTimeframe%20I.png)\n  \n- **Volume Supply and Demand Zones:**\n  Draws supply and demand zones based on 3 different volume threshold parameters.\n  The timeframe of the script is fixed (you can change it in the options), \n  e.g. it is possible to keep Daily S/D zones while looking at 1h chart.\n  ![alt text](https://github.com/Heavy91/TradingView_Indicators/blob/master/%5Bpreview%5D%20Volume%20Supply%20and%20Demand%20Zones%20I.png)\n  \n- **MultiAverages MultiTimeframe:**\n  Plots different kinds of averages ( EMA , SMA , SMMA , WMA , VWMA ) referred to a fixed timeframe, indipendent from   the one that you are watching, e.g. plot daily EMA on the 1h chart.\n  Highlights the crossing of averages.\n  ![alt text](https://github.com/Heavy91/TradingView_Indicators/blob/master/%5Bpreview%5D%20MultiAverages%20MultiTimeframe%20I.png)\n  \n\n## Strategies:\n\n- **Failure Swing (stop hunting):**\n  This strategy is a first attempt to countertrade the false break of a key support/resistance.\n  If a candle breaks the level, but it comes back before the close, it will trigger an order.\n  The Stop Loss is in %, the Take Profit is near the EMA.\n  The *volatility filter* is used to block new orders when the price is near the EMA.\n  The *volatility adjustment* coefficients calibrate Stop Loss and Take Profit values according to the current volatility.\n  ![alt text](https://github.com/Heavy91/TradingView_Indicators/blob/master/%5Bpreview%5D%20Failure%20Swing%20S.png)\n  \n"
  },
  {
    "path": "RSI MultiTimeframe Indicator",
    "content": "//@version=3\n//\n// GitHub: https://github.com/Heavy91/TradingView_Indicators\n//\n// TradingView: https://www.tradingview.com/u/Heavy91/#published-scripts\n//\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// If you like my work, you can support me with a donation:\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// €: http://pinescripts.fetchapp.com/sell/d15d4740\n//\n// $: http://pinescripts.fetchapp.com/sell/0f9153a5\n//\n// BTC: bc1q8e4wav3t55plp6ar0xc7gh4uqrzlxc7g97ywrg\n//\n// LTC: ltc1qagcys3pyluke3xdlq94qx8p7fd3z3mj2w32grs\n//\n// ----------------------------------------------------------------------------\n// RSI MultiTimeframe Indicator\n// ----------------------------------------------------------------------------\n// Plots 3 RSI (Weekly, Daily, 4h) at the same time, regardless of the Chart Timeframe.\n// Highlights in green (or red) if all RSI are oversold (or overbought).\n// Can trigger custom oversold and overbought alerts.\n\nstudy(title = \"RSI Multi TF\", shorttitle=\"RSI Multi TF (W, D, 4h)\")\nsource = close\nlength = input(14, minval=1)\nHighlightBreaches=input(true, title=\"Highlight Oversold and Overbought?\", type=bool)\n\n// RSI\nRSI_1 = security(tickerid, \"W\", rsi(source, length))\nRSI_2 = security(tickerid, \"D\", rsi(source, length))\nRSI_3 = security(tickerid, \"240\", rsi(source, length))\n\nplot(RSI_3, title = \"4h\", color=gray, linewidth=1)\nplot(RSI_2, title = \"D\", color=red, linewidth=2)\nplot(RSI_1, title = \"W\", color=yellow, linewidth=3)\n\nUpperBand = input(70, title=\"Upper band\")\nLowerBand = input(30, title=\"Lower band\")\n\nb_color = ((RSI_3 > UpperBand)and(RSI_1 > UpperBand)and(RSI_2 > UpperBand)) ? red : ((RSI_3 < LowerBand)and(RSI_1 < LowerBand)and(RSI_2 < LowerBand)) ? green : na\nbgcolor(HighlightBreaches ? b_color : na, transp=50)\n\nh0 = hline(UpperBand, title=\"Upper band\", linestyle=dashed, linewidth=1, color=red)\nh1 = hline(LowerBand, title=\"Lower band\", linestyle=dashed, linewidth=1, color=green)\nfill(h0, h1)\n\nalertcondition(b_color == green, title='MultiOversold', message='Multi Oversold!')\nalertcondition(b_color == red, title='MultiOverbought', message='Multi Overbought!')\n"
  },
  {
    "path": "Volume Supply and Demand Zones Indicator",
    "content": "//@version=3\n//\n// GitHub: https://github.com/Heavy91/TradingView_Indicators\n//\n// TradingView: https://www.tradingview.com/u/Heavy91/#published-scripts\n//\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// If you like my work, you can support me with a donation:\n// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n// €: http://pinescripts.fetchapp.com/sell/d15d4740\n//\n// $: http://pinescripts.fetchapp.com/sell/0f9153a5\n//\n// BTC: bc1q8e4wav3t55plp6ar0xc7gh4uqrzlxc7g97ywrg\n//\n// LTC: ltc1qagcys3pyluke3xdlq94qx8p7fd3z3mj2w32grs\n//\n// ----------------------------------------------------------------------------\n// Volume Supply and Demand Zones\n// ----------------------------------------------------------------------------\n// Draws supply and demand zones based on 3 different volume threshold parameters.\n// The timeframe of the script is fixed (you can change it in the options), \n// e.g. it is possible to keep Daily S/D zones while looking at 1h chart.\n\nstudy(title=\"Volume Supply and Demand Zones\", shorttitle=\"Vol S/D Zones V1\", precision=0, overlay=true)\n\ndef_color_big = aqua\ndef_fill_color_big = aqua\ndef_color_mid = aqua\ndef_fill_color_mid = teal\ndef_color_small = aqua\ndef_fill_color_small = navy\nTF = input(title=\"Timeframe (W, D, [minutes])\", type=string, defval=\"D\")\nlength = input(5, minval=1)\nchange = volume/volume[1] - 1\nstdev = stdev(change, length)\ndifference = change / stdev[1]\nsignal = abs(difference)\n\nThreshold_big = input(15, title=\"Threshold_Big_Vol\")\nThreshold_mid = input(10, title=\"Threshold_Mid_Vol\")\nThreshold_small = input(5, title=\"Threshold_Small_Vol\")\n\n//-----------------------------------------------------------------------------------------\nleveluphi_big = security(tickerid, TF, valuewhen(signal > Threshold_big,high[1],0))\nleveluplo_big = security(tickerid, TF, valuewhen(signal > Threshold_big,low[1],0))\np1 = plot(leveluphi_big,style=circles,color=def_color_big)\np2 = plot(leveluplo_big,style=circles,color=def_color_big)\nfill(p1,p2,color=def_fill_color_big,transp=70)\n\nleveluphi_big2 = security(tickerid, TF, valuewhen(signal > Threshold_big,high[1],1))\nleveluplo_big2 = security(tickerid, TF, valuewhen(signal > Threshold_big,low[1],1))\np12 = plot(leveluphi_big2,style=circles,color=def_color_big)\np22 = plot(leveluplo_big2,style=circles,color=def_color_big)\nfill(p12,p22,color=def_fill_color_big,transp=70)\n\nleveluphi_big3 = security(tickerid, TF, valuewhen(signal > Threshold_big,high[1],2))\nleveluplo_big3 = security(tickerid, TF, valuewhen(signal > Threshold_big,low[1],2))\np13 = plot(leveluphi_big3,style=circles,color=def_color_big)\np23 = plot(leveluplo_big3,style=circles,color=def_color_big)\nfill(p13,p23,color=def_fill_color_big,transp=70)\n\nleveluphi_big4 = security(tickerid, TF, valuewhen(signal > Threshold_big,high[1],3))\nleveluplo_big4 = security(tickerid, TF, valuewhen(signal > Threshold_big,low[1],3))\np14 = plot(leveluphi_big4,style=circles,color=def_color_big)\np24 = plot(leveluplo_big4,style=circles,color=def_color_big)\nfill(p14,p24,color=def_fill_color_big,transp=70)\n//-----------------------------------------------------------------------------------------\nleveluphi_mid = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),high[1],0))\nleveluplo_mid = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),low[1],0))\np3 = plot(leveluphi_mid,style=circles,color=def_color_mid,transp=65)\np4 = plot(leveluplo_mid,style=circles,color=def_color_mid,transp=65)\nfill(p3,p4,color=def_fill_color_mid,transp=70)\n\nleveluphi_mid2 = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),high[1],1))\nleveluplo_mid2 = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),low[1],1))\np32 = plot(leveluphi_mid2,style=circles,color=def_color_mid,transp=65)\np42 = plot(leveluplo_mid2,style=circles,color=def_color_mid,transp=65)\nfill(p32,p42,color=def_fill_color_mid,transp=70)\n\nleveluphi_mid3 = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),high[1],2))\nleveluplo_mid3 = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),low[1],2))\np33 = plot(leveluphi_mid3,style=circles,color=def_color_mid,transp=65)\np43 = plot(leveluplo_mid3,style=circles,color=def_color_mid,transp=65)\nfill(p33,p43,color=def_fill_color_mid,transp=70)\n\nleveluphi_mid4 = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),high[1],3))\nleveluplo_mid4 = security(tickerid, TF, valuewhen((signal > Threshold_mid)and(signal <= Threshold_big),low[1],3))\np34 = plot(leveluphi_mid4,style=circles,color=def_color_mid,transp=65)\np44 = plot(leveluplo_mid4,style=circles,color=def_color_mid,transp=65)\nfill(p34,p44,color=def_fill_color_mid,transp=70)\n//------------------------------------------------------------------------------------------------\nleveluphi_small = security(tickerid, TF, valuewhen((signal > Threshold_small)and(signal <= Threshold_mid),high[1],0))\nleveluplo_small = security(tickerid, TF, valuewhen((signal > Threshold_small)and(signal <= Threshold_mid),low[1],0))\np5 = plot(leveluphi_small,style=circles,color=def_color_small,transp=70)\np6 = plot(leveluplo_small,style=circles,color=def_color_small,transp=70)\nfill(p5,p6,color=def_fill_color_small,transp=70)\n\nleveluphi_small2 = security(tickerid, TF, valuewhen((signal > Threshold_small)and(signal <= Threshold_mid),high[1],1))\nleveluplo_small2 = security(tickerid, TF, valuewhen((signal > Threshold_small)and(signal <= Threshold_mid),low[1],1))\np52 = plot(leveluphi_small2,style=circles,color=def_color_small,transp=70)\np62 = plot(leveluplo_small2,style=circles,color=def_color_small,transp=70)\nfill(p52,p62,color=def_fill_color_small,transp=70)\n\n//-------------------------------------------------------------------------------------------------------\n"
  }
]