traduzione codice TW Squeeze & Release
Forums › ProRealTime forum Italiano › Supporto ProBuilder › traduzione codice TW Squeeze & Release
- This topic has 7 replies, 4 voices, and was last updated 7 months ago by Msport71.
-
-
04/05/2024 at 10:45 AM #23110104/05/2024 at 10:52 AM #231102
https://it.tradingview.com/script/2rpsjnzA-Squeeze-Release-AlgoAlpha/
allego link e foto senza script per vedere se dipende da quello
Grazie
04/08/2024 at 5:24 PM #231253Buon pomeriggio,
sono appena riuscito a postare senza problemi nuova richiesta per altro codice di TW.
A questo punto ho ragione di pensare che vi sia un filtro del forum che blocca i miei tentativi di postare lo script del codice (sia con copia e incolla direttamente nel topic oppure in un file di testo in pdf o word)
Provo a postarlo come screenshot. Magari qualcuno dei moderatori è in grado di capire se c’è un termine o un carattere contenuto nello script che non va bene e bypassare il problema.
Grazie per l’attenzione
04/09/2024 at 4:18 PM #23131104/09/2024 at 4:19 PM #231313Rispondo per prova2 (admin)
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © AlgoAlpha//@version=5indicator(title=”Squeeze & Release [AlgoAlpha]”, shorttitle=”AlgoAlpha -S and R”, overlay=false, timeframe=””, timeframe_gaps=true)// Input definitions for user configurationperiodForCalculation = input.int(title=”Calculation Period”, defval=14, minval=1)lengthForSmoothing = input.int(title=”Smoothing Length”, defval=7, minval=1)lengthForEMA = input.int(title=”EMA Length”, defval=14, minval=1)lengthForHyperSqueezeDetection = input.int(title=”Hyper Squeeze Detection Length”, defval=5, minval=1)standarddeviationlength = input.int(title=”standard deviation Length”, defval=4999, minval=2, maxval = 4999)showbands = input.bool(true, “Show Deviation Bands”)enableSmoothing = input.bool(true, “Enable Smoothing”)colorForRelease = input.color(#673ab7, “Release Color”)colorForSqueeze = input.color(#e91e63, “Squeeze Color”)// Calculating ATR and its EMAaverageTrueRange = ta.ema(ta.tr(true), periodForCalculation)emaOfATR = ta.ema(averageTrueRange, periodForCalculation * 2)volatilityIndicator = emaOfATR – averageTrueRange// Calculating SV (Squeeze Value) and SVMA (Squeeze Value Moving Average)emaHighLowDifference = ta.ema(high – low, periodForCalculation * 2)squeezeValue = enableSmoothing ? ta.ema(volatilityIndicator / emaHighLowDifference * 100, lengthForSmoothing) : volatilityIndicator / emaHighLowDifference * 100squeezeValueMA = ta.ema(squeezeValue, lengthForEMA)// Plotting the main linesmovingAverageLine = plot(squeezeValueMA, color=squeezeValue > 0 and ta.rising(squeezeValue, lengthForHyperSqueezeDetection) ? color.white : color.new(color.white, 70))valueLine = plot(squeezeValue, title=”ATR”, color=squeezeValue > squeezeValueMA ? color.new(colorForSqueeze, 0) : color.new(colorForRelease, 0))// Plotting characters for Squeeze and Releaseplotchar(ta.crossover(squeezeValue, squeezeValueMA) ? squeezeValueMA – 10 : na, title=”Squeeze”, char=”S”, location=location.absolute, color=colorForSqueeze, size=size.tiny)plotchar(ta.crossunder(squeezeValue, squeezeValueMA) ? squeezeValueMA + 10 : na, title=”Release”, char=”R”, location=location.absolute, color=colorForRelease, size=size.tiny)// Filling between MA and ValuefillColorBetweenLines = squeezeValue > squeezeValueMA ? color.new(colorForSqueeze, 0) : color.new(colorForRelease, 0)fill(movingAverageLine, valueLine, squeezeValue, squeezeValueMA, fillColorBetweenLines, color.new(chart.bg_color, 100))meanValue = ta.cum(squeezeValue)/bar_indexstandardDeviation = ta.stdev(squeezeValue, standarddeviationlength, true)thresholdUp = math.max(((squeezeValue-meanValue)/(2*standardDeviation)) * 100, 70)thresholdDown = math.max(((meanValue-squeezeValue)/(2*standardDeviation)) * 100, 70)upperLimit = plot(meanValue+standardDeviation, display = display.none)lowerHigh = plot(meanValue-standardDeviation, display = display.none)upperHigh = plot(meanValue + 2*standardDeviation, display = display.none)lowerLimit = plot(meanValue – 2*standardDeviation, display = display.none)fill(upperLimit, upperHigh, color = color.from_gradient(squeezeValue, -30, 30, color.new(colorForSqueeze, thresholdUp), color.new(colorForRelease, thresholdUp)), display = showbands ? display.all : display.none)fill(lowerLimit, lowerHigh, color = color.from_gradient(squeezeValue, -30, 30, color.new(colorForSqueeze, thresholdDown), color.new(colorForRelease, thresholdDown)), display = showbands ? display.all : display.none)alertcondition(ta.crossover(squeezeValue, squeezeValueMA), “Squeeze”, “Squeeze!”)alertcondition(ta.crossunder(squeezeValue, squeezeValueMA), “Release”, “Release!”)alertcondition(squeezeValue > 0 and ta.rising(squeezeValue, lengthForHyperSqueezeDetection), “Hyper Squeeze”, “Hyper Squeeze!”)04/09/2024 at 4:31 PM #23131404/09/2024 at 4:49 PM #231316Esatto, quello era il problema 🙁
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283//PRC_Squeeze & Release//version = 0//08.04.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-----Inputs-----------------------------------------//periodForCalculation=14 //Calculation PeriodlengthForSmoothing=7 //Smoothing LengthlengthForEMA=14 //EMA LengthlengthForHyperSqueezeDetection=5 //Hyper Squeeze Detection Lengthstandarddeviationlength=min(barindex,4999) //enableSmoothing=1 //Enable Smoothing//-----------------------------------------------------////-----Calculating ATR and its EMA---------------------//atr = average[periodForCalculation,1](TR(close))emaofATR = average[periodForCalculation*2,1](atr)volatilityIndicator = emaofATR - atr//-----------------------------------------------------////-----Calculating SV (Squeeze Value) and SVMA (Squeeze Value Moving Average)//emaHighLowDifference=average[periodForCalculation*2](high-low)if enableSmoothing thensqueezeValue=average[lengthForSmoothing,1](volatilityIndicator / emaHighLowDifference * 100)elsesqueezeValue=volatilityIndicator / emaHighLowDifference * 100endifsqueezeValueMA=average[lengthForEMA,1](squeezeValue)//-----------------------------------------------------////-----Color Main Line---------------------------------//if squeezeValue>0 and squeezeValue>=highest[lengthForHyperSqueezeDetection](squeezeValue) thenra=0ga=0ba=0alpha=100elsera=124ga=124ba=124alpha=70endifif squeezeValue > squeezeValueMA then//colorForSqueeze r=233/g=30/b=99r=233g=30b=99else//colorForRelease r=103/g=58/b=103r=103g=58b=103endif//-----------------------------------------------------////----Plotting characters for Squeeze and Release-------//if squeezeValue crosses over squeezeValueMA thendrawtext("S",barindex,squeezeValueMA - 10)coloured(233,30,99)elsif squeezeValue crosses under squeezeValueMA thendrawtext("R",barindex,squeezeValueMA + 10)coloured(103,58,103)endif//-----------------------------------------------------////-----Filling between MA and Value--------------------//COLORBETWEEN(squeezeValueMA,squeezeValue,r,g,b)//-----------------------------------------------------//if barindex <= periodForCalculation*3+lengthForEMA thenmeanvalue=0squeezeValue=0elsemeanValue=summation[barindex](squeezeValue)/barindexstandardDeviation=std[standarddeviationlength](squeezeValue)endifthresholdUp=max((squeezeValue-meanValue)/(2*standardDeviation) * 100, 70)thresholdDown=max((meanValue-squeezeValue)/(2*standardDeviation) * 100, 70)upperLimit=meanValue+standardDeviationlowerHigh=meanValue-standardDeviationupperHigh=meanValue + 2*standardDeviationlowerLimit=meanValue - 2*standardDeviationcolorbetween(upperLimit,upperHigh,r,g,b,30)colorbetween(lowerHigh,lowerLimit,r,g,b,30)//-----------------------------------------------------//return squeezeValue as "ATR"coloured(r,g,b)style(line,2),squeezeValueMA as "MovingAverageLine"coloured(ra,ga,ba)style(line,3)04/09/2024 at 9:28 PM #231327 -
AuthorPosts
Find exclusive trading pro-tools on