Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
egorFiNE committed Nov 30, 2011
1 parent 5472932 commit 72ad2f8
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 63 deletions.
22 changes: 13 additions & 9 deletions docs/CandlesCalculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,32 @@
</style>
</head>
<body>
<h2><span class="class">CandlesCalculator(<span class="parameter">minutes</span>)</span></h2>
<h1>CandlesCalculator.js</h1>

<ul><li><a href="#classQcandlescalculatorQminutes">CandlesCalculator(minutes)</a></li><li><a href="#methodQclearperiodQ">clearPeriod()</a></li><li><a href="#methodQticktimeQunixtime">tickTime(unixtime)</a></li><li><a href="#methodQfinishQ">finish()</a></li><li><a href="#methodQcalculatestartunixtimeQunixtime">calculateStartUnixtime(unixtime)</a></li><li><a href="#methodQaddtickQunixtimeqqpriceqqvolume">addTick(unixtime, price, volume)</a></li><li><a href="#methodQemitcandleQ">emitCandle()</a></li><li><a href="#staticQmethodQgetcandlesQdbpathqqsymbolqqdaystampqqperiod">getCandles(dbPath, symbol, daystamp, period)</a></li><li><a href="#methodQunserializeQdata">unserialize(data)</a></li><li><a href="#methodQserializeQ">serialize()</a></li></ul>

<h2><span class="class">CandlesCalculator(<span class="parameter">minutes</span>)</span></h2>

<p>Calculate OHLC data for ticks stream. FIXME: is this module even needed now? </p>

<ul><li><code><span class="type">Integer</span></code> <code><strong>minutes</strong></code> &#8212; period size for which to calculate candles, in minutes.</li></ul>

<h3>clearPeriod()</h3>
<h3><a name="methodQclearperiodQ"></a> clearPeriod()</h3>

<h3>tickTime(<span class="parameter">unixtime</span>)</h3>
<h3><a name="methodQticktimeQunixtime"></a> tickTime(<span class="parameter">unixtime</span>)</h3>

<h3>finish()</h3>
<h3><a name="methodQfinishQ"></a> finish()</h3>

<h3>calculateStartUnixtime(<span class="parameter">unixtime</span>)</h3>
<h3><a name="methodQcalculatestartunixtimeQunixtime"></a> calculateStartUnixtime(<span class="parameter">unixtime</span>)</h3>

<h3>addTick(<span class="parameter">unixtime</span>, <span class="parameter">price</span>, <span class="parameter">volume</span>)</h3>
<h3><a name="methodQaddtickQunixtimeqqpriceqqvolume"></a> addTick(<span class="parameter">unixtime</span>, <span class="parameter">price</span>, <span class="parameter">volume</span>)</h3>

<h3>emitCandle()</h3>
<h3><a name="methodQemitcandleQ"></a> emitCandle()</h3>

<h3>CandlesCalculator.getCandles(<span class="parameter">dbPath</span>, <span class="parameter">symbol</span>, <span class="parameter">daystamp</span>, <span class="parameter">period</span>) <span class="static">static</span></h3>

<h3>unserialize(<span class="parameter">data</span>)</h3>
<h3><a name="methodQunserializeQdata"></a> unserialize(<span class="parameter">data</span>)</h3>

<h3>serialize()</h3>
<h3><a name="methodQserializeQ"></a> serialize()</h3>
</body>
</html>
16 changes: 10 additions & 6 deletions docs/ExtraDate.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
</style>
</head>
<body>
<h2><span class="class">Date()</span></h2>
<h1>ExtraDate.js</h1>

<ul><li><a href="#classQdateQ">Date()</a></li><li><a href="#staticQmethodQparsedaystampQdaystamp">parseDaystamp(daystamp)</a></li><li><a href="#methodQdaystampQ">daystamp()</a></li><li><a href="#staticQmethodQparseunixtimeQunixtime">parseUnixtime(unixtime)</a></li><li><a href="#methodQunixtimeQ">unixtime()</a></li><li><a href="#staticQmethodQunixtimeQ">unixtime()</a></li><li><a href="#staticQmethodQfillemptydaysQfromqqto">fillEmptyDays(from, to)</a></li><li><a href="#methodQgetdaynameQ">getDayName()</a></li><li><a href="#methodQsetcurrentdayminuteQminute">setCurrentDayMinute(minute)</a></li><li><a href="#methodQgetcurrentdayminuteQ">getCurrentDayMinute()</a></li><li><a href="#staticQmethodQminutetoformatQminuteqqformat">minuteToFormat(minute, format)</a></li></ul>

