Announcement

Collapse
No announcement yet.

AGET Osc Bar Color

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

  • AGET Osc Bar Color

    I am using the Advanced GET oscillator in a study, but getting funny bar colors. When I load the study, all bars are painted correctly. Any subsequent bars after the study is loaded are painted blue. Here are some relevant sections of the EFS code. Any ideas what is going on or what I can do to fix this?

    if (sMom == "GET Osc") {
    var momStudy1 = new GetOscStudy(5,35,100);
    Mom = momStudy1.getValue(0);
    Mom1 = xMom;
    xMom = Mom;
    var returnMom = Mom
    }
    .
    .
    .
    // added shading on Momentum histogram
    if (Mom > 0 && Mom > Mom1) {
    setBarFgColor(Color.lime);
    }
    if (Mom > 0 && Mom < Mom1) {
    setBarFgColor(Color.RGB(0,128,0));
    }
    if (Mom < 0 && Mom < Mom1) {
    setBarFgColor(Color.red);
    }
    else if (Mom < 0 && Mom > Mom1) {
    setBarFgColor(Color.RGB(128,0,0));
    }
    return (returnMom);

    Thanks,
    Greg
    Attached Files

  • #2
    Re: AGET Osc Bar Color

    Greg
    The first issue is that you are using the incorrect method to retrieve the value of the GetOscStudy().
    See this article in the EFS KnowledgeBase for the syntax of the available methods
    Secondly you need to transfer the values between Mom1, xMom, etc prior to assigning the current value of the Get Oscillator to the variable Mom.
    That said I am not sure why you have chosen this method when you can directly access the prior values of the Get Oscillator
    Alex


    Originally posted by GregSchroeder
    I am using the Advanced GET oscillator in a study, but getting funny bar colors. When I load the study, all bars are painted correctly. Any subsequent bars after the study is loaded are painted blue. Here are some relevant sections of the EFS code. Any ideas what is going on or what I can do to fix this?

    if (sMom == "GET Osc") {
    var momStudy1 = new GetOscStudy(5,35,100);
    Mom = momStudy1.getValue(0);
    Mom1 = xMom;
    xMom = Mom;
    var returnMom = Mom
    }
    .
    .
    .
    // added shading on Momentum histogram
    if (Mom > 0 && Mom > Mom1) {
    setBarFgColor(Color.lime);
    }
    if (Mom > 0 && Mom < Mom1) {
    setBarFgColor(Color.RGB(0,128,0));
    }
    if (Mom < 0 && Mom < Mom1) {
    setBarFgColor(Color.red);
    }
    else if (Mom < 0 && Mom > Mom1) {
    setBarFgColor(Color.RGB(128,0,0));
    }
    return (returnMom);

    Thanks,
    Greg

    Comment


    • #3
      Can you give me an example of the correct method to retrieve the value of the GetOscStudy() or any GET studies?

      The documentation on the link is vague.

      Thanks,
      Greg

      Comment


      • #4
        Greg
        momStudy1.getValue(GetOscStudy.OSC, 0) retrieves the value of the GET Oscillator at the current bar, momStudy1.getValue(GetOscStudy.OSC, -1) the value of the Oscillator at the prior bar , -2 the value two bars back, etc
        As to the methods [or more appropriately members] of the other GET functions you need to reference the EFS KnowledgeBase [you can find all the functions listed in alphabetical order in the Glossary].
        Regardless of the study you would still use the bar index as the last parameter to call the value at a specific bar [where 0 is the current bar, -1 is the prior etc].
        Alex


        Originally posted by GregSchroeder
        Can you give me an example of the correct method to retrieve the value of the GetOscStudy() or any GET studies?

        The documentation on the link is vague.

        Thanks,
        Greg

        Comment

        Working...
        X