Announcement

Collapse
No announcement yet.

Back Testing greif

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

  • Back Testing greif

    I am just getting my feet wet with the Back Testing feature and I am not making any headway. I have copied the efs from the Knowledge base verbatim:

    var study = new MAStudy(40, 0, "Close", MAStudy.SIMPLE);

    function preMain() {
    setPriceStudy(true);
    setColorPriceBars(true);
    setDefaultPriceBarColor(Color.black);
    }

    function main() {
    var v = study.getValue(MAStudy.MA);
    if(v == null) return;

    if(close() >= v && !Strategy.isLong())
    Strategy.doLong("Crossing Up", Strategy.MARKET, Strategy.THISBAR);


    if(close() <= v && !Strategy.isShort())
    Strategy.doShort("Crossing Down", Strategy.MARKET, Strategy.THISBAR);


    if(Strategy.isLong()) setPriceBarColor(Color.lime);
    else if(Strategy.isShort()) setPriceBarColor(Color.red);


    return v;

    }

    I opened an Advanced Chart w/ ES #F on a 60 minute interval. When I click Tools->Back Testing and load this formula I immediately get the Strategy Analysis window with no information; then I changed the chart to a 1 min interval and the back testing interval to 1 minute and click test and things go off into never never land and when it returns I still have no results. At one point I was getting the dialog indicating that it was retreiving 0 rows and that I let run for 20 minutes and still no rows had been read and no results were returned.

    Is there some magic pixie dust that I am missing ? And if so, where do I get it ?

    I have been through the documentation and I just don't seem to be getting it.

    Thanks -
    Jennifer

  • #2
    Hello jh,

    your script is running fine.
    Please check at the Back Testing -> "Back Testing Preferences" if you have allowed "Longs", "Shorts" and "Close Trades at end of Back Test" and the "default lot size".

    regards
    sams

    Comment


    • #3
      Thanks for the response Sam. I have been using the default setting of Allow Shorts, Longs, Close Trades at end of Backtesting, and the Default Lot Size is 100. Still nothing.

      Comment


      • #4
        Hello jh109052,

        Please post a copy of your formula as an attachment so we can take a look at your code and test it.
        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
          I got it - I believe it was a typo on my part. Thanks for all the help ! Now it seems to be working fine.
          Jennifer

          Comment

          Working...
          X