HTTP Object

ICE Data Services -

HTTP Object


The HTTP object allows EFS to open a file from a URL to import data for use within the EFS script. The HTTP functionality can be used to read text files (e.g., .txt, .htm, .html, .xml, etc.)


Warning: It is highly recommended that you do not use the HTTP object within the main() function where it has the potential of being called on every new trade. Instead, use the HTTP object either in the preMain() function or in custom user functions that are only called when needed.










var v = new HTTP("");  




var v =new HTTP("" + getSymbol());



//After constructing the object, do something like this:


if( {

    while(!v.eof()) {






//Here's an example of a custom function for

//loading a text file from a URL, which can

//be called from preMain().  

//The MyFile.txt file would need to contain 6

//numbers, each on a separate line.  This example

//populates a global array with the 6 numbers

//from MyFile.txt.


var aArray = new Array(6);


function preMain() {





function loadData() {

var f = new HTTP("");

var i = 0;"rt");

 if ( {

  for (i = 0; i < 6; ++i) {

   aArray[i] = f.readln();



 f = null;