Announcement

Collapse
No announcement yet.

Using My Computer/System Time?

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

  • Using My Computer/System Time?

    I was wondering if I could use the time on my computer or on eSignal (as opposed to the bar in my chart on whatever timescale) to close a trade at the end of the day in an EFS backtesting. Roughly I would have some simple code like - if mycomputertime=xxxx and strategy is in trade then close.

    This could then be applied to a P+F chart or 3PB, for example, which are price (as opposed to time) specific and where there may not necessarily be an entry 5min before time or to a 15min chart but to exit 5mins from time.

    Is it possible.

    Thanks
    Rob


    PS Another quick question for an eSignal person - Is there any approx. timescale available for introducing the excel format download for the backtesting results?
    Last edited by RobMc; 12-16-2003, 06:08 AM.

  • #2
    Solution...

    You can use... the following example to get the computer time from within efs..


    // BLM Added....
    var vHour;var vMin;var vSec;
    var vDay;var vMonth;var vYear;
    // end BLM added

    function main() {

    // BLM Added
    var vTime = new Date();
    // Get Time Variables
    vHour = vTime.getHours();
    vMin = vTime.getMinutes();
    vSec = vTime.getSeconds();
    vDay = vTime.getDate();
    vMonth = vTime.getMonth() +1;
    vYear = vTime.getYear();
    // end added BLM

    }

    But, in the backtest mode, this probably won't help you. The computer's time will be TODAY and whatever hour/min/sec it is currently.

    The only way to test for executions in the backtest mode is to use the BARTIME - at lease as far as I know.

    Brad
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Brad

      Thanks for your help, it is much appreciated as its all a bit daunting for a programming beginner. I will try and integrate that code into my script.

      "But, in the backtest mode, this probably won't help you. The computer's time will be TODAY and whatever hour/min/sec it is currently."

      Doh! Of course! Now why didn't I think of that , talk about not seeing the wood for the trees

      Regards
      Rob

      Comment

      Working...
      X