Announcement

Collapse
No announcement yet.

High and Low EFS question (original efs by ACM)

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

  • High and Low EFS question (original efs by ACM)

    Having a little trouble with this EFS . . . maybe it's a transitional thing to EFS2 . . . I have no idea as scripting is not my thing.

    Problem: the H and L counts always appear in the right margin. I am aware I can right click and turn them off but unlike other indicators, they will reappear if I change timeframe and or switch off for the day and switch on again.

    If anyone can give me the change of script needed to stop this happening, I'd be very grateful.

    Here's ACM's script below with my personal input tweaks, but it remains the original otherwise.

    I've also included a screenshot of the annoying right hand margin numbers that keep reappearing.

    Any help would be much appreciated.

    Regards,
    Tiktok

    /************************************************** *******
    Alexis C. Montenegro © June 2005
    Use and/or modify this code freely. If you redistribute it
    please include this and/or any other comment blocks and a
    description of any changes you make.
    ************************************************** ********/

    var fpArray = new Array();

    function preMain() {

    setPriceStudy(true);
    setStudyTitle("UKfirst60");
    setCursorLabelName("High", 0);
    setCursorLabelName("Low", 1);
    setPlotType(PLOTTYPE_FLATLINES,0);
    setPlotType(PLOTTYPE_FLATLINES,1);
    setDefaultBarFgColor(Color.blue,0);
    setDefaultBarFgColor(Color.blue,1);

    var x=0;
    fpArray[x] = new FunctionParameter("xStart", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setName("Start Time");
    setLowerLimit(0);
    setDefault(0800);
    }
    fpArray[x] = new FunctionParameter("xEnd", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setName("End Time");
    setLowerLimit(0);
    setDefault(0900);
    }
    fpArray[x] = new FunctionParameter("xInterval", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setName("Ext Interval Used");
    setLowerLimit(1);
    setDefault(60);
    }
    fpArray[x] = new FunctionParameter("xDisplay", FunctionParameter.STRING);
    with(fpArray[x++]){
    setName("Display");
    addOption("Show");
    addOption("Hide");
    setDefault("Show");
    }
    }

    var bInit = false;
    var xRange = null;

    function main(xStart,xEnd,xInterval,xDisplay) {

    if(bInit==false){
    xRange = efsInternal("calcOR",xStart,xEnd,xDisplay,inv(xInt erval));
    bInit=true;
    }

    return new Array(getSeries(xRange,0),getSeries(xRange,1));
    }


    var vFlag = true;
    var vFlag2 = true
    var vHigh = null;
    var vLow = null;
    var vClose = null;
    var vDay1 = null;
    var vDay2 = null;

    function calcOR(start,end,display,source){

    if (getBarState() == BARSTATE_NEWBAR) {
    if (vDay1 == null) {
    vDay2 = getDay(0);
    } else {
    vDay2 = vDay1;
    }
    vDay1 = getDay(0);
    if (vDay1 != vDay2) {
    vHigh = null;
    vLow = null;
    vFlag = true;
    vFlag2 = false;
    }
    var vHour1 = (getHour()*100)+getMinute();
    if(vHour1 >= start){
    vFlag2=true;
    }
    var vHour = (getHour()*100)+getMinute();
    if (vHour >= end) {
    vFlag = false;
    vFlag2=false;
    }
    }

    if (vFlag == true&&vFlag2==true) {
    if (vHigh == null) {
    vHigh = high(0);
    }
    if (vLow == null) {
    vLow = low(0);
    }
    vHigh = Math.max(high(0), vHigh);
    vLow = Math.min(low(0), vLow);
    }

    if(display=="Hide"){
    if(vFlag==false&&vHigh!=null&&vLow!=null){
    var vHigh2 = vHigh;
    var vLow2 = vLow;
    }
    }else if(display=="Show"){
    var vHigh2 = vHigh;
    var vLow2 = vLow;
    }

    return new Array(vHigh2,vLow2);
    }

    Click image for larger version

Name:	Chart20140123162928.png
Views:	1
Size:	62.4 KB
ID:	246939

  • #2
    This post is no longer relevant . . . after searching the forum, it appears the problem lies with the new 11.7 build and not any EFS as I first thought. I have reverted back to 11.6 and all is working as it should do.

    Comment

    Working...
    X