Traduzione indicatore da Tradingview a Pro Real Time
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Traduzione indicatore da Tradingview a Pro Real Time
- This topic has 2 replies, 2 voices, and was last updated 1 year ago by
Hunry86.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
06/19/2024 at 4:12 PM #234106
Buonasera,
come da titolo richiedo se è possibile tradurre il seguente indicatore https://www.tradingview.com/script/ls35sRAp-ZigZag-With-ATR-Filter-vnhilton/
Allego il file con il codice.
07/02/2024 at 10:23 AM #234692Buenas. Ecco il codice dell'indicatore.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136pivotlength=3//Check if pivotlength is oddif (pivotlength-1) mod 2 = 0 thenpivotlength=pivotlengthelsepivotlength=pivotlength+1endifatrmultiplier=2atr=averagetruerange[(pivotlength-1)/2]once $pivotIndices[0]=barindexonce $pivotValues[0]=highonce $pivotTypes[0]=1once z=0//-----------------------------------------------------////-----Looking for at least 1 instance where a pivot cannot be creatednoHighPivot=0//a pivot can be creatednoLowPivot=0//a pivot can be createdfor i=pivotlength-1 to 1 do//check left side barif i>(pivotlength-1)/2 thenif high[i]>high[i-1] thennoHighPivot=1//a pivot cannot be createdendifif low[i]<low[i-1] thennoLowPivot=1//a pivot cannot be createdendifendif//check middle and right side barif i<=(pivotlength-1)/2 thenif high[i]<high[i-1] thennoHighPivot=1//a pivot cannot be createdendifif low[i]>low[i-1] thennoLowPivot=1//a pivot cannot be createdendifendifnext//-----------------------------------------------------//updatelast=0if isset($pivotindices[z]) thenif $pivotTypes[z]=1 thenif not noHighpivot and high[(pivotlength-1)/2]>$pivotValues[z] then$pivotIndices[z]=barindex-((pivotLength-1)/2)$pivotValues[z]=high[(pivotLength-1)/2]$pivotVolume[z]=summation[max(1,($pivotIndices[z]-$pivotIndices[max(0,z-1)]))](volume)updatelast=1endifif not noLowPivot and abs(low[(pivotlength-1)/2]-$pivotValues[z])>=atr*atrMultiplier and (barindex-(pivotlength-1)/2) <> $pivotIndices[z] and low[(pivotlength-1)/2]<$pivotValues[z] then$pivotIndices[z+1]=barindex-((pivotLength-1)/2)$pivotValues[z+1]=LOW[(pivotLength-1)/2]$pivotTypes[z+1]=-1$pivotVolume[z+1]=summation[($pivotIndices[z+1]-$pivotIndices[z])](volume)z=z+1endifelseif not noLowpivot and low[(pivotlength-1)/2]<$pivotValues[z] then$pivotIndices[z]=barindex-((pivotLength-1)/2)$pivotValues[z]=low[(pivotLength-1)/2]$pivotVolume[z]=summation[max(1,($pivotIndices[z]-$pivotIndices[max(0,z-1)]))](volume)updatelast=1endifif not noHighPivot and abs(high[(pivotlength-1)/2]-$pivotValues[z])>=atr*atrMultiplier and (barindex-(pivotlength-1)/2) <> $pivotIndices[z] and high[(pivotlength-1)/2]>$pivotValues[z] then$pivotIndices[z+1]=barindex-((pivotLength-1)/2)$pivotValues[z+1]=high[(pivotLength-1)/2]$pivotTypes[z+1]=1$pivotVolume[z+1]=summation[($pivotIndices[z+1]-$pivotIndices[z])](volume)z=z+1endifendifelse //If it will be the first Pivotif not noHighPivot then$pivotIndices[z+1]=barindex-((pivotLength-1)/2)$pivotValues[z+1]=high[(pivotLength-1)/2]$pivotTypes[z+1]=1$pivotVolume[z+1]=summation[($pivotIndices[z+1]-$pivotIndices[z])](volume)z=z+1endifif not noLowPivot then$pivotIndices[z+1]=barindex-((pivotLength-1)/2)$pivotValues[z+1]=LOW[(pivotLength-1)/2]$pivotTypes[z+1]=-1$pivotVolume[z+1]=summation[($pivotIndices[z+1]-$pivotIndices[z])](volume)z=z+1endifendif//Get Trendif z>=2 thenif $pivotTypes[z]=1 and $pivotValues[z] > $pivotValues[z-2] then$trend[z]=2elsif $pivotTypes[z]=1 and $pivotValues[z] <= $pivotValues[z-2] then$trend[z]=1elsif $pivotTypes[z]=-1 and $pivotValues[z] < $pivotValues[z-2] then$trend[z]=-2elsif$pivotTypes[z]=-1 and $pivotValues[z] >= $pivotValues[z-2] then$trend[z]=-1endifelse$trend[z]=0endif//-----------------------------------------------------//if islastbarupdate thenfor j=z downto 1 dovol=$pivotVolume[j]if $pivotTypes[j]=1 and $trend[j]=2 thendrawtext("HH",$pivotIndices[j],$pivotValues[j]+atr)drawtext("#vol#",$pivotIndices[j],$pivotValues[j]+2*atr)drawsegment($pivotIndices[j-1],$pivotValues[j-1],$pivotIndices[j],$pivotValues[j])style(line,2)coloured("orange")elsif $pivotTypes[j]=1 and $trend[j]=1 thendrawtext("LH",$pivotIndices[j],$pivotValues[j]+atr)drawtext("#vol#",$pivotIndices[j],$pivotValues[j]+2*atr)drawsegment($pivotIndices[j-1],$pivotValues[j-1],$pivotIndices[j],$pivotValues[j])style(line,2)coloured("orange")elsif $pivotTypes[j]=-1 and $trend[j]=-2 thendrawtext("LL",$pivotIndices[j],$pivotValues[j]-atr)drawtext("#vol#",$pivotIndices[j],$pivotValues[j]-2*atr)drawsegment($pivotIndices[j-1],$pivotValues[j-1],$pivotIndices[j],$pivotValues[j])style(line,2)coloured("orange")elsif $pivotTypes[j]=-1 and $trend[j]=-1 thendrawtext("HL",$pivotIndices[j],$pivotValues[j]-atr)drawtext("#vol#",$pivotIndices[j],$pivotValues[j]-2*atr)drawsegment($pivotIndices[j-1],$pivotValues[j-1],$pivotIndices[j],$pivotValues[j])style(line,2)coloured("orange")endifnextendif//-----------------------------------------------------//return07/04/2024 at 10:12 AM #234773 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: