Announcement

Collapse
No announcement yet.

please help me with this study

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

  • please help me with this study

    I want to draw a line of the ESmini in the NASmini chart - but the following formula does not work. Does a/b know why, or what I have to change??

    function preMain() {
    setPriceStudy(false);
    }
    var OVol = 0;
    function main() {

    if ( close(0,1,"ES M5") > close(-1,1,"ES M5")) OVol += volume(0,1,"ES M5");

    else if ( close(0,1,"ES M5") < close(-1,1,"ES M5") ) OVol -= volume(0,1,"ES M5");

    return OVol;
    }


    regards
    Roger

  • #2
    Roger..

    Looks like your calculations are creating an INFINITE number - causing the rest of the code to fail.

    You can see for yourself what is happening with this code.

    function preMain() {
    setPriceStudy(false);
    }
    var OVol = 0;
    function main() {

    if ( close(0,1,"ES M5") > close(-1,1,"ES M5")) { OVol += volume(0,1,"ES M5"); }

    else if ( close(0,1,"ES M5") < close(-1,1,"ES M5") ) { OVol -= volume(0,1,"ES M5"); }

    debugPrintln(OVol);
    return OVol;
    }

    You'll probably have to rethink your logic here and try to come up with a way to handle the return values.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment

    Working...
    X