<h2><span class="class">Date()</span></h2>

<p>Various date methods useful for stock trading. </p>

Expand All @@ -58,7 +62,7 @@ <h3>Date.parseDaystamp(<span class="parameter">daystamp</span>) <span class="st

<ul><li><code><span class="type">Date</span></code> date parsed from daystamp, time set to 00:00:00</li></ul>

<h3>daystamp()</h3>
<h3><a name="methodQdaystampQ"></a> daystamp()</h3>

<p>Return daystamp representation of a Date.</p>

Expand All @@ -76,7 +80,7 @@ <h3>Date.parseUnixtime(<span class="parameter">unixtime</span>) <span class="st

<ul><li><code><span class="type">Date</span></code> parsed date object with correct time set.</li></ul>

<h3>unixtime()</h3>
<h3><a name="methodQunixtimeQ"></a> unixtime()</h3>

<p>Return unixtime representation of a Date. </p>

Expand Down Expand Up @@ -109,22 +113,22 @@ <h3>Date.fillEmptyDays(<span class="parameter">from</span>, <span class="paramet
var days = Date.fillEmptyDays(from, to);
// days == [new Date('2011-06-16'), new Date('2011-06-17')]; </code></pre>

<h3>getDayName()</h3>
<h3><a name="methodQgetdaynameQ"></a> getDayName()</h3>

<p>Get short human readable day name for given Date, like "Sun", "Mon", ...</p>

<p>Returns:</p>

<ul><li><code><span class="type">String</span></code> day name.</li></ul>

<h3>setCurrentDayMinute(<span class="parameter">minute</span>)</h3>
<h3><a name="methodQsetcurrentdayminuteQminute"></a> setCurrentDayMinute(<span class="parameter">minute</span>)</h3>

<p>Set given Date's time to a day minute specified. A day minute is zero-based number of minute in a day,
e.g. 570 for 9:30. </p>

<ul><li><code><span class="type">Integer</span></code> <code><strong>minute</strong></code> &#8212; day minute to set as time. </li></ul>

<h3>getCurrentDayMinute()</h3>
<h3><a name="methodQgetcurrentdayminuteQ"></a> getCurrentDayMinute()</h3>

<p>Get current day minute of a given Date. A day minute is zero-based number of minute in a day,
e.g. 570 for 9:30. </p>
Expand Down
6 changes: 5 additions & 1 deletion docs/ExtraLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
</style>
</head>
<body>
<h2><span class="class">ExtraLog()</span></h2>
<h1>ExtraLog.js</h1>

<ul><li><a href="#classQextralogQ">ExtraLog()</a></li><li><a href="#staticQmethodQformatQf">format(f)</a></li><li><a href="#staticQmethodQlogQ">log()</a></li></ul>

<h2><span class="class">ExtraLog()</span></h2>

<p>Actually it's a printf substitute with support for prices and unixtimes. Contains two functions. </p>

Expand Down
8 changes: 6 additions & 2 deletions docs/ExtraNumber.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@
</style>
</head>
<body>
<h2><span class="class">Number()</span></h2>
<h1>ExtraNumber.js</h1>

<ul><li><a href="#classQnumberQ">Number()</a></li><li><a href="#methodQhumanreadablepriceQ">humanReadablePrice()</a></li></ul>

<h2><span class="class">Number()</span></h2>

<p>This module exports only a single additional method for built-in <code>Number</code> object. </p>

<h3>humanReadablePrice()</h3>
<h3><a name="methodQhumanreadablepriceQ"></a> humanReadablePrice()</h3>

<p>Will return human-readable price for given integer. </p>

Expand Down
8 changes: 6 additions & 2 deletions docs/MinuteIndex.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
</style>
</head>
<body>
<h2><span class="class">MinuteIndex()</span></h2>
<h1>MinuteIndex.js</h1>

<ul><li><a href="#classQminuteindexQ">MinuteIndex()</a></li><li><a href="#methodQdumpQfromminuteqqtominute">dump(fromMinute, toMinute)</a></li></ul>

<h2><span class="class">MinuteIndex()</span></h2>

<p>Internal class used by TickStorage to index minute data within a single ticks file. </p>

Expand All @@ -55,7 +59,7 @@ <h2><span class="class">MinuteIndex()</span></h2>
<p>You can access the instance of Minute Index as <code>TickStorage.minuteIndex[]</code>. So use
<code>TickStorage.minuteIndex.index[minute]</code> to get to the minute data. </p>

<h3>dump(<span class="parameter">fromMinute</span>, <span class="parameter">toMinute</span>)</h3>
<h3><a name="methodQdumpQfromminuteqqtominute"></a> dump(<span class="parameter">fromMinute</span>, <span class="parameter">toMinute</span>)</h3>

<p>Handy developer tool: dump minute index in human-readable format. </p>

Expand Down
28 changes: 16 additions & 12 deletions docs/Symbol.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
</style>
</head>
<body>
<h2><span class="class">Symbol(<span class="parameter">dbPath</span>, <span class="parameter">symbol</span>)</span></h2>
<h1>Symbol.js</h1>

<ul><li><a href="#classQsymbolQdbpathqqsymbol">Symbol(dbPath, symbol)</a></li><li><a href="#methodQsetisactiveQisactive">setIsActive(isActive)</a></li><li><a href="#methodQisactiveQ">isActive()</a></li><li><a href="#methodQsaveQ">save()</a></li><li><a href="#methodQloadQ">load()</a></li><li><a href="#methodQforeachdayQcbqqcontext">forEachDay(cb, context)</a></li><li><a href="#methodQrewindQ">rewind()</a></li><li><a href="#methodQnextdayQ">nextDay()</a></li><li><a href="#methodQfirstdayQ">firstDay()</a></li><li><a href="#methodQlastdayQ">lastDay()</a></li><li><a href="#methodQcountQ">count()</a></li><li><a href="#methodQdayexistsQdaystamp">dayExists(daystamp)</a></li></ul>

<h2><span class="class">Symbol(<span class="parameter">dbPath</span>, <span class="parameter">symbol</span>)</span></h2>

<p>Represents one particular symbol storage in the ticks database. Essentially this is just a wrapper around a
list of *.ticks files with handy access methods. </p>
Expand All @@ -59,21 +63,21 @@ <h2><span class="class">Symbol(<span class="parameter">dbPath</span>, <span clas
console.log("Day: %s", daystamp);
}</code></pre>

<h3>setIsActive(<span class="parameter">isActive</span>)</h3>
<h3><a name="methodQsetisactiveQisactive"></a> setIsActive(<span class="parameter">isActive</span>)</h3>

<p>Set active flag for the ticker. This flag is used by downloader to skip download this ticker from
IQFeed if the flag is set. Defaults to false, of course. Don't forget to call <code>.save()</code> after
setting the flag.</p>

<h3>isActive()</h3>
<h3><a name="methodQisactiveQ"></a> isActive()</h3>

<p>Get active flag for the ticker. </p>

<h3>save()</h3>
<h3><a name="methodQsaveQ"></a> save()</h3>

<p>Save updated information for the ticker. Now this is just the meta information that contains active flag.</p>

<h3>load()</h3>
<h3><a name="methodQloadQ"></a> load()</h3>

<p>Load the ticker from dbpath. Essentially does load the list of all days available for the ticker and
the meta information.</p>
Expand All @@ -82,51 +86,51 @@ <h3>load()</h3>

<ul><li><code><span class="type">Boolean</span></code> if loaded successfully.</li></ul>

<h3>forEachDay(<span class="parameter">cb</span>, <span class="parameter">context</span>)</h3>
<h3><a name="methodQforeachdayQcbqqcontext"></a> forEachDay(<span class="parameter">cb</span>, <span class="parameter">context</span>)</h3>

<p>Single-step iterator over all days. </p>

<ul><li><code><span class="type">Function</span></code> <code><strong>cb</strong></code> &#8212; callback.</li><li><code><strong>context</strong></code> &#8212; set <code>this</code> to this.</li></ul>

<p>Callback function will receive one argument: the daystamp, string.</p>

<h3>rewind()</h3>
<h3><a name="methodQrewindQ"></a> rewind()</h3>

<p>Rewind current iterator position to the beginning.</p>

<h3>nextDay()</h3>
<h3><a name="methodQnextdayQ"></a> nextDay()</h3>

<p>Get the next day from list of days. </p>

<p>Returns:</p>

<ul><li><code><span class="type">String</span></code> daystamp.</li></ul>

<h3>firstDay()</h3>
<h3><a name="methodQfirstdayQ"></a> firstDay()</h3>

<p>Get the first day from list of days. </p>

<p>Returns:</p>

<ul><li><code><span class="type">String</span></code> daystamp.</li></ul>

<h3>lastDay()</h3>
<h3><a name="methodQlastdayQ"></a> lastDay()</h3>

<p>Get the last day from list of days. </p>

<p>Returns:</p>

<ul><li><code><span class="type">String</span></code> daystamp.</li></ul>

<h3>count()</h3>
<h3><a name="methodQcountQ"></a> count()</h3>

<p>Get the count of available days.</p>

<p>Returns:</p>

<ul><li><code><span class="type">String</span></code> count of days.</li></ul>

<h3>dayExists(<span class="parameter">daystamp</span>)</h3>
<h3><a name="methodQdayexistsQdaystamp"></a> dayExists(<span class="parameter">daystamp</span>)</h3>

<p>Check if this daystamp exists for this ticker.</p>

Expand Down
16 changes: 10 additions & 6 deletions docs/Symbols.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
</style>
</head>
<body>
<h2><span class="class">Symbols(<span class="parameter">dbPath</span>)</span></h2>
<h1>Symbols.js</h1>

<ul><li><a href="#classQsymbolsQdbpath">Symbols(dbPath)</a></li><li><a href="#methodQloadQ">load()</a></li><li><a href="#methodQexistsQsymbol">exists(symbol)</a></li><li><a href="#methodQrewindQ">rewind()</a></li><li><a href="#methodQnextQ">next()</a></li><li><a href="#methodQcountQ">count()</a></li></ul>

<h2><span class="class">Symbols(<span class="parameter">dbPath</span>)</span></h2>

<p>Represents ticks database. Essentially this is just a wrapper around a
list of folders whose names are uppercase symbol names.</p>
Expand All @@ -57,15 +61,15 @@ <h2><span class="class">Symbols(<span class="parameter">dbPath</span>)</span></h
console.log("Symbol: %s", symbol.symbol);
}</code></pre>

