Announcement

Collapse
No announcement yet.

backtesting strategies for gaps

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

  • backtesting strategies for gaps

    How do I find all the backtesting studies? I want to find one that backtests gaps and has it set where I can change the parameters.

    I am still new to this and working to understand java and efs

    thanks

    Adam

  • #2
    Hello Adam,

    Have you tried using the search feature for the forums? Try entering some of the keys words related to what you're looking for such as, gap*. The asterisk is a wildcard that will allow the search to find any post that has a word starting with "gap" such as, gaps, gapping, gapped.

    To begin learning more about how to develop studies with EFS, visit the link at the bottom of this post for the EFS Knowledgebase.
    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
      Thanks

      Jason, thank you for your help.

      Also, as I build my backtest can I have you help me problem solve along the way. I am not asking you to build it, just help me when I am stuck. What is the best way for you to view my work?

      Adam

      Comment


      • #4
        Hello Adam,

        I'd be happy to help you problem solve along the way. When you reply to a thread you can use the "Attach file:" feature that is just above the Submit Reply button.
        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


        • #5
          Sounds Great

          Thanks and appreciate your help. Have a great weekend.

          Adam

          Comment


          • #6
            A little guidance please

            Jason, I have attached a backtesting strategy I am trying to build.

            I eventually want to create buy and sell signals using a simple moving average when the price crosses the MA, not at the open or close.

            Also, I have tried to enter a profit target, but I am having problems. Again, eventually I would like to have two profit targets. The first a preset amount (scale out) and the second when the moving average is violated.

            Any help would be appreciated. I have never done programming and I am pulling my hair out.

            Adam
            Attached Files

            Comment


            • #7
              Hello Adam,

              The first order of business for any formula is correcting any syntax errors. Before you apply a formula to a chart to test it, you should do a syntax check in the Editor by clicking on the checkmark icon. The error messages will appear in the Formula Output Window (Tools-->EFS). You should always have this window open during your development process. For the code you posted, you will get a syntax error on line 26. Do the syntax check on your end and look at the info in the output window. This error is pointing out that you have an extra end brace (ie } ). In JavaScript programming, every open brace must also have an end brace.

              The solution in this case is not to simply add an open brace. It looks like you have copied and pasted some code from another formula into your version of btMovingAverage2.efs. The function parameter dialog needs to go inside the preMain() function. The end brace that you have on line 26 needs to be deleted. Your preMain code should look like below.

              PHP Code:
              function preMain() {
                  
              setPriceStudy(true);
                  
              setStudyTitle("Draw Lines, Text, Shapes and Images.");
                  
              setCursorLabelName("Profit Target"2);

                  var 
              fp1 = new FunctionParameter("nProfitAmt"FunctionParameter.NUMBER); 
                      
              fp1.setName("Profit Target Amount"); 
                      
              fp1.setLowerLimit(0.01); 
                      
              fp1.setDefault(4); 

              The name of your function parameter, nProfitAmt, needs to then be added to the parameters for the main() function. The start of your main() function will look like below.

              PHP Code:
              function main(nProfitAmt) { 
              For every function parameter that in initialized in preMain, you'll need to add its name to the main parameters separated by commas (if you have more than one).

              After making the corrections for your first syntax error, check for any more syntax errors in your code by doing another syntax check. Work your way through them until you no longer have anymore syntax errors. If you come across one you don't understand, post the error message and your current code and we'll go from there.
              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