Announcement

Collapse
No announcement yet.

0 results in backtest

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

  • 0 results in backtest

    I must be doing something wrong, I can't get any of my efs's to backtest properly.

    The following code generates the correct debug outputs, but gives 0 results when backtesting.


    if (vInLong == 1 && vClose > vValue1) {
    if (Strategy.isLong() == true) {
    //Strategy.doSell("Exit Long",Strategy.STOP,Strategy.THISBAR,Strategy.getD efaultLotSize(),close());
    Strategy.doSell("Exit Long", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
    debugPrintln("Exit Long");
    }
    }


    if (vInShort == 1 && vClose < vValue2) {
    if (Strategy.isShort() == true) {
    //Strategy.doCover("Exit Short",Strategy.STOP,Strategy.THISBAR,Strategy.get DefaultLotSize(),close());
    Strategy.doCover("Exit Short", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
    debugPrintln("Exit Short");
    }
    }
    if (vValue3 == 1){
    if (Strategy.isInTrade() == false) {
    //Strategy.doLong("Enter Long",Strategy.LIMIT,Strategy.THISBAR,Strategy.get DefaultLotSize(),close());
    Strategy.doLong("Enter Long", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
    debugPrintln("Long");
    }
    }
    else {
    if (vClose >= vValue1 && vInShort == 0 && vGoingDown) {
    if (Strategy.isInTrade() == false) {
    //Strategy.doShort("Enter Short",Strategy.LIMIT,Strategy.THISBAR,Strategy.ge tDefaultLotSize(),close());
    Strategy.doShort("Enter Short", Strategy.MARKET, Strategy.THISBAR, Strategy.DEFAULT, 0);
    debugPrintln("Short");
    }

    }
    }
    Last edited by Mike2; 05-29-2005, 03:31 AM.

  • #2
    Hello Mike2,

    In order to help provide a solution, we need to see a complete set of code. Please use the attachment feature to post your complete formula.
    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
      I fixed the problem by using == 1 and ==0 instead of == true and == false.

      Comment

      Working...
      X