Time Segmented Volume by Worden Brothers code

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #150445 quote
    robertogozzi
    Moderator
    Master

    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

    Thank you 🙂

    #150447 quote
    Barrabas15
    Participant
    Master

    Try the code sent and you will see that it is not the same.

    Time-Segmented-Volume-TSV.jpg Time-Segmented-Volume-TSV.jpg
    #150451 quote
    robertogozzi
    Moderator
    Master

    The 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

    #150470 quote
    Barrabas15
    Participant
    Master

    Apparently, 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.

    TSV-Time-Segmented-Volume-2.itf TSV-Imagen.jpg TSV-Imagen.jpg TSV-Cod.-Tradinview.jpg TSV-Cod.-Tradinview.jpg
    #150477 quote
    robertogozzi
    Moderator
    Master

    What 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!

    #150484 quote
    Barrabas15
    Participant
    Master

    The 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).

    #150485 quote
    Barrabas15
    Participant
    Master

    Anyway, “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.

    #150506 quote
    robertogozzi
    Moderator
    Master

    Actually 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 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 = 0
    p1           = max(1,min(999,p1))
    p2           = max(1,min(999,p2))
    Mtype        = max(0,min(6,Mtype))
    MyVol = 0
    IF close <> close[1] THEN
    //IF close > close[1] THEN
       MyVol = 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])
    ENDIF
    TSV    = summation[p1](MyVol)
    Signal = average[p2,Mtype](TSV)
    RETURN TSV AS "Tsv",Signal AS "Signal",0 AS "0"
    x-4.jpg x-4.jpg TSV-Time-Segmented-Volmodif..itf
    #179158 quote
    Guibourse
    Participant
    Average

    Hi,

    I’m a beginner. I’ve heard that Volume is not available on PRT on CFDs. I use PRT with IG to trade CFD. Can you confirm/explain that ? It would made this indicator useless.

    Thanks so much for your precious help !

    #179159 quote
    robertogozzi
    Moderator
    Master

    It 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.

Viewing 10 posts - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.

Time Segmented Volume by Worden Brothers code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
al_craig @al_craig Participant
Summary

This topic contains 24 replies,
has 5 voices, and was last updated by robertogozzi
4 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/05/2020
Status: Active
Attachments: 11 files
Logo Logo
Loading...