To implement and backtest ideas and work with time in an easier fashion [and to avoid E-Signal APIs], I wrote a DLL that helps me pull information from E-Signal and populate a database with it.
The intention of this code, however crappy it may be, is to help me implement Don's Openings and have a strategy to backtest the performance of his openings, assuming envelope-based fills get taken care of on the first opening print where the exchange = the NYSE.
I am not posting DLL source code in public yet. But since it's a utility, I will likely formalize it and release it to the public. I am releasing the script interface to the DLL. You could probably implement your own DLL with relative ease, even if I never posted such a thing.
The license on the following code here is GPL, not BSD. If you are unfamiliar with the terms of the GPL, stop dead in your tracks in proceed to gnu.org and read, read, read. Please note that while I am not using my name, I am asserting copyright via this alias which is ultimately connected to my real name by the e-mail address registered with ET. I am using this license because if you lose all your money because of this script, I am not liable. Usage of this script means that you acknowledge that I am not liable in any way shape or form for your future misery as a result of using this script.
I want you to be rich, but I make mistakes and write bad software on occasion too.
-- Code Begin --
// Script to pull content from E-Signal
// Copyright (C) 2006, authored by FatRat. (alias fatrat on
www.elitetrader.com)
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
var g_DEBUG = true;
var g_EnableDataExport = false;
var g_DLL = new DLL("Chart2DB.dll");
function preMain()
{
if( g_DEBUG ) debugPrint( "[DEBUG] Entered preMain()\n" );
setStudyTitle( "Char2DB Transfer" );
setCursorLabelName( "C2DB" );
setDefaultBarFgColor( Color.green );
if( g_DEBUG ) debugPrint( "[DEBUG] Binding Function...\n" );
g_DLL.addFunction( "EFS_Export1mOHLC", DLL.INT, DLL.CDECL, "Export1mOHLC", DLL.STRING, DLL.INT, DLL.INT, DLL.INT, DLL.INT, DLL.INT, DLL.INT, DLL.DOUBLE, DLL.DOUBLE, DLL.DOUBLE, DLL.DOUBLE );
if( g_DEBUG ) debugPrint( "[DEBUG] Function bound.\n" );
var interval = getInterval();
if( interval == "1" )
{
debugPrint( "Enabling Data Export\n" );
g_EnableDataExport = true;
}
else
{
debugPrint( "Disabling Data Export [non-1m chart]\n" );
g_EnableDataExport = false
}
if( g_DEBUG ) debugPrint( "[DEBUG] Exited preMain()\n" );
}
function main()
{
if( g_DEBUG == true ) debugPrint( "[DEBUG] Entered main()\n" );
if( g_EnableDataExport == true )
{
var _month, _day, _year, _hour, _minute, _second, _open, _high, _low, _close, _symbol;
_year = getYear(0);
_month = getMonth(0);
_day = getDay(0);
_hour = getHour(0);
_minute = getMinute(0);
_second = getSecond(0);
_open = open( 0 );
_high = high( 0 );
_low = low( 0 );
_close = close( 0 );
_symbol = getSymbol();
if( g_DEBUG == true )
{
debugPrint( "[DEBUG] Parameters: " + _symbol + "," + _month + "," + _day + "," + _year + "," + _hour + "," +
_minute + "," + _second + "," + _open + "," + _high + "," + _low + "," +
_close + "\n" );
}
var result =
g_DLL.call( "EFS_Export1mOHLC", _symbol, _month, _day, _year, _hour, _minute, _second, _open, _high, _low, _close );
return result;
}
else
{
if( g_DEBUG ) debugPrint( "Data Export Unavailable" );
return 0;
}
}
//
// Unload Cleanup
//
function postMain()
{
if( g_DEBUG )
debugPrint( "[DEBUG] postMain()\n" );
}
-- Code End--