Time Segmented Volume by Worden Brothers code
Forums › ProRealTime English forum › ProBuilder support › Time Segmented Volume by Worden Brothers code
- This topic has 24 replies, 5 voices, and was last updated 3 years ago by robertogozzi.
Tagged: segmented, Time Segmented Volume, tsv, Worden, Worden Brothers
-
-
11/05/2020 at 7:06 PM #14957711/05/2020 at 9:11 PM #149591
There you go:
123456789101112131415161718192021222324252627// TSV Time Segmented Volume indicator//// --------------------------------------------------------------------------------------// 13 = number of daily HALF HOURS// 7 = ????// --------------------------------------------------------------------------------------// Example Settings:// Short Term Trading : TSV period between 9 and 12// Intermediate Term Trading: TSV period between 18 and 25// Long Term Trading : TSV period between 35 and 45//// --------------------------------------------------------------------------------------//ONCE p1 = 13//ONCE p2 = 7//ONCE Mtype = 0p1 = max(1,min(999,p1))p2 = max(1,min(999,p2))Mtype = max(0,min(6,Mtype))MyVol = 0IF close > close[1] THENMyVol = volume * (close - close[1])ELSIF close < close[1] THENMyVol = -volume * (close - close[1])ENDIFTSV = summation[p1](MyVol)Signal = average[p2,Mtype](TSV)RETURN TSV AS "Tsv",Signal AS "Signal"11/05/2020 at 9:26 PM #14959511/05/2020 at 10:13 PM #149597I am currently using balance of power which would work really well hand in hand with TSV. I can run them side by side but I would love to be build TSV onto my balance of power indicator.
Do you think this could be done?
thanks again for your support.
Regards
Alastair
11/05/2020 at 10:25 PM #149599What code do you use as balance of power ?
11/05/2020 at 10:43 PM #14960011/06/2020 at 1:27 AM #149614As you can see they don’t share the scale, values are so much different!
Try to better explain what you mean by “I would love to be build TSV onto my balance of power indicator“.
11/06/2020 at 6:57 AM #14962411/06/2020 at 8:20 AM #149626al_craig – Please always use the ‘Insert PRT Code’ button when posting code rather than expect the person helping you to type it all out from a screen shot.
Like this:
123456789101112131415161718192021222324//PRC_True Balance of Power | indicator//11.10.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//converted from Pinescript version//---settings//per=30 //periods for Emoline//---end of settingstrhi = max(high, close[1]) //true hightrlo = min(low, close[1]) //true lowtrop = close[1] //true openbop = 100*(close-trop)/(trhi-trlo) //True Balance of Power as percentlin= 1.5*linearregression[per](bop) //linear regression as emoliner=0g=255if bop<0 thenr=255g=140endifreturn bop coloured(r,g,0) style(histogram) as "BOP", lin style(line,3) as "Emoline"Alternatively provide a link to where the code can be found:
https://www.prorealcode.com/prorealtime-indicators/balance-of-power/
11/06/2020 at 9:34 AM #14963311/06/2020 at 12:22 PM #149666You explained yourself very well, but it’s impossible, since:
- TSV cannot drop below 0
- TSV has a different scale than BOP.
11/06/2020 at 12:28 PM #149667In your image TSV has been somehow normalised to only return between -100 and +100. We would need to know how this normalisation has been calculated. In this example I have normalised it by comparing the current TSV to the highest and lowest TSV values in the last P1 bars.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//PRC_True Balance of Power | indicator//11.10.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//converted from Pinescript version//---settingsper=30 //periods for Emoline//---end of settingstrhi = max(high, close[1]) //true hightrlo = min(low, close[1]) //true lowtrop = close[1] //true openbop = 100*(close-trop)/(trhi-trlo) //True Balance of Power as percentlin= 1.5*linearregression[per](bop) //linear regression as emoliner=0g=255if bop<0 thenr=255g=140endif// TSV Time Segmented Volume indicator//// --------------------------------------------------------------------------------------// 13 = number of daily HALF HOURS// 7 = ????// --------------------------------------------------------------------------------------// Example Settings:// Short Term Trading : TSV period between 9 and 12// Intermediate Term Trading: TSV period between 18 and 25// Long Term Trading : TSV period between 35 and 45//// --------------------------------------------------------------------------------------ONCE p1 = 13ONCE p2 = 7ONCE Mtype = 0p1 = max(1,min(999,p1))p2 = max(1,min(999,p2))Mtype = max(0,min(6,Mtype))once lookback = p1MyVol = 0IF close > close[1] THENMyVol = volume * (close - close[1])ELSIF close < close[1] THENMyVol = -volume * (close - close[1])ENDIFTSV = summation[lookback](MyVol)maxtsv = highest[lookback](tsv)mintsv = lowest[lookback](tsv)tsvresult = (((tsv-mintsv)/(maxtsv - mintsv))*200)-100Signal = average[p2,Mtype](TSVresult)RETURN bop coloured(r,g,0) style(histogram) as "BOP", lin style(line,3) as "Emoline", TSVresult AS "Tsv",Signal AS "Signal"11/06/2020 at 1:40 PM #14967811/14/2020 at 2:36 AM #150441I think the correct code should be like the one attached,
I don’t know if this is correct since I don’t know much about programming but it makes much more sense.
123456789101112131415161718IF close > close[1] THENMyVol = volume * (close - close[1])ELSIF close < close[1] THENMyVol1 = volume * (close[1] - close)ENDIFVol = MyVol-MyVol1TSV = summation[per](Vol)Signal = average[sign](TSV)if TSV >= TSV[1] thencolor =1elsecolor =-1endifRETURN TSV coloured by color AS "Tsv",Signal AS "Signal"11/14/2020 at 2:45 AM #150443It’s the same, but since the formula I could find is TSV=(Sum( IIf( C > Ref(C,-1), V * ( C-Ref(C,-1) ), IIf( C < Ref(C,-1),-V * ( C-Ref(C,-1) ), 0 ) ) ,18)); I wrote as I did.
Multiplying 10*-1000 is the same as multiplying -10*1000.
There should be no difference on your chart.
-
AuthorPosts
Find exclusive trading pro-tools on