Announcement

Collapse
No announcement yet.

User Option to put study in another window?

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

  • User Option to put study in another window?

    I would like to write a study that has a study input option that a user can set through edit studies, to print the study in another window, or on the price chart.

    I have written the following code as a test. But it does not place the study in a separate window if the user changes an input option from the default (which includes the study on the price chart).

    Can anyone point me in the right direction to have the study print in a separate window based on user input? In my real study that I am writing I have a number of other user inputs for parameter modification that I collect, and a number of global variables. I mention this because I also tried a version that had "reloadEFS" if the user selected to put the study in a separate window... and I could not get it to work either. But in reading the reloadEFS() documentation it mentioned that it leaves all Global variables in their current state.,

    Thanks,

    Judy


    var aParms = new Array();
    var binit = false;

    function preMain () {

    setPriceStudy(true);
    setComputeOnClose();
    setShowTitleParameters(false);
    setCursorLabelName("MA", 0);

    aParms[0] = new FunctionParameter("cLineColor", FunctionParameter.Color);
    with( aParms[0]) {
    setName("Line Color");
    setDefault(Color.cyan);
    }
    aParms[1] = new FunctionParameter("bInOtherWindow", FunctionParameter.BOOLEAN);
    with (aParms[1]) {
    setName("Sep. Window?");
    setDefault(false);
    }
    }

    function main(cLineColor, bInOtherWindow) {

    if (binit == false) {


    binit = true;

    setDefaultBarFgColor(cLineColor, 0);
    setDefaultBarStyle(PS_SOLID);
    setDefaultBarThickness(1);

    if (bInOtherWindow == true) {
    setPriceStudy(false);
    }
    }

    return( low(0)-1);
    }

  • #2
    Hello jolson2613,

    EFS does not currently have the ability to programmatically change this property. The only way to accomplish what you are trying to do is manually edit the formula code, save it, remove the formula form the chart and then reapply it to the chart. Alternatively, you may wan to consider having two versions of the formula where one is set for plotting on the price window and the other for the non-price window.
    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