Announcement

Collapse
No announcement yet.

diferent values

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

  • diferent values

    Good morning to everybody,

    Hope somebody can help me...

    If I'm on the 2 hour interval, is there a way to know
    the value that a candle had on the 1 minute interval
    100 minutes ago ( 100 candles before)?

    have a great day,

    Jaime

  • #2
    The close would be:

    close(-100, inv(1));

    You could have a simple study to plot/return the value:

    PHP Code:
    function main()

    return( 
    close(-100,inv(1) ) ; 
    But, it's your lucky day because I wrote a couple of studies for you to use.

    The first study, TRO_OldPrice, gives you what you asked for:

    PHP Code:
    /****

    TRO_OldPrice 1:41 PM 8/15/2006   PLOT/DISPLAY price from user interval, periods ago
     
    Programmer:  Avery T. Horton, Jr.  aka *************,  

    please include this and/or any other comment blocks and a 
    description of any changes you make.

    ****/

    function preMain() {

        
    setComputeOnClose();    //force this script to only update on each new bar 

        
    setPriceStudy(true);
        
    setStudyTitle("TRO_OldPrice");
        
    setCursorLabelName("OldPrice"0); 

        
    setDefaultBarFgColor(Color.blue,0); 

        
    setDefaultBarThickness(2,0);  

        
    setPlotType(PLOTTYPE_LINE ,0);  

        var 
    iInterval = new FunctionParameter("iInterval"FunctionParameter.NUMBER);
        
    iInterval.setDefault); 

        var 
    iPeriods = new FunctionParameter("iPeriods"FunctionParameter.NUMBER);
        
    iPeriods.setDefault( -100 );
     
    }

    askForInput();
     
    function 
    mainiInterval iPeriods ) {

    var 
    xPrice =    close(iPeriodsinv(iInterval) )   ;

    return( 
    xPrice );  
     

    This second study, TRO_BarCount, I wrote to check my work:


    PHP Code:
    /****

    TRO_BarCount 1:41 PM 8/15/2006   PLOT/DISPLAY BAR COUNT
     
    Programmer:  Avery T. Horton, Jr.  aka *************,  

    please include this and/or any other comment blocks and a 
    description of any changes you make.

    ****/

    function preMain() {

        
    setComputeOnClose();    //force this script to only update on each new bar 

        
    setPriceStudy(true);
        
    setStudyTitle("TRO_BarCount");
        
    setCursorLabelName("BarCount"0); 
        
    setDefaultBarFgColor(Color.black,0); 
     
    }
      
    function 
    main() {

    return( 
    ""+getCurrentBarCount() );  


    HTH.
    Attached Files
    Last edited by buzzhorton; 08-15-2006, 02:54 PM.

    Comment


    • #3
      Thanks a lot,

      have a great day,

      Jaime

      Comment

      Working...
      X