Announcement

Collapse
No announcement yet.

Linking P&F and Bar Charts

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

  • Linking P&F and Bar Charts

    In the January 2005 S&C Robert Busby describes a data sequence called P&F data:

    "Let Price be the daily price series of some financial instrument; construct a P&F chart of Price using any chosen method.

    Now walk through the chart in sequence from the first X or O, and for each symbol encountered, record the box value. We call the resulting data sequence P&F data for Price, and denote it by PF(Price).

    Next, replot the P&F chart, moving one square to the right before entering each symbol.

    Then replace the (now-unnecessary) symbols with dots, and connect the dots."

    How can we plot such a P&F equivalent line-chart in eSignal?

  • #2
    Hello helmutw,

    A custom EFS formula would need to be developed that recreates the P&F logic internally using the bar chart data. Then return the P&F results to the bar chart.
    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


    • #3
      Hallo Jason,

      last weekend I startet to develop a code for this.


      Some times ago I tried this in Excel, with reasonable results.

      Just have a look, at my Excel Chart with my so called "Renko-Line"
      Attached Files

      Comment


      • #4
        This is the way, I calculate the "Renko-Line" in Excel.
        Attached Files

        Comment


        • #5
          My first try to "translate" this in efs-language.

          Please have a look, something different than my Renko Line in Excel...

          Unfortunately I have no idea, how I have to to change my efs-code.

          Can you please help me?



          /************************************************** **************************************************
          Example Renko Line for QQQQ
          ************************************************** ************************************************** */



          function preMain() {
          setPriceStudy(true);
          setStudyTitle("Renkoline Close");
          setCursorLabelName("CloseRenko",0);
          setDefaultBarFgColor(Color.blue,0);
          setDefaultBarFgColor(Color.blue,1);
          setDefaultBarThickness(2,0);
          }

          function main(Start, Boxsize) {

          if (Start == null) Start = 40;
          if (Boxsize == null) Boxsize = 1;

          var Brick = (close(0) - Start);

          if (Brick < 0 ) var Brickfl = Math.ceil (close(0) - Start);
          if (Brick >=0 ) var Brickfl = Math.floor (close(0) - Start);

          var Renkoline = Start + Brickfl;




          return new Array(Renkoline, Renkoline);
          }



          /************************************************** ******************
          Example Brick Line for QQQQ
          ************************************************** ************************************************** */



          function preMain() {
          setPriceStudy(false);
          setStudyTitle("Brick");
          setCursorLabelName("HighRenko", 0 );
          setCursorLabelName("LowRenko", 1 );
          setCursorLabelName("CloseRenko", 2 );
          setDefaultBarFgColor(Color.blue, 0);
          setDefaultBarFgColor(Color.blue, 1);
          setDefaultBarFgColor(Color.green, 2);
          setDefaultBarThickness(2,0);
          }

          function main(Start, Boxsize) {

          if (Start == null) Start = 40;
          if (Boxsize == null) Boxsize = 1;

          var Brick = (close(0) - Start);

          if (Brick < 0 ) var Brickfl = Math.ceil (close(0) - Start);
          if (Brick >=0 ) var Brickfl = Math.floor (close(0) - Start);

          return new Array(Brick, Brickfl);
          }
          Attached Files

          Comment


          • #6
            helmutw
            FWIW Chris Kryza has written a Renko study for use with bar charts. If interested you can find it here
            Alex

            Comment


            • #7
              Hello helmutw,

              The code below should be a closer translation of your excel example. However, it doesn't appear to reproduce the corresponding renko numbers from the renko chart type.

              PHP Code:
              function preMain() {
                  
              setPriceStudy(true);
                  
              setStudyTitle("Renkoline Close");
                  
              setCursorLabelName("CloseRenko",0);
                  
              setDefaultBarFgColor(Color.blue,0); 
                  
              setDefaultBarThickness(2,0);
              }

              var 
              Start null;
              var 
              Renkoline null;
              var 
              Renkoline1 null;

              function 
              main(Boxsize) {
                  var 
              nState getBarState();
                  
                  if (
              Boxsize == nullBoxsize 1;

                  if (
              Start == nullStart close(-1);
                  if (
              Start == null) return;
                  
                  if (
              Renkoline1 == nullRenkoline1 Start;
                  if (
              nState BARSTATE_NEWBAR && Renkoline != nullRenkoline1 Renkoline;
                  
                  var 
              Brickfl Renkoline1 Math.round((close(0) - Renkoline1) / Boxsize) * Boxsize;
                  
                  
              Renkoline Brickfl;
                  
                  return 
              Renkoline;

              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


              • #8
                @ Alexis

                Great Link and great step forward! Thanks a lot.

                Is it possible to change this code, to separate Bricksize and Reversal Factor to modify the Renko Charts to P&F Line Charts?

                I agree with Robert Busby thinking Renko Charts are modified P&F Charts with Reversal Factor 1.


                @Jason

                Thanks to you for translating.

                "it doesn't appear to reproduce the corresponding renko numbers from the renko chart type."

                That´s the problem. My Excel Formula adds the brickvalue to the data from the previos days Renko Line value . This line is reasonable.

                My Efs Code allways adds the brick value to the startvalue. This posts wrong results. Unfortunately I am not able to code this in efs.

                Maybe you can help.

                Comment


                • #9
                  helmutw
                  You may want to redirect your question to Chris Kryza who wrote the efs.
                  Alex

                  Comment

                  Working...
                  X