Announcement

Collapse
No announcement yet.

Start and End date on Strategy Analyzer

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

  • Start and End date on Strategy Analyzer

    Can somebody please help me with how to set the start and end dates when running a back test on daily graphs on the Strategy Analyzer?

    TIA
    Theo

  • #2
    Here you go...

    This is what I use in my code... It might be a bit much for you right now, but you'll find it will help in the future..

    // user variables
    var StartTime = 630;
    var EndTime = 1215;

    // global variables
    var vHour;
    var vMin;
    var vSec;
    var vDay;
    var vMonth;

    function main()
    {

    var vTime = new Date();
    //---------------------------------------------------
    // Get Time Variables
    vTime = getValue("Time", 0);
    vHour = vTime.getHours();
    vMin = vTime.getMinutes();
    vSec = vTime.getSeconds();
    vDay = vTime.getDate();
    vMonth = vTime.getMonth() +1;


    if ( (((vHour*100)+vMin) >= StartTime ) &&
    (((vHour*100)+vMin) <= EndTime ) ) {

    // .... allow your trading stuff here.

    }

    }
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Thanks for your reply Brad. Apart from entering it into the code, is there any way to set the date parameters in the Formula Wizard or the Strategy Analyzer?

      TIA
      Theo

      Comment


      • #4
        Theo
        Yes you can set it up in the Formula Wizard as part of the conditions in Set1, Set2, etc (getDay()>=yourstartday, getMonth()>=yourstartmonth, etc and the inverse getDay()<=yourenddate, etc).
        As to the Strategy Analyzer it will test whatver data is loaded in a chart and whereas you cannot specifiy the end date (because it will always be the last bar in the chart) you can define the begin date by loading only the desired data using a Time Template
        Alex

        Comment


        • #5
          Thanks Alex - that works well!

          Comment

          Working...
          X