Announcement

Collapse
No announcement yet.

Formula help joining 2 studies in one pane.

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

  • Formula help joining 2 studies in one pane.

    I would like to put ADX and Stochastics in one panel and am having trouble. Below is the formula I have been working on but it is not working. Any persons help would be appreciated. It starts with cut and past from builtin stochastics and builtin ADX


    var study = new ADXDMStudy(14, 14);
    var study = new StochStudy(14, 3, 3);

    function preMain() {

    setStudyTitle("Joined ADX and Stochastic");

    setCursorLabelName("AMX",0);
    setCursorLabelName("AMX+",1);
    setCursorLabelName("AMX-",2);
    setCursorLabelName("K%",3);
    setCursorLabelName("D%",4);

    setStudyMin(0);
    setStudyMax(100);

    setDefaultBarFgColor(Color.yellow, 0); // ADX
    setDefaultBarFgColor(Color.blue, 1); // PDI
    setDefaultBarFgColor(Color.red, 2); // NDI
    setDefaultBarFgColor(Color.blue, 3); // %K
    setDefaultBarFgColor(Color.red, 4); // %D

    setDefaultBarThickness(3,0);
    setDefaultBarThickness(3,1);
    setDefaultBarThickness(3,2);
    setDefaultBarThickness(3,3);
    setDefaultBarThickness(3,4);
    }

    function main() {
    var vADX = study.getValue(ADXDMStudy.ADX);
    var vPDI = study.getValue(ADXDMStudy.PDI);
    var vNDI = study.getValue(ADXDMStudy.NDI);
    var vFast = study.getValue(StochStudy.FAST);
    var vSlow = study.getValue(StochStudy.SLOW);

    return new Array(vADX, vPDI, vNDI,vFast, vSlow);
    }

  • #2
    Hello Earl,

    You essentially have only one study object initialized as a StochStudy. At the top of your efs where you var your studies, you used the same name for each study. You just need to give them unique names. Try the following:

    var study1 = new ADXDMStudy(14, 14);
    var study2 = new StochStudy(14, 3, 3);

    Also remember to change "study.getValue()" to "study1.getValue()" or "study2.getValue()" in function main().


    Jason K.
    EFS Support Specialist
    eSignal
    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


    • #3
      Earl
      Another way of doing it is to create the two studies individually and then 'Merge" them into one pane.
      For information on how to Merge the studies click on the following link



      Alex

      NOTE: For some reason the links are not working as they should. The folder with the Lesson is called "How to combine multiple studies into one window"
      Last edited by ACM; 11-29-2002, 09:03 AM.

      Comment

      Working...
      X