Announcement

Collapse
No announcement yet.

check 30 min bar open

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

  • check 30 min bar open

    I have managed to confuse myself, and my be making this more difficult than it has to be. I have a 5 min chart. I need to compare the sessions first 30 min high/lows with each subsequent 30 min bar high/low. Is there an easy way to do this? I started out using:

    vH= myLib_dsgetMaxValueAtRange("07:30", "8:00", 0, high(inv(30))

    but in my thinking I would need to setup that line for each of the 14 bars. There must be a bettrer way. Any ideas?

  • #2
    Hell Jeff-b,

    I'm not completely sure what you're trying to accomplish, but the easiest way to refer to the higher time frame interval is by simply basing a high() and low() series on the 30 min interval with inv(). This functionality automatically synchronizes the 5 min bar with the corresponding 30 min bar, so there is no need to handle this with custom coding that looks a bar times specifically.

    Here's a basic example. Hope this helps.

    PHP Code:
    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("example");
        
    setCursorLabelName("high30"0);
        
    setCursorLabelName("low30"1);
    }

    var 
    xHigh null;
    var 
    xLow null;

    function 
    main() {
        if (
    xHigh == nullxHigh high(inv(30));
        if (
    xLow == nullxLow low(inv(30));
        
        
    // Use the nH30 and nL30 vars for conditional statements and/or alerts
        
    var nH30 xHigh.getValue(0);
        var 
    nL30 xLow.getValue(0);
        if (
    nH30 == null || nL30 == null) return;

        return new Array(
    getSeries(xHigh), getSeries(xLow));

    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

    Working...
    X