Announcement

Collapse
No announcement yet.

Horizontal Line following Last Price

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

  • Horizontal Line following Last Price

    Someone have formula to get a Horizontal Line to be continously draw and following (moving) with the Last Price.

    P.s. I want to use on a P2B abd PNF chart type.

    Appreciate. Swinger

  • #2
    Swinger
    The enclosed script will plot a horizontal line at the last traded price
    Alex

    PHP Code:
    function preMain() {
        
    setPriceStudy(true);
        
    setShowCursorLabel(false);
    }
     
    function 
    main() {
        
    clearLineTool(LineTool.HORZ);
        
    addLineTool(LineTool.HORZ,getMostRecentTrade(),1,Color.blue,"horz");
        
        return 
    null;

    Comment


    • #3
      Close Line

      How could you do it in a 5 min chart where every five min the chart adds a new bar and the line then sets its self off of the prior bars close and not off the prior days settlement.

      Comment


      • #4
        jnorton
        Just retrieve the value of the close() at whatever prior bar you want and use that value in the addLineTool()
        Alex

        Comment


        • #5
          5 Min Candles

          Alex,

          I have a five minute candle study running. the problem with just using close(),close(-1),close(-2). and so, on is that every five min a new bar is placed an the line would draw relative to the prior bars close and not the prior days close. Is there aw ay without having to put together a barcount if else statment to just have the system use the prior days close and not the prior bars close?

          Comment


          • #6
            jnorton
            In that case use the Prev Close.efs that is available in the OHLC folder. You can either transfer the addLineTool() logic to that efs or use the call() function to retrieve the value to be used in the efs I posted earlier in this thread.
            Alex

            Comment


            • #7
              Horizontal Line following Last Price

              Thanks Alexis for your response. I try the formula this morning and work good.
              However when I reopen esignal...the formula do not download.
              Than more come as I delete it and put it back, it doesn't load.
              Than it work good on some P2B but not on others....and on some symbol PNF but not on other symbol.
              Overall the formula is not stable...Is there something to change that could make it more stable.
              Swinger

              Comment


              • #8
                Swinger
                As far as I have seen the formula is working fine.
                What exactly did you copy from my post and how/where did you save it?
                Also can you provide a symbol/interval on which it is not working at your end.
                Alex

                Comment


                • #9
                  Horizontal Line following Last Price

                  I copy/paste into esignal/tool/ formula editor and save into esignal/formula/enrin

                  I use it with RIMM or GOOG on a P2B (HL/2, 3bar reversal) with interval 10000V

                  If I start the formula after open and remove it before close esignal....its fine. Otherwise it doesn't download or make the chart unstable.

                  Thanks!! Swinger

                  Comment


                  • #10
                    Swinger
                    Try the revision enclosed below.
                    Alex

                    PHP Code:
                    function preMain() {
                        
                    setPriceStudy(true);
                        
                    setShowCursorLabel(false);
                    }
                     
                    function 
                    main() {

                        
                    clearLineTool(LineTool.HORZ);
                        if(
                    getMostRecentTrade()==null) return;
                        
                    addLineTool(LineTool.HORZ,getMostRecentTrade(),1,Color.blue,"horz");
                        
                        return 
                    null;

                    Comment


                    • #11
                      Horizontal Line following Last Price

                      Thanks MR.Alexis

                      The second version upload well on esignal opening...and is stable through the day!!

                      Thumbs up!

                      Comment


                      • #12
                        Alex,

                        Can you create a horizontal line tool that when you choose this tool and click on a place on the chart,the lie will be drawn where you want it aand stop at the current or last bar. Of corse options to change color of the line,thickness,and type of line ie solid, doted etc.
                        Much thanks,

                        Bob Sklovsky

                        Comment

                        Working...
                        X