What does the command “Line” mean and how is it used ?

Forums ProRealTime English forum ProBuilder support What does the command “Line” mean and how is it used ?

Viewing 12 posts - 1 through 12 (of 12 total)
  • #238666

    There is a command called “Line” in the command list f(x), when an indicator is coded. But I find nothing in the language documentation. Does anyone know how this command is used and what the parameters are ?

    Or, is there a simple way or a simple command that allows calculation of a straight line between two points in an automatic trading system ?

    For example, in a 1 second chart, I’d have two points, price = 20000 at Time = 100000, and price = 20100 at Time = 101010, and I want to calculate the value of this line at the current time. Is there a simple command to do this or do I have to calculate the line manually, for example using the Unix time stamp “timestamp” and then calculating the slope of a line between the two points ?

    Thank you for any recommendations.

    #238667

    I do not want to draw a line into a chart, but I want to calculate the current value of any line between 2 points in a trading system.

    #238669

    I mean this command called “line” :

     

    #238683

    To calculate the 2 points you need barindex and price and then use those to draw or calculate the line between them by subrtacting the 2 numbers from eatch point from the other point 😛

     

    #238684

    I have just written some small code for a 1 second chart that calculates a line between 2 points of (Price1, Time1) and (Price2, Time2) and returns all values of this line, when time is larger than Time2. Does anyone know a simpler way to do this ?

     

    #238688

    To calculate the 2 points you need barindex and price and then use those to draw or calculate the line between them by subrtacting the 2 numbers from eatch point from the other point 😛

     

    You can’t do this in a 1 second chart, because there is no new bar at every given second. For many seconds, no bar is shown and barindex does not rise. So you must count the seconds instead of barindex.😛😛😛

    1 user thanked author for this post.
    #238689

    So nobody knows what this obscure command “line” means ?

    #238701

    Hi…

    In the code editor, choosing the ‘All Categories’ via the ‘fx’ icon, brings up a list of available functions.

    Some of these functions are indicator functions and some are the Probuilder Keywords.

    These keywords sometimes take a limited set of pre-determined value’s, these also appear in the list.

     

    When you look at the ‘fx’ comments for ‘LINE’ , it states, “Line” style.

    If you use drawing keywords like, DRAWLINE(x1,y1,x2,y2)   you can add following additional parameters after,  Coloured(r,g,b,a), Style(Type,Thickness)

    In the ‘Style’ syntax, ‘Line’ is the option value of the ‘Type’ of line drawn, ‘Line’ refers to a full/ continuous line.

    https://www.prorealcode.com/documentation/style/

    2 users thanked author for this post.
    #238702

    Thank you very much. I did a search in the documentation, but “line” did not show up. Thanks again.

    #238711

    Following  the STYLE documentation link.

    Under the heading, ‘Styling Options Available:’

    ‘LINE’ is the first option, it also states that it is the default style.

    This is why all lines appear with this style even if the ‘STYLE’ keyword is not used.

     

    PRC

    Regarding the search, you are right that ‘Line’ doesn’t appear with the general search.

    The general search doesn’t appear to search the Help/ProBuilder Language Documentation.

    ‘Line’ doesn’t appear if using Help/ProBuilder Language Documentation search feature either.

    PRT

    ‘Line’ does appear if you use the function search from the code editor however, with the cryptic comment.

    Manual

    It does appear in the Glossary of keyword on Page 58.

    https://assets.prorealtime.com/pdfs/en/probuilder.1718e2f6.pdf

    1 user thanked author for this post.
    #238733

    I have seen the LINE command you are talking about, but there’s no instruction, nor indicators, with that exact name. It’s been highlighted being a reserved keyword to be used with the instructio STYLE, as druby said, just to make sure everyone knows it’s a reserved name not to be used to name a variable.

     

     

    #238765

    I made a mistake in the code for the calculation of a line between 2 points in a 1 second chart. When you read the 2 points from a line you have manually drawn in a chart, not “Time” has to be taken for the description of the time of a certain point, but “Opentime”, which is the time at the opening of a bar. It is “opentime” what the box for details of a line shows (see image), not the time at the closing of a bar.

    So the code should read as follows :

    This code delivers the future points of a line manually drawn in a 1 second chart (see image), after the time of point 2. Before this time, the line can of course not be calculated, and therefore I have set all values before TIME2 to “close”.

    “valuenow” can be used in an automatic trading system for the current value of this line you have drawn before in a chart.

     

    1 user thanked author for this post.
Viewing 12 posts - 1 through 12 (of 12 total)

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