Announcement

Collapse
No announcement yet.

Horizontal Lines at set Price Intervals?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Horizontal Lines at set Price Intervals?

    Hi,
    Is there an efs that will draw horizontal lines at set price intervals on an Index (or stock) - for example:

    - A Horizontal line drawn at 5 Point intervals between 1000 and 1100 on the ES #F (eg: 1000 - 1005 - 1010...etc)

    Thanks,
    Paul

  • #2
    One simple solution...

    One simple solution would be to just create a file that returns the values you want to display....

    like this....


    PHP Code:
    function preMain() {
            
    setStudyTitle("Price Levels");
            
    setShowCursorLabel(false);
            
    setPriceStudy(true);
    }

    function 
    main() {

    return new Array (
    10001005101010151020);

    another way would be to create the code to draw the lines...

    PHP Code:
      var vHour;
      var 
    vMin;
      var 
    vSec;
      var 
    vDay;
      var 
    vMonth;
    var 
    BarStartToday 0;
    var 
    nLastRawTime 0;
    var 
    BarCount 0;

    function 
    preMain() {
            
    setStudyTitle("Price Levels");
            
    setShowCursorLabel(false);
            
    setPriceStudy(true);
    }

    function 
    main(Price1,Price2,Price3,Price4) {

      var 
    vTime = new Date();
    //---------------------------------------------------
    //  Get Time Variables 
      
    vTime getValue("Time"0);
      
    vHour vTime.getHours();
      
    vMin vTime.getMinutes();
      
    vSec vTime.getSeconds();
      
    vDay vTime.getDate();
      
    vMonth vTime.getMonth() +1;

    if (
    getValue("rawtime"0) != nLastRawTime) {
         
    nLastRawTime getValue("rawtime"0);
         
    BarCount += 1;
       if (
    vDay != LastDay) {
         
    LastDay vDay;
         
    BarStartToday BarCount;
       }
    }


    if (
    Price1 != null) {
       
    drawLineRelative((BarStartToday-BarCount),Price10Price1PS_SOLID1Color.blue"Line1");
    }
    if (
    Price2 != null) {
       
    drawLineRelative((BarStartToday-BarCount),Price2 0Price2 PS_SOLID1Color.blue"Line2");
    }
    if (
    Price3 != null) {
       
    drawLineRelative((BarStartToday-BarCount),Price3 0Price3 PS_SOLID1Color.blue"Line3");
    }
    if (
    Price4 != null) {
       
    drawLineRelative((BarStartToday-BarCount),Price4 0Price4 PS_SOLID1Color.blue"Line4");
    }

    return;

    Hope this helps...

    B
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Hello Paul,

      Check out this thread on LinesLabels.efs. This will allow you to set up 30 lines with the option of labels. It has an additional feature that will allow you to have the same lines drawn on additional charts running the same formula. To turn that on set the input parameter, vEditing, to true. Set the levels for the lines in your main chart and any other charts running the formula will display the same lines.
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #4
        Hi Jason / Brad,
        Thanks for your replies - much appreciated.

        Jason - i've used your efs on 3 seperate adv charts, each using different levels for the lines. I'd like to use it on 3 more adv charts of the ES #F, but these 3 charts will share the same line levels (via the vEditing option) - do i rename the study "LinesLabels - ES #F" - because i don't want it to affect the other 3 adv charts in my layout with this study on?

        Thanks,
        Paul

        Comment


        • #5
          Hello Paul,

          Your request gave me an idea for rewriting LinesLabels.efs. Please visit this link and try the new version (2.0). All the details as to what has changed are listed in the updated thread. The main modification is that the formula is now symbol specific so you can use it for the purpose you described in your post. You will not need to make any modifications to the formula. Simply apply the same formula to as many groups of charts as you want. Only the charts with the same symbol will share the inputs for the lines and labels. You just have to remember which chart is your main editing chart for each symbol (determined by setting vEditing to true). Try it out and let me know if you have any questions.
          Jason K.
          Project Manager
          eSignal - an Interactive Data company

          EFS KnowledgeBase
          JavaScript for EFS Video Series
          EFS Beginner Tutorial Series
          EFS Glossary
          Custom EFS Development Policy

          New User Orientation

          Comment


          • #6
            Hi Jason,
            Thanks for the updated study. I tested it yesterday and everything worked fine.

            Paul

            Comment

            Working...
            X