[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Sample JavaScript Date Code



PureBytes Links

Trading Reference Links

The following works for me in a back test script that I've got running. 
Bring up the Autoanalyzer window and run a script containing this statements
 while watching both the FROM and TO dates change. 
 
I know the month is offset by 1 in some of TJ's work but in this case it's not.  Try it and see to
confirm that.
 
**********************  Set the date range********************/
oAA.RangeMode =3;                // Backtest over date range
oAA.RangeFromDate = "2004,1,2";  
oAA.RangeToDate = "2004,11,12";
 WScript.Echo ("From Date" + oAA.RangeFromDate);
 WScript.Echo ("To Date" + oAA.RangeToDate);
 
Hey Bruce and Dingo, note I'm using Hungarian notation.
 
Dingo, welcome back to the board.

Hope this helps
Joe
----- Original Message -----
Sent: Tuesday, November 23, 2004 4:00 PM
Subject: RE: [amibroker] Sample _javascript_ Date Code

Try this
 
From = new Date(2003, 0, 1);                      // format is yyyy, mm, dd where mm is zero based
AA.RangeFromDate = From.getVarDate();   // from date
 
Dwight
-----Original Message-----
From: Christoper [mailto:turkey@xxxxxxxxxxxxxxx]
Sent: Tuesday, November 23, 2004 3:56 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Sample _javascript_ Date Code


With the following .js code:
-----------------------
FromDate = new Date(2003, 1, 1);
ToDate = new Date(2004, 1, 1);
AA.RangeFromDate = FromDate; <----------- error
AA.RangeToDate = ToDate;
-----------------------

I'm getting a type mismatch at the indicated line.  If anyone can
help that would be great.

BTW AA is the "Analysis" Object created via the AB Object Model, as
per the help files.

thanks,
chris





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links