<h3>load()</h3>
<h3><a name="methodQloadQ"></a> load()</h3>

<p>Load list of tickers from the database. Essentially will load all directory names from dbpath, skipping some specials.</p>

<p>Returns:</p>

<ul><li><code><span class="type">Boolean</span></code> true if successfully loaded.</li></ul>

<h3>exists(<span class="parameter">symbol</span>)</h3>
<h3><a name="methodQexistsQsymbol"></a> exists(<span class="parameter">symbol</span>)</h3>

<p>Checks if the symbol exists in the database. Essentially checks if the folder with such a name (uppercased)
exists in dbpath. </p>
Expand All @@ -76,19 +80,19 @@ <h3>exists(<span class="parameter">symbol</span>)</h3>

<ul><li><code><span class="type">Boolean</span></code> </li></ul>

<h3>rewind()</h3>
<h3><a name="methodQrewindQ"></a> rewind()</h3>

<p>Rewind the iterator position back to zero. </p>

<h3>next()</h3>
<h3><a name="methodQnextQ"></a> next()</h3>

<p>Get the next symbol from iterator. </p>

<p>Returns:</p>

<ul><li><code><span class="type">Symbol</span></code> the Symbol object created. It's your duty to call <code>load()</code> on it.</li></ul>

<h3>count()</h3>
<h3><a name="methodQcountQ"></a> count()</h3>

<p>Will return the count of symbols in tickers database.</p>

Expand Down
Loading

0 comments on commit 72ad2f8

Please sign in to comment.