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

Reading data from a file within an indicator without 3rd party tools


  • To: "Brian S. Hanley" <omega-list@xxxxxxxxxx
  • Subject: Reading data from a file within an indicator without 3rd party tools
  • From: Mike Gossland <mga@xxxxxxxx>
  • Date: Thu, 15 May 2003 19:39:25 -0700

PureBytes Links

Trading Reference Links

>
>Come to think of it, does anyone know of a way to read data
>from a file, from within an indicator? There's the "FileAppend"
>method for writing out, of course, but I can't seem to find
>any corresponding method to read data in from a file.
>
>Suggestions for reading a file in, other than writing my own DLL,
>or using a third party product such as "HashNums"?


Hi Brian,

To read in up to 2 numbers for particular dates, the following technique works well. It needs no 3rd party tools except for Excel to assemble the data. You can use the technique over and over to read in more numbers.

Using the data window in TS, export the price data for the chart you'd like to look at. This will give you "dummy data" that you'll use.

Import this data into Excel, and remove all columns but Date, Time, O, H, L, C.

Create two new headings called V and OI (volume and open interest)

Put your numbers in the volume and/or open interest column. Make sure they are integers, so multiply by 100 or 1000 first if necessary. Negative numbers are fine.

Save the file.

Add the file back into the chart as ascii data. Use the ascii file format D T O H L C V OI. Use a dop file if necessary. 

Don't replace the original symbol - just add in a new data stream. You can make it hidden once you have everything working nicely.

Refer to your numbers as V of data2 and OI of data2. If necessary, divide back down by the scaling factor you needed to make them integers.

That's it in a nutshell. This has been very useful to me on many occasions.

If 2 numbers isn't enough for you, I also have a DLL that brings in up to 4 numbers. If you are interested, please contact me off list.

Regards,
Mike Gossland