I'm having some problems with a script.
First, this is what I am trying to do: I have a C++ program that has information it pulls from a DB. The C++ program is in a DLL, and the EFS script's pre-main function builds a communications channel with the DLL.
Now, in order to match data from the database with information on the charts, I tag the data in the database with timestamps in terms of seconds since midnight 1/1/1970. When I request OHLC prices from EFS, I attempt to get the rawtime() information for the bar. This way, I can view all the transactions in terms of a flat, linear "timespace." (The C++ program takes care of the conversions such that time zone shifts and such are accounted for.)
However, when my code executes, it only runs through main() once. If I comment out all of the DLL calls, it's still the rawtime() function or getValue( "rawtime" ) that let's main run ONCE, and never again. I have checked the settings to make sure it works on a per-tick basis and not on the close. If I -remove- the call to the rawtime function or the getValue( "rawtime" ) function, then main() gets called multiple times.
This is a stripped down snippet:
Foo gets printed only once if getValue( "rawtime", obi ) or getValue( "rawtime", obi, 1 ), or rawtime() is used. If I remove that line, then "Foo" gets printed once per bar and tick as is appropriate.
How can I work around this such that I can retrieve the raw time and continue to have main() get called per tick?
First, this is what I am trying to do: I have a C++ program that has information it pulls from a DB. The C++ program is in a DLL, and the EFS script's pre-main function builds a communications channel with the DLL.
Now, in order to match data from the database with information on the charts, I tag the data in the database with timestamps in terms of seconds since midnight 1/1/1970. When I request OHLC prices from EFS, I attempt to get the rawtime() information for the bar. This way, I can view all the transactions in terms of a flat, linear "timespace." (The C++ program takes care of the conversions such that time zone shifts and such are accounted for.)
However, when my code executes, it only runs through main() once. If I comment out all of the DLL calls, it's still the rawtime() function or getValue( "rawtime" ) that let's main run ONCE, and never again. I have checked the settings to make sure it works on a per-tick basis and not on the close. If I -remove- the call to the rawtime function or the getValue( "rawtime" ) function, then main() gets called multiple times.
This is a stripped down snippet:
PHP Code:
//
// Initial Entry Point
//
function main()
{
var result, obi;
var obitime;
var numbars;
if( g_NoProcess )
return null;
obi = getOldestBarIndex();
obitime = rawtime( obi );
obitime = getValue( "rawtime", obi );
debugPrint( "Foo\n" );
}
Foo gets printed only once if getValue( "rawtime", obi ) or getValue( "rawtime", obi, 1 ), or rawtime() is used. If I remove that line, then "Foo" gets printed once per bar and tick as is appropriate.
How can I work around this such that I can retrieve the raw time and continue to have main() get called per tick?
Comment