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/14/2020 at 2:48 AM #150445
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Thank you 🙂
11/14/2020 at 2:55 AM #150447Try the code sent and you will see that it is not the same.
11/14/2020 at 4:36 AM #150451The differences are due to:
- you do not clear variables MyVol and MyVol1 at the beginning, so in the (rare) case close and close[1] are equal instead of 0 they retain the previous value
- in the formula there’s no evidence of the subtraction MyVol-MyVol1.
https://usethinkscript.com/threads/time-segmented-volume.519/
https://futures.io/thinkorswim/10957-time-segmented-volume-worden-telecharts.html#post122215
11/14/2020 at 1:30 PM #150470Apparently, according to the attached data, there is an error in the indicator code.
Attached .itf file with the modified data. The appearance seems much more consistent with price tracking.11/14/2020 at 2:45 PM #150477What seems is NOT what it is, you are posting code that is different from the formula you posted yourself!
It’s Barrabas15‘s modified TSV, not the original one!
11/14/2020 at 3:09 PM #150484The last code is from the Tradingview platform (not mine).
In all the websites that comment on this indicator it is indicated that the oscillator crosses the 0 line both up and down. In this case it is fulfilled (in the edited Prorealcode not).11/14/2020 at 3:24 PM #150485Anyway, “robertogozzi” is right. The indicator I have attached is not the official one. The indicator that I have attached is a translation by me of a code that they have made for the Tradingview platform. Therefore, if you are not convinced of its effectiveness, please do not use it.
11/14/2020 at 6:27 PM #150506Actually ALL websites (Worden’s too) talk about ZERO crossing.
I think the formula I used (TSV=(Sum( IIf( C > Ref(C,-1), V * ( C-Ref(C,-1) ), IIf( C < Ref(C,-1),–V * ( C-Ref(C,-1) ), 0 ) ) ,18));) has an unneeded “-” sign in front of the second reference of V (volume). Since it negates an already negative value, thus making it positive and affecting the subsequent sum.
Simply removing that minus sign appears to be the solution.
I actually found ONCE the correct formula (without the MINUS sign), but ALL other sites had that sign, so I used the most used, which, instead is the incorrect one. I think that is due to a wrong Copy & Paste by those websites.
Anyway, thanks to @Barrabas15 for spotting an issue that helped me work it out.
The correct code of TSV is:
TSV Time Segmented Volume123456789101112131415161718192021222324252627282930313233343536373839// 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//// --------------------------------------------------------------------------------------// apparently wrong formula://// TSV=(Sum( IIf( C > Ref(C,-1), V * ( C-Ref(C,-1) ), IIf( C < Ref(C,-1),-V * ( C-Ref(C,-1) ), 0 ) ) ,18));// ↑// --------------------------------------------------------------------------------------// apparently CORRECT formula://// TSV=(Sum( IIf( C > Ref(C,-1), V * ( C-Ref(C,-1) ), IIf( C < Ref(C,-1), V * ( C-Ref(C,-1) ), 0 ) ) ,18));//// (the difference is not using the "-" sign if front of the second reference to V, since it negates// a negative value, thus making it positive, thus invalidating the following summation)// --------------------------------------------------------------------------------------//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] THEN//IF close > close[1] THENMyVol = volume * (close - close[1]) //It's automatically negative when current CLOSE is lower than the previous candles's//ELSIF close < close[1] THEN//MyVol = volume * (close - close[1])ENDIFTSV = summation[p1](MyVol)Signal = average[p2,Mtype](TSV)RETURN TSV AS "Tsv",Signal AS "Signal",0 AS "0"10/06/2021 at 11:17 PM #17915810/07/2021 at 2:47 AM #179159It is available for all the instruments for which the broker makes it available.
It is available for most of them, even for currency pairs since a few months ago.
-
AuthorPosts
Find exclusive trading pro-tools on