Announcement

Collapse
No announcement yet.

How Do I Do MA With This

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

  • How Do I Do MA With This

    I have this code which allows me to attach this EFS to any chart and it monitors StochD of the specified symbols in the code

    But I need to also add monitors of ther 2EMA for each symbol, along with the StochD value, and I am not sure how to code this for EMA. I need the current value and also the last 2 previous values

    Please help.

    /************************************************** **************************************************
    3:00 pm 21NOV06 US.efs
    ************************************************** ************************************************** *
    latest fix:
    to do:
    ************************************************** ************************************************** */
    var vXX = 5
    var vYY = 197
    var DOWiSymbol = null;
    var DOWValue = null;
    var DOWValuePREV = null;
    var bDOWMAXFLAG = false;
    var bDOWOFF = false;

    var iIntervalLO = null;
    var vHI = 65;
    var vLO = 35;

    // LOCATION NOTES
    // DOW: 5, 197


    function preMain() {

    setPriceStudy(true);
    setStudyTitle("DOW SCANNER");
    // setComputeOnClose();

    iIntervalLO = new FunctionParameter("iIntervalLO", FunctionParameter.NUMBER);
    iIntervalLO.setDefault( 1 );



    DOWiSymbol = new FunctionParameter("DOWiSymbol", FunctionParameter.STRING);
    DOWiSymbol.setDefault( "YM #F" );

    }


    function main(DOWiSymbol, iIntervalLO ){


    if (!bDOWOFF) {
    DOWValue = stochD(5,5,6,sym(DOWiSymbol + "," + iIntervalLO));
    DOWValuePREV = DOWValue.getValue(-1);

    if(DOWValue.getValue(0)==null) return;

    if (DOWValue.getValue(0) >= vHI) {
    if ( DOWValue.getValue(0) < DOWValue.getValue(-1) ) {
    bDOWMAXFLAG = true;
    }

    if ( !bDOWMAXFLAG && DOWValue.getValue(0) > DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " + " + "@URL=EFSOWOFF", Color.red, Color.white,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }

    if ( !bDOWMAXFLAG && DOWValue.getValue(0) < DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " - " + "@URL=EFSOWOFF", Color.red, Color.white,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }

    if ( bDOWMAXFLAG && DOWValue.getValue(0) > DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " + " + "@URL=EFSOWOFF", Color.RGB(255,255,0), Color.red,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }


    if ( bDOWMAXFLAG && DOWValue.getValue(0) < DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " - " + "@URL=EFSOWOFF", Color.RGB(255,255,0), Color.red,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }
    }


    if (DOWValue.getValue(0)<= vLO) {
    if ( DOWValue.getValue(0) > DOWValue.getValue(-1) ) {
    bDOWMAXFLAG = true;
    }

    if ( !bDOWMAXFLAG && DOWValue.getValue(0) > DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " + " + "@URL=EFSOWOFF", Color.green, Color.white,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }

    if ( !bDOWMAXFLAG && DOWValue.getValue(0) < DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " - " + "@URL=EFSOWOFF", Color.green, Color.white,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }


    if ( bDOWMAXFLAG && DOWValue.getValue(0) > DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " + " + "@URL=EFSOWOFF", Color.RGB(255,255,0), Color.green,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }

    if ( bDOWMAXFLAG && DOWValue.getValue(0) < DOWValue.getValue(-1) ) {
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " - " + "@URL=EFSOWOFF", Color.RGB(255,255,0), Color.green,
    Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }

    }

    if ( DOWValue.getValue(0) > vLO && DOWValue.getValue(0) < vHI && DOWValue.getValue(0) > DOWValue.getValue(-1) ) {
    // removeText("DOW");
    bDOWMAXFLAG = false;
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " + " + "@URL=EFSOWOFF", Color.RGB(255,255,0), Color.RGB(212,212,212), Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }


    if ( DOWValue.getValue(0) > vLO && DOWValue.getValue(0) < vHI && DOWValue.getValue(0) < DOWValue.getValue(-1) ) {
    // removeText("DOW");
    bDOWMAXFLAG = false;
    drawTextAbsolute(vXX, vYY, " DOW = " + DOWValue.getValue(0).toFixed(0) + " - " + "@URL=EFSOWOFF", Color.RGB(255,255,0), Color.RGB(212,212,212), Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "DOW" );
    }


    if ( (DOWValue.getValue(0) > vHI && DOWValue.getValue(-1) < vHI) || (DOWValue.getValue(0) < vLO && DOWValue.getValue(-1) > vLO) ) {
    if (getBarState() == BARSTATE_NEWBAR) {
    vFlag = false;
    var vData1 = 5;
    var vData2 = 1;
    if (vData1 > vData2 && vFlag == false) {
    Alert.playSound("DOW-STOCH.wav");
    vFlag = true;
    }
    }
    }

    } // endif this symbol

  • #2
    alexmihh
    You apply the same logic you used for the stochD() function to the ema() function (see the link for the description). Other than for the different parameters of the specific functions the syntax will be identical.
    Then to retrieve the prior values of the averages you use the same .getValue() method you have implemented with the Stochastic study.
    Alex

    Comment


    • #3
      Well, your answer is pretty simple

      In all my previous code I have this for the calcualtion of MAs

      // ********* 2 EMA **********************
      nPriceSource = "OHLC/4";
      nType = "MAStudy.EXPONENTIAL"; // nType == "MAStudy.EXPONENTIAL" || nType == "MAStudy.SIMPLE" || nType == "MAStudy.WEIGHTED" || nType == "MAStudy.VOLUMEWEIGHTED"
      MINOREMAstudy = new MAStudy(2, 0, nPriceSource, eval(nType));
      vMinorEMA = MINOREMAstudy.getValue(MAStudy.MA);

      And that is why I was confused. I did not know how to take this code and work it like I did with the StochD

      What is the difference between this and the simpler ema (0) function you refered me to?

      Comment


      • #4
        alexmihh
        The sample code you just posted references the efs1 moving average function which cannot be used with the inv() or sym() functions. The link I provided instead refers to the efs2 moving average functions which are equivalent in functionality and usage to the stochD() function you have in your script. So if for example you want to create a 10 period exponential moving average of (Open+High+Low+Close)/4 you would write
        var myAvg = ema(10, ohlc4())
        Then to retrieve any of its values you would use the .getValue() method eg
        myAvg.getValue(0) for the current value
        myAvg.getValue(-1) for the prior value
        etc
        For a complete example of how to use the efs2 moving average functions see the customMA.efs which is in the EFS2 Custom subfolder of Formulas
        Alex

        Comment


        • #5
          So, I think you are saying is that I am mixing up efs1 with efs2, right?

          I got some code taken from forum that is efs1, and the latest advice from great people like you is always given in efs2. Right?

          Comment


          • #6
            I am getting error

            UTMS-US.efs, line 71: ReferenceError: OHLC4 is not defined

            DOWValue = stochD(5,5,6,sym(DOWiSymbol + "," + iIntervalLO));
            DOWValuePREV = DOWValue.getValue(-1);

            DOWEMAValue = ema(2,OHLC4(),sym(DOWiSymbol + "," + iIntervalLO));
            DOWEMAValuePREV = DOWEMAValue.getValue(-1);

            if(DOWValue.getValue(0)==null) return;
            if(DOWEMAValue.getValue(0)==null) return;

            Comment


            • #7
              alexmihh

              So, I think you are saying is that I am mixing up efs1 with efs2, right?
              Correct.

              I got some code taken from forum that is efs1, and the latest advice from great people like you is always given in efs2. Right?
              I can't speak for others but virtually all the code I have posted since approximately January 2005 (ie since the release of efs2) has been written using efs2 functions and syntax.
              Alex

              Comment


              • #8
                figured it out -- CAPS issue

                Comment


                • #9
                  alexmihh
                  That function should be written as follows
                  DOWEMAValue = ema(2,ohlc4(sym(DOWiSymbol + "," + iIntervalLO)));
                  As an aside you may want to see this post which will provide you with a complete set of examples of the syntax used with efs2 functions.
                  Alex

                  Comment


                  • #10
                    Actually, I had coded this and it works

                    DOWEMAValue = ema(2,ohlc4(),sym(DOWiSymbol + "," + iIntervalLO));

                    Am I in trouble?

                    Also, I am loading this efs into a dummy chart and I want to get rid of the price values on the right since I do not need them. How can I do that (I am using ES $f as dummy chart)?

                    Comment


                    • #11
                      alexmihh
                      While that will work it will not return the correct results when using external intervals and/or symbols.
                      As an example here is a script that uses your syntax to calculate a moving average based on an external interval. The result is shown in the chart that follows
                      PHP Code:
                      function preMain(){
                       
                          
                      setPriceStudy(true)
                      }
                       
                      function 
                      main(){
                       
                          var 
                      DOWEMAValue ema(2,ohlc4(),sym("$INDU"," 10));
                          
                          return 
                      DOWEMAValue;



                      Here is the same script using instead the proper syntax
                      PHP Code:
                      function preMain(){
                       
                          
                      setPriceStudy(true)
                      }
                       
                      function 
                      main(){
                       
                          var 
                      DOWEMAValue ema(2,ohlc4(sym("$INDU"," 10)));
                          
                          return 
                      DOWEMAValue;



                      As you can see in the first chart the study is not being calculated on the external interval while in the second chart it is correctly referencing the external interval. A similar problem will occurr when using your syntax with an external symbol
                      Alex

                      Comment


                      • #12
                        I think you got this totally reversed. The first chart looks like an EMA2 amd the second chard definitely does not. That would mean ny code works.

                        it is working fine for my EFS as I have it

                        Please clarify.

                        Comment


                        • #13
                          alexmihh
                          If you look at the ema() function you will see that I am passing 10 as the interval which means I want to calculate the study on the 10 minute data even though I am plotting a 1 minute chart.
                          In the first example the efs will incorrectly return the 2 period average of the 1 minute data whereas in the second example it will correctly return the 2 period average based on the 10 minute data.
                          Alex

                          Comment


                          • #14
                            I think you are saying that my code is correct. I want a 2EMA on a 1 min chart, and your graph shows that using my code as it is. iIntervalLO = 1

                            I do not care at all about the interval of the chart. The chart I use is a dummy chart used only to display the results of my efs. I load these symbols, for example on an ES $F chart, and the chart interval could be 1 day, 1 hour -- I do not care.

                            In other words, I am forcing the efs to give me 1 min values of symbols I specify regardless of the chart the efs is attached to, either the symbol of the chart, or the interval of the chart.

                            The result is just a number and color depending on the value of StochD and EMA2 of a 1 min chart. I mean as I see it work in action, I see it working correctly.

                            Having said that, is my code OK? here is entrie efs

                            /************************************************** **************************************************
                            4:00 pm 30NNOV06 UTMS-CUR.efs
                            ************************************************** ************************************************** *
                            latest fix:
                            to do:
                            ************************************************** ************************************************** */
                            var vXX = 5
                            var vYY = 270
                            var bDRIP = true;
                            var iIntervalLO = null;
                            var vHI = 65;
                            var vLO = 35;

                            var EURiSymbol = null;
                            var EURValue = null;
                            var EURValuePREV = null;
                            var EUREMAValue = null;
                            var EUREMAValuePREV = null;
                            var bEUROFF = false;


                            var GBPiSymbol = null;
                            var GBPValue = null;
                            var GBPValuePREV = null;
                            var GBPEMAValue = null;
                            var GBPEMAValuePREV = null;
                            var bGBPOFF = false;


                            // LOCATION NOTES
                            // DAX: 1, 100
                            // FTS: 1, 120
                            // CAC: 1, 140

                            // DOW: 5, 170
                            // RUS: 5, 190

                            // OIL: 1, 220
                            // GAS: 1, 240

                            // EUR: 5, 270
                            // GBP: 5, 290


                            function preMain() {

                            setPriceStudy(true);
                            setStudyTitle("NEW EUR-GBP SCANNER");
                            // setComputeOnClose();

                            iIntervalLO = new FunctionParameter("iIntervalLO", FunctionParameter.NUMBER);
                            iIntervalLO.setDefault( 1 );


                            EURiSymbol = new FunctionParameter("EURiSymbol", FunctionParameter.STRING);
                            EURiSymbol.setDefault( "6E Z6" );

                            GBPiSymbol = new FunctionParameter("GBPiSymbol", FunctionParameter.STRING);
                            GBPiSymbol.setDefault( "6B Z6" );


                            // DAXiSymbol.setDefault( "AX Z6-DT" );
                            // FTSiSymbol.setDefault( "Z Z6-EEI" );
                            // CACiSymbol.setDefault( "FCE Z6-EEI" );
                            // OILiSymbol.setDefault( "QM F7" );
                            // GASiSymbol.setDefault( "QG F7" );
                            // EURiSymbol.setDefault( "6E Z6" );
                            // GBPiSymbol.setDefault( "6B Z6" );


                            }




                            function main(EURiSymbol, GBPiSymbol, iIntervalLO ){


                            if (!bEUROFF) {

                            EURValue = stochD(5,5,6,sym(EURiSymbol + "," + iIntervalLO));
                            EURValuePREV = EURValue.getValue(-1);

                            EUREMAValue = ema(2,ohlc4(),sym(EURiSymbol + "," + iIntervalLO));
                            EUREMAValuePREV = EUREMAValue.getValue(-1);

                            if(EURValue.getValue(0)==null) return;
                            if(EUREMAValue.getValue(0)==null) return;



                            if ( EURValue.getValue(0) >= vHI && EUREMAValue.getValue(0) < EUREMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY, " EUR = " + EURValue.getValue(0).toFixed(0) + " " + "@URL=EFS:EUROFF", Color.RGB(255,255,0), Color.red,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            if (bDRIP) {
                            Alert.playSound("Drip.wav");
                            }
                            }


                            if ( EURValue.getValue(0) >= vHI && EUREMAValue.getValue(0) > EUREMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY, " EUR = " + EURValue.getValue(0).toFixed(0) + " " + "@URL=EFS:EUROFF", Color.red, Color.white,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            }



                            if ( EURValue.getValue(0) <= vLO && EUREMAValue.getValue(0) > EUREMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY, " EUR = " + EURValue.getValue(0).toFixed(0) + " " + "@URL=EFS:EUROFF", Color.RGB(255,255,0), Color.green,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            if (bDRIP) {
                            Alert.playSound("Drip.wav");
                            }

                            }


                            if ( EURValue.getValue(0) <= vLO && EUREMAValue.getValue(0) < EUREMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY, " EUR = " + EURValue.getValue(0).toFixed(0) + " " + "@URL=EFS:EUROFF", Color.green, Color.white,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            }





                            if ( EURValue.getValue(0) > vLO && EURValue.getValue(0) < vHI ) {
                            drawTextAbsolute(vXX, vYY, " EUR = " + EURValue.getValue(0).toFixed(0) + " " + "@URL=EFS:EUROFF", Color.RGB(255,255,0), Color.RGB(212,212,212), Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            }




                            if ( (EURValue.getValue(0) > vHI && EURValue.getValue(-1) < vHI) || (EURValue.getValue(0) < vLO && EURValue.getValue(-1) > vLO) ) {
                            if (getBarState() == BARSTATE_NEWBAR) {
                            vFlag = false;
                            var vData1 = 5;
                            var vData2 = 1;
                            if (vData1 > vData2 && vFlag == false) {
                            // Alert.playSound("EUR-STOCH.wav");
                            vFlag = true;
                            }
                            }
                            }


                            } // endif this symbol



                            if (!bGBPOFF) {

                            GBPValue = stochD(5,5,6,sym(GBPiSymbol + "," + iIntervalLO));
                            GBPValuePREV = GBPValue.getValue(-1);

                            GBPEMAValue = ema(2,ohlc4(),sym(GBPiSymbol + "," + iIntervalLO));
                            GBPEMAValuePREV = GBPEMAValue.getValue(-1);

                            if(GBPValue.getValue(0)==null) return;
                            if(GBPEMAValue.getValue(0)==null) return;



                            if ( GBPValue.getValue(0) >= vHI && GBPEMAValue.getValue(0) < GBPEMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY + 20, " GBP = " + GBPValue.getValue(0).toFixed(0) + " " + "@URL=EFS:GBPOFF", Color.RGB(255,255,0), Color.red,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            if (bDRIP) {
                            Alert.playSound("Drip.wav");
                            }

                            }


                            if ( GBPValue.getValue(0) >= vHI && GBPEMAValue.getValue(0) > GBPEMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY + 20, " GBP = " + GBPValue.getValue(0).toFixed(0) + " " + "@URL=EFS:GBPOFF", Color.red, Color.white,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            }



                            if ( GBPValue.getValue(0) <= vLO && GBPEMAValue.getValue(0) > GBPEMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY + 20, " GBP = " + GBPValue.getValue(0).toFixed(0) + " " + "@URL=EFS:GBPOFF", Color.RGB(255,255,0), Color.green,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            if (bDRIP) {
                            Alert.playSound("Drip.wav");
                            }

                            }


                            if ( GBPValue.getValue(0) <= vLO && GBPEMAValue.getValue(0) < GBPEMAValue.getValue(-1) ) {
                            drawTextAbsolute(vXX, vYY + 20, " GBP = " + GBPValue.getValue(0).toFixed(0) + " " + "@URL=EFS:GBPOFF", Color.green, Color.white,
                            Text.LEFT | Text.RELATIVETOLEFT | Text.FRAME | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            }



                            if ( GBPValue.getValue(0) > vLO && GBPValue.getValue(0) < vHI ) {
                            drawTextAbsolute(vXX, vYY + 20, " GBP = " + GBPValue.getValue(0).toFixed(0) + " " + "@URL=EFS:GBPOFF", Color.RGB(255,255,0), Color.RGB(212,212,212), Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            }




                            if ( (GBPValue.getValue(0) > vHI && GBPValue.getValue(-1) < vHI) || (GBPValue.getValue(0) < vLO && GBPValue.getValue(-1) > vLO) ) {
                            if (getBarState() == BARSTATE_NEWBAR) {
                            vFlag = false;
                            var vData1 = 5;
                            var vData2 = 1;
                            if (vData1 > vData2 && vFlag == false) {
                            // Alert.playSound("GBP-STOCH.wav");
                            vFlag = true;
                            }
                            }
                            }


                            } // endif this symbol


                            } // end MAIN










                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************
                            // ************************** ADDITONAL FUNCTIONS ************************************


                            // ********** MAIN MOUSE BUTTON CONTROL ************************
                            // We only want to know if left mouse button was pressed
                            function getButtonPressed( nButtonPressed ) {
                            if ( nButtonPressed == BUTTON_LEFT ) {
                            return( 1 );
                            }
                            return( 0 );
                            }




                            // Our button was pressed so do something here
                            function EUROFF ( nButtonPressed ) {
                            if (getButtonPressed( nButtonPressed ) == 1 ) {
                            // ************************ ADD ACTIONS HERE WHEN BUTTON IS CLICKED **********************
                            // ************************ ADD ACTIONS HERE WHEN BUTTON IS CLICKED **********************
                            // ************************ ADD ACTIONS HERE WHEN BUTTON IS CLICKED **********************
                            Alert.playSound("cowbell.wav");
                            if (bEUROFF) {
                            bEUROFF = false;
                            drawTextAbsolute(vXX, vYY, " EUR = " + EURValue + " " + "@URL=EFS:EUROFF", Color.RGB(255,255,0), Color.blue, Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            bDRIP = true;
                            }
                            else {
                            bEUROFF = true;
                            bDRIP = false;
                            drawTextAbsolute(vXX, vYY, " EUR = OFF " + "@URL=EFS:EUROFF", Color.RGB(255,255,0), Color.black, Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "EUR" );
                            }

                            }
                            return;
                            }


                            // Our button was pressed so do something here
                            function GBPOFF ( nButtonPressed ) {
                            if (getButtonPressed( nButtonPressed ) == 1 ) {
                            // ************************ ADD ACTIONS HERE WHEN BUTTON IS CLICKED **********************
                            // ************************ ADD ACTIONS HERE WHEN BUTTON IS CLICKED **********************
                            // ************************ ADD ACTIONS HERE WHEN BUTTON IS CLICKED **********************
                            Alert.playSound("cowbell.wav");
                            if (bGBPOFF) {
                            bGBPOFF = false;
                            drawTextAbsolute(vXX, vYY +20, " GBP = " + GBPValue + " " + "@URL=EFS:GBPOFF", Color.RGB(255,255,0), Color.blue, Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            bDRIP = true;
                            }
                            else {
                            bGBPOFF = true;
                            bDRIP = false;
                            drawTextAbsolute(vXX, vYY +20, " GBP = OFF " + "@URL=EFS:GBPOFF", Color.RGB(255,255,0), Color.black, Text.LEFT | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BOLD, null, 11, "GBP" );
                            }
                            }
                            return;
                            }
                            Last edited by alexmihh; 11-30-2006, 05:19 PM.

                            Comment


                            • #15
                              This is what I see. Notice EUR value on ES chart is the StochD value on actual EUR chart
                              Attached Files

                              Comment

                              Working...
                              X