Announcement

Collapse
No announcement yet.

Displaying output from a study ONLY in the cursor window?

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

  • Displaying output from a study ONLY in the cursor window?

    I have an EFS that gives a result that I would like to be able to view in the cursor window, but that I prefer not be displayed directly on the chart. How is this most easily accomplished?
    Tom

  • #2
    Tom,

    We stumbled upon a way to do this. First setPriceStudy(true); in preMain(), then return the desired result as a string. To convert a number to a string concatenate a "" to the result. Here's an example displaying the mid-point between the high and low of a bar.

    PHP Code:
    /***********************************************
    Copyright © eSignal, 2003
    Title:        Mid-Point in Cursor Window
    Version:    1.0

    ==============================================
    Fix History:
    n/a

    ==============================================
    Project Description:  
    This EFS displays the midPoint ((H+L)/2) on the Cursor Window, but returns
    no other visible value to the chart.

    ***************************************************/


    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("MidPoint");
        
    setCursorLabelName("MidPoint");
    }

    function 
    main() {

        var 
    vHL2;

        
    // Get High and Low values
        
    var vHigh high();
        var 
    vLow low();
        
        
    // Check for valid High and Low
        
    if (vHigh == null || vLow == null) return;
        
        
    // Calculate Mid-Point
        
    vHL2 = (vHigh vLow) / 2;
        
        
    // Convert to string
        
    vHL2 vHL2 "";
        
        return 
    vHL2;

    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Thank you.
      Tom

      Comment


      • #4
        Could this be applied to ATR?

        Comment


        • #5
          JT
          Yes you can do it with ATR too. Here enclosed is an example of the same workaround suggested by Jay and applied to an ATR Study.
          Alex

          PHP Code:
          var vATR14 = new ATRStudy(14);

          function 
          preMain() {

              
          setPriceStudy(true);
              
          setStudyTitle("ATR");
              
          setCursorLabelName("ATR"0);
          }

          function 
          main() {
           
              return 
          formatPriceNumber(vATR14.getValue(ATRStudy.ATR))+"";

          Comment

          Working...
          X