"Display Line Name" code

Forums ProRealTime English forum ProBuilder support "Display Line Name" code

Viewing 11 posts - 1 through 11 (of 11 total)
  • #18631

    Hi there

    I was after the code that allows you to add a line name option to various lines that are produced by an indicator, very similar to the “Pivot Points” indicator, which allows you to toggle on/off the line name of the various pivots i.e. R1, R2,R3 etc etc.  Unfortunately I haven’t been able to access the code for that particular indicator.

    Thanks a lot in advance.

    #18663

    Add text on chart is only possible with the new instructions of the PRT 10.3 version. What version are you using?

    I remember have made something similar, as an example in the documentation, you can find the code right here (first example): draw text on chart

    Please tell us if you have any other trouble or questions. Thank you.

    #18676

    Thanks a lot Nicolas, example one looks spot on. I am using V10.2, I will give it a go and see how I get on. I appreciate the help!!

    #18683

    Hi Nicolas,

    I think it may be a bit tricky for me to try and work out, I am not much of a coder I am afraid and it could be, as you say, that the labelling isn’t an option on v10.2 (although I was using one of PRT’s standard indicators and they had labels attached so there must be a way to do it).  Not sure if you are able to assist nay further but I have added below the indicator code as it may assist:

    MP = UNDEFINED
    CBOL = UNDEFINED
    CBOS = UNDEFINED
    CSHT = UNDEFINED
    CLNG = UNDEFINED
    MR3 = UNDEFINED
    MR2 = UNDEFINED
    MR1 = UNDEFINED
    MS1 = UNDEFINED
    MS2 = UNDEFINED
    MS3 = UNDEFINED
    MMLO = UNDEFINED
    MMHI = UNDEFINED
    MGAP = UNDEFINED
    MPDH = UNDEFINED
    MPDL = UNDEFINED

    SHOW = (TodayOnly and DATE[0] > Yesterday)

    IF SHOW or NOT TodayOnly THEN
    MP = ( (MClose + MHi + MLo ) / 3)
    CBOL = MClose + ( ( (MHi – MLo) * 1.1) / 2)
    CSHT = MClose + ( ( (MHi – MLo ) * 1.1) / 4)
    CBOS = MClose – ( ( (MHi – MLo ) * 1.1) / 2)
    CLNG = MClose – ( ( (MHi – MLo ) * 1.1) / 4)
    MR3 = MHi + ( 2 * (MP – MLo) )
    MR2 = MP + (MHi – MLo)
    MR1 = (2 * MP) – MLo
    MS1 = (2 * MP) – MHi
    MS2 = MP – (MHi – MLo)
    MS3 = MLo – ( 2 * (MHi – MP) )
    MMLO = MLO
    MMHI = MHI
    MPDH = PDH
    MPDL = PDL
    MGAP = MCLOSE
    ENDIF
    RETURN MP COLOURED(95,95,100) as “Pivot”, CBOL COLOURED(30,235,5) as “CBOL”, CLNG COLOURED(30,235,5) as “CLNG”, CSHT COLOURED(30,235,5) as “CSHT”, CBOS COLOURED(30,235,5) as “CBOS”, MR3 COLOURED(45,75,240) as “R3”, MR2 COLOURED(45,75,240) as “R2”, MR1 COLOURED(45,75,240) as “R1”, MS1 COLOURED(45,75,240) as “S1”, MS2 COLOURED(45,75,240) as “S2”, MS3 COLOURED(45,75,240) as “S3”, MGAP COLOURED(235,5,30) as “Close”, MMHi COLOURED (235,5,30) as “Hi”, MMLo COLOURED (235,5,30) as “Lo”, MPDH COLOURED (230,90,10) as “PDH”, MPDL COLOURED (230,90,10) as “PDL”

    Thanks a lot

    Andrew

     

    #18690

    For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    Well, as I told you, labeling is not possible with the code in PRT version before 10.3 I’m sorry. The best you could do is to add a different color for each of the returned lines of your indicator.

    #18693

    Thanks Nicolas, will stick with the coloured lines for the time being. Only reason I think it is possible is that on v10.2, there are pro real time indicators that have line labels on them by default so you would think that there is a way of doing it. I have emailed them directly so will see how I get on. Noted re attaching code, makes sense. Cheers

    #29339

    Hi Nicolas,

    I have now managed to upgrade to V10.3 – I have attached the PRT code.  Any chance you could help me by just including the formula (and any other initial code that is required) for one of the pivots into the existing code and I can then go ahead and replicate for the remaining ones.  Basically just looking to have the labels on the righthand side above the lines

    Thanks a lot

    Andrew

     

    #29995

    There is a complete example on how to display pivot labels in the online documentation of the website : DRAWTEXT

    (example 1). This example suits perfectly your query!

    #30102

    Thanks Nicolas, appreciate it, I tried putting just part of the formula in for the pivot to see if could get it working just for one line before adding the rest and it came up with an error with the voffset element – I am sure there is an easy fix but have zero programming skills so doesn’t stand out for me.  Any help would be great.  I have attached a link for a screen shot of the formula

    Thanks

    #30278

    The error come from the fact that RETURN line must be the last line of your code, no other codes can be written below it!

    #30295

    All sorted now!! Thanks again for all your help

Viewing 11 posts - 1 through 11 (of 11 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login