Announcement

Collapse
No announcement yet.

EFS Questions from z11

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #61
    Hello z11,

    It depends on what code you plan to execute when you click the button. If it affects the values of global variables used by your formula then it could have an affect on the results generated by your formula depending on the timing. I would think it would be extremely unlikely that you would click the button while main was being executed. We're talking milliseconds or fractions of a millisecond in most cases, depending on the formula. Most of the time any affect your button would have on the formula would be executed between trades, or executions of main.
    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


    • #62
      Thanks for replying Jason.

      My initial plan for such buttons is two-fold:
      1) Simply dumping current values of global variables to Alert List - more or less a sanity check to see the EFS which is getting all these global vairables from a number of other EFSs is actually getting them

      2) A click on a button would force a trade signal which will in turn change certain global variables' values. To minimize (or eliminate) any asynchornisity here, I am planning on doing a forced "get" in the EFS upon return of button-pressing functions ...does that make sense? so that I am hoping that the main EFS will update its global variables once certain buttons are clicked.

      Thanks.

      Comment


      • #63
        Hello z11,

        1) Great idea. This usage would have no adverse affects on your formula. You could also use the deBugPrintln() function in the code block for the buttons. That way you won't populate the Alert list with non-trade alerts. This is how I would do it anyway.

        2) The button can be used to update global variables. At this point you should code it and test it. If the routine doesn't do what you were expecting, post some additional details and/or code and I'll see if I can help.
        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


        • #64
          Jason,

          1) somehow I have not been able to cut/past or print contents of debugprint in Formula Output window ...is there a way?
          That was why I had initially suggested to have multiple Alert lists on demand from EFS ...if EFS engine is coded in C++ then it would just have to instantiate another object and return a handle to EFS so that an Alert list would be just another object! EFS can create/clear/close such alert lists on demand.

          2) the weekend is running out on me to code my ideas with alert buttons ...will update you if I shall have any success..

          Thanks as always for your wisdom

          Comment


          • #65
            Hello z11,

            1) Yes, open the formuloutput.log file located in your eSignal directory.

            Your idea about the multiple Alert lists is a good one. I hope you have already submitted that to [email protected].
            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


            • #66
              Thanks for pointing that out in regards to log file.

              I just emailed the suggestion to the email address you provided.

              Comment


              • #67
                Hi Jason,

                would you give me some (detailed) hints on how to synchronize the calculation of stochastics for a 15 minute interval in a 5 minute chart?
                Thanks.

                Comment


                • #68
                  Hello z11,

                  I gave a good description of this process here. Later in that thread you'll see the IntervalMA5.efs that you could use as a template for building the higher time frame bars in your custom EFS. The Stochastic calculations would need to be coded in your custom EFS using the higher time frame bar data arrays. You could use the code from StochOf_Template.efs to help you with that part.
                  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


                  • #69
                    Hi Jason/Alex, quick question -

                    to backtest an EFS, when I loaded a Chart, say daily time frame, how do I specify in the EFS a specific number of bars to be loaded - the Time Template for the chart is set to be Dynamic.

                    I tried to create a time frame to be say 100 days, and the chart loaded up as dynamic and the EFS runs for a certain number of bars but not the entire 100 days. Thanks.

                    Comment


                    • #70
                      z11
                      You do that by setting the number of days/bars in the Time Template and then selecting it in the Strategy Analyzer
                      Alex

                      Comment


                      • #71
                        Hi Alex,

                        sorry about my feeble mind, but I could not find Strategic Analyser which I presumed is off one of the menu pull downs ... closest thing is Backtesting...??? lost...

                        Comment


                        • #72
                          Gentlemen,

                          the posted EFS below is suppose to grab 15-minute HIGH/LOW/CLOSE in a 5-minute chart....but it is not getting anything like that (via the debugPrintln) ... what am I doing wrong? bad synchronization?

                          var sSymbol1 = getSymbol() + ",15";
                          var bCtr = 0;
                          var tfHigh = new Array();
                          var tfLow = new Array();

                          function preMain() {

                          setStudyTitle("TF15HLC");
                          setPriceStudy(false);

                          setCursorLabelName("H15", 0);
                          setCursorLabelName("L15", 1);
                          setCursorLabelName("C15", 1);
                          setDefaultBarFgColor( Color.darkgreen, 0 );
                          setDefaultBarFgColor( Color.red, 1 );
                          setDefaultBarFgColor( Color.blue, 2 );
                          setDefaultBarThickness( 2, 0);
                          setDefaultBarThickness( 2, 1);
                          setDefaultBarThickness( 3, 2);
                          setShowTitleParameters( false );
                          setComputeOnClose();
                          debugClear();

                          }

                          function main() {
                          var tfClose = null;

                          if (getBarState() == BARSTATE_ALLBARS) return;

                          if (bCtr == 0 ) {
                          tfClose = getValue("close", 0);
                          tHigh = getValue("high", 0, -10, sSymbol1);
                          tLow = getValue("low", 0, -10, sSymbol1);

                          bCtr = 1;
                          }
                          else if ((getMinute() == 0 || getMinute() == 15 ||getMinute() == 30 ||getMinute() == 45) ) {
                          tfClose = getValue("close", 0, sSymbol1);
                          tHigh = getValue("high", 0, sSymbol1);
                          tLow = getValue("low", 0, sSymbol1);
                          tfHigh.pop();
                          tfHigh.unshift(tHigh);
                          tfLow.pop();
                          tfLow.unshift(tLow);
                          }

                          debugPrintln(tfHigh[0] + " " + tfLow[0]);

                          return new Array(tfHigh[0], tfLow[0], tfClose);
                          }

                          Comment


                          • #73
                            z11
                            I was referring to the Back Tester
                            Alex

                            Comment


                            • #74
                              Hello z11,

                              The logic your using for synchronizing the data from the two time frames is the problem. The getValue() call references the other interval by relative indexing. When your formula is loading and processing bar -100 on a 5 minute chart, a call to getValue("close", 0, "Symbol,15") will give you the close from the -100 bar on the 15 minute interval, which falls on a different time frame.

                              What I recommend is to build the higher time frame bar data using your current chart's data. The higher time frame you build will need to be a multiple of the chart interval. For a code example of how to do this, take a look at the IntervalMA5.efs here. By looking at the time stamps of the bars and calculating the number of lower time frames bars per higher time frame bar, you'll then use global arrays in your formula to collect and store the higher time frame bar data. Here's the basic concept. The three bars below are from a 5 minute chart starting at 6:30.

                              PHP Code:
                              5-Minute bars
                              -----6:30------6:35------6:40
                              O
                              :  89.00-----90.50-----89.50
                              H
                              :  91.50-----92.00-----91.75
                              L
                              :  88.00-----88.50-----89.00
                              C
                              :  90.00-----91.00-----90.50

                              15
                              -Minute bar at 6:30
                              O
                              :  89.00  (Open from the first bar in series)
                              H:  92.00  (Maximum high from the 3 bars in the series)
                              L:  88.00  (Minimum low from the 3 bars in the series)
                              C:  90.50  (Close from the third bar in the series
                              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


                              • #75
                                Thanks Jason...you confirmed my suspicision. Would using getValueAbsolute help in this case?

                                I really don't quite understand the difference between getValue and getValue Absolute despite reading the documentation on it numerous times....

                                Also, the build-in StochStudy would go flat line when trading volume is low ... Dinapoli's efs fixes that ...but does eSignal have plans to fix that build-in study?

                                or is there already a fix that I am not aware of? Thanks.

                                Comment

                                Working...
                                X