{"id":461,"date":"2011-08-02T06:43:42","date_gmt":"2011-08-02T06:43:42","guid":{"rendered":"http:\/\/datafutures.net\/ecsi\/?page_id=461"},"modified":"2011-11-16T21:12:56","modified_gmt":"2011-11-16T21:12:56","slug":"u-a-api-faq","status":"publish","type":"page","link":"https:\/\/www.csidata.com\/?page_id=461","title":{"rendered":"U.A. API FAQ"},"content":{"rendered":"<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I have been using a piece of software called FDC that interefaces with CSI&#8217;s API to access the data for neary four years now with out any problems. I recently purchased a new laptop with the Windows 7 Ultimate OS (64 bit) on it.\u00a0 On this computer the FDC software is not able to successfully interface with the API. What could be wrong?<\/span><\/p>\n<p><span><span style=\"font-weight: bold;\">Answer:<\/span> <\/span>The following keys should be present in your registry, if not, then something is preventing the UAd.exe from registering itself when it is run.\u00a0 Please make sure you run UA from an admin account at least once for the entries to be entered.<\/p>\n<p>HKEY_CLASSES_ROOT\\TypeLib\\{6F2F99A0-6600-11D3-B331-525400E8C92C}\\1.0\\0\\win32\\&#8221;C:\\ua\\uad.exe&#8221;<\/p>\n<p>HKEY_CLASSES_ROOT\\Wow6432Node\\CLSID\\{6F2F99A3-6600-11D3-B331-525400E8C92C}\\LocalServer32\\&#8221;C:\\ua\\uad.exe \/Automation&#8221;<\/p>\n<p>HKEY_CLASSES_ROOT\\Wow6432Node\\CLSID\\{A7120BAF-D87E-4949-93A0-53BB63F4D528}\\LocalServer32\\&#8221;C:\\ua\\uad.exe \/Automation&#8221;<\/p>\n<p>HKEY_CLASSES_ROOT\\Wow6432Node\\TypeLib\\{6F2F99A0-6600-11D3-B331-525400E8C92C}\\1.0\\0\\win32\\&#8221;C:\\ua\\uad.exe&#8221;<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: Why does the UAD.exe program hang when it is called from a perl script for the third time while running. I&#8217;m running the uad.exe program on a windows server 2003 machine with all patches. <\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> Try this first, prior to running from perl, ensure that the file &#8220;windows\\ua.ini&#8221; is set to the correct directory, like:<br \/>\n[Program]<br \/>\nDirectory=C:\\ua\\<\/p>\n<p>using SetPrivateProfileString<\/p>\n<p>Try setting your scripts working directory as C:\\UA<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: Moving from successful Excel API interface to\u00a0 to VS2010. Windows 7 x64 with VS2010 Ultimate. Can you offer a code sample for the Current release of Visual Studio?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> Will you be using C++ or C#?<\/p>\n<p><a href=\"dataexamples\/csi_ua_c.zip\">Click here for a C# example.<\/a><\/p>\n<p>If using C++ here is a sample array accessor to use after a request: ( you&#8217;ll need to import the com class from ua\\uapi\\ua.tlb )<\/p>\n<p>IAPI2 *UAapi = new IAPI2();<br \/>\nif(UAapi==NULL)<br \/>\n{<br \/>\nAfxMessageBox(&#8220;Unable to open connection to UA stub object&#8221;);<br \/>\nreturn;<\/p>\n<p>}<br \/>\nif(!UAapi-&gt;CreateDispatch(&#8220;UA.Api2&#8221;))<br \/>\n{<br \/>\nAfxMessageBox(&#8220;Unable to open connection to UA&#8221;);<br \/>\nreturn;<br \/>\n}<\/p>\n<p>UAapi-&gt;SetApplyCommodityAdjustments(0);<br \/>\nUAapi-&gt;SetRoundToTick(0);<\/p>\n<p>VARIANT IArray, DArray;<br \/>\nVariantInit(&amp;IArray);<br \/>\nVariantInit(&amp;DArray);<br \/>\ncount= UAapi-&gt;CopyRetrievedDataToArray2(0, &amp;IArray , &amp;DArray);<br \/>\nchar strLineOut[128];<br \/>\nlong NumIntColumns, NumFltColumns;<br \/>\n{ SafeArrayGetUBound(IArray.parray,1,&amp;NumIntColumns); NumIntColumns++;<br \/>\nSafeArrayGetUBound(DArray.parray,1,&amp;NumFltColumns); NumFltColumns++;<br \/>\n}<br \/>\nlong *iArray; SafeArrayAccessData(IArray.parray,(void**)&amp;iArray);<br \/>\ndouble *dArray; SafeArrayAccessData(DArray.parray,(void**)&amp;dArray);<\/p>\n<p>for(int c=0; c &lt; count; c++ )<br \/>\n{<br \/>\n#define sGetDate(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+0]<br \/>\n#define sGetDyDm(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+1]<br \/>\n#define sGetStrike(c) iArray[NumIntColumns*(c)+2]<br \/>\n#define sGetVol(c)\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+3]<br \/>\n#define sGetTVol(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+5]<br \/>\n#define sGetOi(c)\u00a0\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+4]<br \/>\n#define sGetTOi(c)\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+6]<br \/>\n#define sGetfStrike(c)dArray[NumFltColumns*(c)+0]<br \/>\n#define sGetOpen(c)\u00a0\u00a0 dArray[NumFltColumns*(c)+1]<br \/>\n#define sGetHigh(c)\u00a0\u00a0 dArray[NumFltColumns*(c)+2]<br \/>\n#define sGetLow(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+3]<br \/>\n#define sGetClose(c)\u00a0 dArray[NumFltColumns*(c)+4]<br \/>\n#define sGetBid(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+5]<br \/>\n#define sGetAsk(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+6]<br \/>\n\/\/ print to file the commod code<br \/>\n{\u00a0 sprintf(strLineOut, &#8220;%d,%d,%2.8f00, %2.8f00, %2.8f00, %2.8f00, %d,%d\\n&#8221;,\u00a0 sGetDate(c),<br \/>\nsGetDyDm(c),<br \/>\nsGetOpen(c),<br \/>\nsGetHigh(c),<br \/>\nsGetLow(c),<br \/>\nsGetClose(c),<br \/>\nsGetVol(c),<br \/>\nsGetOi(c)<br \/>\nfputs(strLineOut, ptr);<br \/>\n}<br \/>\n}<br \/>\nSafeArrayUnaccessData(IArray.parray);<br \/>\nSafeArrayUnaccessData(DArray.parray);<br \/>\n}<\/p>\n<p>or<br \/>\nlong nNumRecords = UAapi-&gt;CopyRetrievedDataToArray((short)0,<br \/>\n&amp;DateArray, &amp;DOWArray, &amp;DydmArray,<br \/>\n&amp;OpenArray, &amp;HighArray, &amp;LowArray, &amp;CloseArray,<br \/>\n&amp;ClosingBidArray, &amp;ClosingAskArray,<br \/>\n&amp;VolumeArray, &amp;OIArray, &amp;TotalVolumeArray, &amp;TotalOIArray, &amp;CashArray);<br \/>\nSafeArrayAccessData(DateArray.parray,(void**)&amp;cDateArray);<br \/>\nSafeArrayAccessData(DydmArray.parray,(void**)&amp;cDydmArray);<br \/>\nSafeArrayAccessData(OpenArray.parray,(void**)&amp;cOpenArray);<br \/>\nSafeArrayAccessData(HighArray.parray,(void**)&amp;cHighArray);<br \/>\nSafeArrayAccessData(LowArray.parray,(void**)&amp;cLowArray);<br \/>\nSafeArrayAccessData(CloseArray.parray,(void**)&amp;cCloseArray);<br \/>\nSafeArrayAccessData(VolumeArray.parray,(void**)&amp;cCVArray);<br \/>\nSafeArrayAccessData(OIArray.parray,(void**)&amp;cCIArray);<\/p>\n<p>for(int j=0;j&lt;nNumRecords;j++)<br \/>\n{<br \/>\ndouble o=cOpenArray[j];<br \/>\ndouble h=cHighArray[j];<br \/>\ndouble l=cLowArray[j];<br \/>\ndouble c=cCloseArray[j];<br \/>\nfprintf(ptr,&#8221;%d,%d, %2.8f00, %2.8f00, %2.8f00, %2.8f00,%8d,%8d\\n&#8221;,<br \/>\ncDateArray[j], cDydmArray[j],<br \/>\no,<br \/>\nh,<br \/>\nl,<br \/>\nc,<br \/>\ncCVArray[j],<br \/>\ncCIArray[j] );<\/p>\n<p>}<br \/>\nSafeArrayUnaccessData(DateArray.parray);<br \/>\nSafeArrayUnaccessData(DydmArray.parray);<br \/>\nSafeArrayUnaccessData(OpenArray.parray);<br \/>\nSafeArrayUnaccessData(HighArray.parray);<br \/>\nSafeArrayUnaccessData(LowArray.parray);<br \/>\nSafeArrayUnaccessData(CloseArray.parray);<br \/>\nSafeArrayUnaccessData(VolumeArray.parray);<br \/>\nSafeArrayUnaccessData(OIArray.parray);<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I am confused about the use of letters \u201cC\u201d and \u201cX\u201d in relation to the file name of a detrended contract. Which is correct, please?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> There are 2 ways to Detrend, the one that refers to is where the detrend begins back before the current contract.\u00a0 This is the 2nd contract option.<br \/>\nThe other begins backwards before the current day, this is the 2nd day option. It looks like this one isn&#8217;t documented but may be what you are considering.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: We installed CSI &#8220;Unfair Advantage 2.10.7.115&#8221; on a new Windows 7 Enterprise 64 bit machine.\u00a0 The application works, but we are having problems with API2. The open\/high\/low\/close values come out garbled in our extract program.\u00a0 API2 works fine with our existing Windows XP 32 bit with &#8220;Unfair Advantage 2.10.7.7&#8221;. What is the issue?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> Versions after 2.10.7.7 have changed the variant data type from float to double due to overflows. This is contained in the CopyDataToRetrievedArray routines.<br \/>\nThis may be what you&#8217;ve encountered and it&#8217;s a good chance that it is.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: If I want to get a quote for MSFT, do I need to have MSFT in some kind of portfolio or list a-priori or can I just query the API ad-hoc.\u00a0 If the latter, then does that just retrieve the data over the wire and cache it in the database?\u00a0 My symbol list changes from week-to-week and it would be extremely painful for me to provide it a prior.<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> The best way to get a quote in an ad hoc way would be to use either<\/p>\n<p>RetrieveSnapShot or<br \/>\nRetrieveAdjAndUnadjStock(\u00a0 long MarketNumber\/*[in]*\/,<br \/>\nlong LoadStartDate\/*[in]*\/,<br \/>\nlong LoadEndDate\/*[in]*\/,<br \/>\nVARIANT* IntResultArray\/*[out]*\/,<br \/>\nVARIANT* FltResultArray\/*[out]*\/,<br \/>\nlong* NumRecords\/*[out,retval]*\/) \/\/ [85]<\/p>\n<p>These return data in 2 variant arrays, an integer for dates, volumes, and a double float for pricing.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I\u2019d like to start pulling future data from CSI through the API and I can\u2019t find any documentation outlining how to access CSI through Python or Java.\u00a0\u00a0<\/span><br \/>\n<span style=\"font-weight: bold;\">Could you provide me some guidance?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> You&#8217;re right, I don&#8217;t have examples using those languages. I did find these for python, which is where you&#8217;ll need to start if you don&#8217;t have COM support:<\/p>\n<p>http:\/\/www.boddie.org.uk\/python\/COM.html<br \/>\nor<br \/>\nhttp:\/\/sourceforge.net\/projects\/pywinauto\/<\/p>\n<p>From there, you may look at the way perl connects, and imitate. There is an Exmple.pl in the uapi root.<\/p>\n<p>I&#8217;m not up on Python, but with Perl, I found that it does not support Variant array passing through COM.\u00a0 Therefore the return of data can only be done through the Clipboard, which is not advisable.\u00a0 I&#8217;d recommend you look into that before tackling this in Python.<\/p>\n<p>As for Java, if J++ is still around, that might work, but I&#8217;m not sure about Sun Java. This looks promising:<br \/>\nhttp:\/\/edn.embarcadero.com\/article\/33305<\/p>\n<p>But again, you may wish to check on the Variant Array passing to COM.<\/p>\n<p>I just perform another search, and found that Perl now supports this. Here is what the lingo talks about:<\/p>\n<p>Variants by reference<br \/>\nSome OLE servers expect parameters passed by reference so that they can be changed in the method call. This allows methods to easily return multiple values. There is preliminary support for this in the Win32::OLE::Variant module:<\/p>\n<p><span style=\"font-style: italic;\">my $x = Variant(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 my $y = Variant(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $Corel-&gt;GetSize($x, $y);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print &#8220;Size is $x by $y\\n&#8221;;<\/span><\/p>\n<p>After the GetSize method call $x and $y will be set to the respective sizes. They will still be variants. In the print statement the overloading converts them to string representation automatically.<br \/>\nVT_BYREF is now supported for all variant types (including SAFEARRAYs). It can also be used to pass an OLE object by reference:<\/p>\n<p><span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0 my $Results = $App-&gt;CreateResultsObject;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $Object-&gt;Method(Variant(VT_DISPATCH|VT_BYREF, $Results));<\/span><\/p>\n<p>so\u00a0 you could then POSSIBY translate something like this to get the data after<br \/>\nthe requests:<\/p>\n<p><span style=\"font-style: italic;\">$DateArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $OpenArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $HighArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $LowArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $CloseArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $DOWArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $DydmArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $ClosingBidArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $ClosingAskArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $VolumeArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $OIArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $TotalVolumeArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $TotalOIArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 $CashArray = Win32::OLE::Variant-&gt;new(VT_I4|VT_BYREF, 0);<\/span><\/p>\n<p><span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $numRec= $CSI_OLEhandle-&gt;CopyRetrievedDataToArray(0,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$DateArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$DOWArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$DydmArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$OpenArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$HighArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$LowArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$CloseArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$ClosingBidArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$ClosingAskArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$VolumeArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$OIArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$TotalVolumeArray,<\/span><br \/>\n<span style=\"font-style: italic;\">\\$TotalOIArray, <\/span><br \/>\n<span style=\"font-style: italic;\">\\$CashArray);<\/span><\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I am currently developing an application in Excel (2007) to access Unfair Advantage using the API2.<\/span><br \/>\n<span style=\"font-weight: bold;\">The purpose of the Excel application is to generate a report for a selected list of markets that includes the most recent rolled contract, the current contract and the next available contract.\u00a0 Once if have these contracts identified, I will extract specific contract information such as volume and open interest among other things.<\/span><span style=\"font-weight: bold;\"> I have completed the VBA code to generate a list of basic market information using the Market Profile function, such as market name, exchange, trade units, contract size, valid months, etc.\u00a0 This was rather straight forward.\u00a0 I also use the Build Contract List function to get the number of contracts for a particular market.<\/span><span style=\"font-weight: bold;\"> Now my primary question relates to using the Retrieve Back Adjusted Contract function.\u00a0 I define the various roll parameters such as the market number, roll logic type, roll when, valid months, roll at least N days before expiration, etc.\u00a0 I need to extract is the most recent contract roll date (\u201cLast Roll Date\u201d).\u00a0 Since this function returns the number of data days found, I am guessing that the most recent roll date is somewhere within this data, but I\u2019m not sure where I might find it.\u00a0 How do I determine the most recent roll date?\u00a0\u00a0 <\/span><\/p>\n<p><span><span style=\"font-weight: bold;\">Answer:<\/span> You&#8217;ll need to iterate through the data to detect the last roll date. Within the data is the contract month field,\u00a0 just go to the end, and compare backwards until you find the change in delivery.<\/span><\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: Is the CSI API available for a C++ compilation?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> Yes, the API is available for C++.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I&#8217;m trying to access stock prices via the OLE API.\u00a0 This code tries to access IBM prices for all dates:<\/span><\/p>\n<p><span style=\"font-weight: bold; font-style: italic;\">long count = ua-&gt;RetrieveSnapShot(5159, 1, 0, 0, 0, -1, -1, &amp;longArray, &amp;floatArray);<\/span><\/p>\n<p><span style=\"font-weight: bold;\">The results include many rows for the sames date (with a different returned market number).\u00a0 If I only use the returned 5159 dates, I still get different results from the Unfair Advantage application.\u00a0 <\/span><\/p>\n<p><span style=\"font-weight: bold;\">For date 19620102: UA close=2.64101139, API close=-24.936167.<br \/>\nWhy are some API prices negative? <\/span><span style=\"font-weight: bold;\">Can you provide an API code example that returns the same prices for IBM that are displayed in Unfair Advantage?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> For Stocks you may wish to try using<\/p>\n<p><span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 count = UAapi-&gt;RetrieveAdjAndUnadjStock(5159, -1, -1, &amp;IArray, &amp;DArray);<\/span><\/p>\n<p>or you can stick with<\/p>\n<p><span style=\"font-style: italic;\">count= UAapi-&gt;RetrieveSnapShot(5159 ,1 , 0 , 0 , 0 , -1 , -1 , &amp;IArray , &amp;DArray);<\/span><\/p>\n<p>There are also some properties to consider:<\/p>\n<p><span style=\"font-style: italic;\">UAapi-&gt;SetApplyStockSplitAdjustments(1);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 UAapi-&gt;SetRoundToTick(0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 UAapi-&gt;SetPropStockAdjustments(0);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 UAapi-&gt;SetApplyStockDividendAdjustments(0);<\/span><\/p>\n<p>Here is sample array access code:<\/p>\n<p><span style=\"font-style: italic;\">VARIANT IArray, DArray;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 VariantInit(&amp;IArray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 VariantInit(&amp;DArray);<\/span><\/p>\n<p>count = UAapi-&gt;RetrieveAdjAndUnadjStock(5159, -1, -1, &amp;IArray, &amp;DArray);<\/p>\n<p><span style=\"font-style: italic;\">if( count )<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 char strLineOut[128];<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 long NumIntColumns, NumFltColumns;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 { SafeArrayGetUBound(IArray.parray,1,&amp;NumIntColumns); NumIntColumns++;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SafeArrayGetUBound(DArray.parray,1,&amp;NumFltColumns); NumFltColumns++;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 long *iArray; SafeArrayAccessData(IArray.parray,(void**)&amp;iArray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float *dArray; SafeArrayAccessData(DArray.parray,(void**)&amp;dArray);<\/span><\/p>\n<p><span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for(int c=0; c &lt; count; c++ )<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetDate(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+0]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetDyDm(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+1]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetStrike(c) iArray[NumIntColumns*(c)+2]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetVol(c)\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+3]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetTVol(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+5]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetOi(c)\u00a0\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+4]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetTOi(c)\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+6]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetfStrike(c)dArray[NumFltColumns*(c)+0]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetOpen(c)\u00a0\u00a0 dArray[NumFltColumns*(c)+1]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetHigh(c)\u00a0\u00a0 dArray[NumFltColumns*(c)+2]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetLow(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+3]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetClose(c)\u00a0 dArray[NumFltColumns*(c)+4]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetBid(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+5]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetAsk(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+6]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ print to file the commod code<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if( isOption )<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\u00a0 sprintf(strLineOut, &#8220;%d,%d,%d,,%d,%g,%g,%g,%g,%g,%g,%d,%d,%d,%d,%d\\n&#8221;,\u00a0 nMarketNo,\u00a0 sGetDyDm(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetStrike(c), sGetDate(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetOpen(c), sGetClose(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetHigh(c), sGetLow(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetBid(c),\u00a0 sGetAsk(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetVol(c),\u00a0 sGetTVol(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetOi(c),\u00a0\u00a0 sGetTOi(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 nOptionConversionFactor);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fputs(strLineOut, pContractsOut);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } else<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\u00a0 sprintf(strLineOut, &#8220;%d,%d,,%d,%g,%g,%g,%g,%g,%g,%d,%d,%d,%d,%d\\n&#8221;,\u00a0 nMarketNo,\u00a0 sGetDyDm(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetDate(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetOpen(c), sGetClose(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetHigh(c), sGetLow(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetBid(c),\u00a0 sGetAsk(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetVol(c),\u00a0 sGetTVol(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sGetOi(c),\u00a0\u00a0 sGetTOi(c),<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 nConversionFactor);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fputs(strLineOut, pUnderlyingContractsOut);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/p>\n<p><span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SafeArrayUnaccessData(IArray.parray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SafeArrayUnaccessData(DArray.parray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 }<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 ua-&gt;Release();<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 flcose(ptr);<\/span><\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\"><span style=\"font-weight: bold; color: #ff0000;\">UPDATE: We released a new API documentation. <a href=\"custserv\/onlinehelp\/uaapi\/UaOleApi.doc\">Click here<\/a> to download.<\/span><\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I am about to upgrade some software which interfaces with the Metastock format. How can I do some &#8216;C&#8217; routines which can read Microsoft binary format (MBF)?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer: <\/span>It is contained in the m2i_i2m.dll that is located in the ua\\uapi directory. This will translate the Microsoft binary into ieee float format and vice versus.<br \/>\nHere are the actual routines that can be used.<\/p>\n<p><span style=\"font-style: italic;\">extern &#8220;C&#8221;<\/span><br \/>\n<span style=\"font-style: italic;\">{<\/span><br \/>\n<span style=\"font-style: italic;\">\/\/ XXXX XXXX SMMM MMMM MMMM MMMM MMMM MMMM (MSBIN)<\/span><br \/>\n<span style=\"font-style: italic;\">\/\/ SXXX XXXX XMMM MMMM MMMM MMMM MMMM MMMM (IEEE)<\/span><br \/>\n<span style=\"font-style: italic;\">int msbintoieee( float *src4, float *dst4 )<\/span><br \/>\n<span style=\"font-style: italic;\">{<\/span><br \/>\n<span style=\"font-style: italic;\"> unsigned char szIeee[4], szExp;<\/span><br \/>\n<span style=\"font-style: italic;\"> memcpy( szIeee, src4, 4 );<\/span><br \/>\n<span style=\"font-style: italic;\"> szExp=szIeee[3];<\/span><br \/>\n<span style=\"font-style: italic;\"> szExp-=0x02; <\/span><br \/>\n<span style=\"font-style: italic;\"> if( szExp == 0xFF )<\/span><br \/>\n<span style=\"font-style: italic;\"> return 1;<\/span><br \/>\n<span style=\"font-style: italic;\"> if( szIeee[2] &amp; 0x80 ) <\/span><br \/>\n<span style=\"font-style: italic;\"> szIeee[3]=0x80; \/\/ S &lt;- S else szIeee[3]=0x00; szIeee[3]|=(szExp&gt;&gt;1); \/\/ -&gt; XXXX XXXX<\/span><br \/>\n<span style=\"font-style: italic;\"> if( szExp &amp; 0x01 ) <\/span><br \/>\n<span style=\"font-style: italic;\"> szIeee[2]|=0x80; <\/span><br \/>\n<span style=\"font-style: italic;\"> else<\/span><br \/>\n<span style=\"font-style: italic;\"> szIeee[2]&amp;=0xEF;<\/span><br \/>\n<span style=\"font-style: italic;\"> memcpy( dst4, &amp;szIeee, 4 );<\/span><br \/>\n<span style=\"font-style: italic;\"> return 0;<\/span><br \/>\n<span style=\"font-style: italic;\">}<\/span><br \/>\n<span style=\"font-style: italic;\">\/\/ SXXX XXXX XMMM MMMM MMMM MMMM MMMM MMMM (IEEE)<\/span><br \/>\n<span style=\"font-style: italic;\">\/\/ XXXX XXXX SMMM MMMM MMMM MMMM MMMM MMMM (MSBIN)<\/span><br \/>\n<span style=\"font-style: italic;\">int ieeetomsbin( float *src4, float *dst4 )<\/span><br \/>\n<span style=\"font-style: italic;\">{<\/span><br \/>\n<span style=\"font-style: italic;\"> unsigned char szMsbin[4], szExp;<\/span><br \/>\n<span style=\"font-style: italic;\"> memcpy( szMsbin, src4, 4 );<\/span><br \/>\n<span style=\"font-style: italic;\"> szExp=szMsbin[3]&lt;&lt;1;&gt;&gt;7; \/\/ XXXX XXXX &lt;- szExp+=0x02; if( szExp == 0xFF ) return 1; if( szMsbin[3] &amp; 0x80 ) \/\/ S -&gt; S<\/span><br \/>\n<span style=\"font-style: italic;\"> szMsbin[2]|=0x80; <\/span><br \/>\n<span style=\"font-style: italic;\"> else<\/span><br \/>\n<span style=\"font-style: italic;\"> szMsbin[2]&amp;=0x7F;<\/span><br \/>\n<span style=\"font-style: italic;\"> szMsbin[3]=szExp; <\/span><br \/>\n<span style=\"font-style: italic;\"> memcpy( dst4, &amp;szMsbin, 4 );<\/span><br \/>\n<span style=\"font-style: italic;\"> return 0;<\/span><br \/>\n<span style=\"font-style: italic;\">}<\/span><br \/>\n<span style=\"font-style: italic;\">}<\/span><\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I am running Linux and would like the ability to pull data from CSI via the C API. Is that possible?<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer: <\/span>We haven&#8217;t had a chance to embark on a Linux compatible UA.\u00a0 You mentioned<br \/>\nthat you were able to makes some calls through wine, but had problems with others.<br \/>\nMaybe we can try to facilitate these, although we&#8217;d have to reference wine to see if<br \/>\nit is capable of handling variant safearrays in the proper manner.<br \/>\nIt was CopyRetrievedDataToArray, and CopyRetrievedDataToArray2 that failed.<\/p>\n<p>Here is the proper way to use it:<br \/>\n<span style=\"font-style: italic;\">VARIANT IArray, DArray;<\/span><br \/>\n<span style=\"font-style: italic;\">VariantInit(&amp;IArray);<\/span><br \/>\n<span style=\"font-style: italic;\">VariantInit(&amp;DArray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0<\/span><br \/>\n<span style=\"font-style: italic;\">int count= UAapi-&gt;CopyRetrievedDataToArray2(0, &amp;IArray , &amp;DArray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0<\/span><br \/>\n<span style=\"font-style: italic;\">if( count )<\/span><br \/>\n<span style=\"font-style: italic;\">{<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 char strLineOut[128];<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 long NumIntColumns, NumFltColumns;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 { SafeArrayGetUBound(IArray.parray,1,&amp;NumIntColumns); NumIntColumns++;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0 SafeArrayGetUBound(DArray.parray,1,&amp;NumFltColumns); NumFltColumns++;<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 }<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 long *iArray; SafeArrayAccessData(IArray.parray,(void**)&amp;iArray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 double *dArray; SafeArrayAccessData(DArray.parray,(void**)&amp;dArray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 for(int c=0; c &lt; count; c++ )<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0 {<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetDate(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+0]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetDyDm(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+1]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetStrike(c) iArray[NumIntColumns*(c)+2]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetVol(c)\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+3]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetTVol(c)\u00a0\u00a0 iArray[NumIntColumns*(c)+5]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetOi(c)\u00a0\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+4]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetTOi(c)\u00a0\u00a0\u00a0 iArray[NumIntColumns*(c)+6]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetfStrike(c)dArray[NumFltColumns*(c)+0]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetOpen(c)\u00a0\u00a0 dArray[NumFltColumns*(c)+1]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetHigh(c)\u00a0\u00a0 dArray[NumFltColumns*(c)+2]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetLow(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+3]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetClose(c)\u00a0 dArray[NumFltColumns*(c)+4]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetBid(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+5]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #define sGetAsk(c)\u00a0\u00a0\u00a0 dArray[NumFltColumns*(c)+6]<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0 \u00a0<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fprintf(ptr,&#8221;%d, %g, %g, %g, %g\\n&#8221;, sGetDate(c), sGetOpen(c),sGetLow(c),sGetHigh(c),sGetClose(c) );<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0 }<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0 SafeArrayUnaccessData(IArray.parray);<\/span><br \/>\n<span style=\"font-style: italic;\">\u00a0\u00a0\u00a0\u00a0 SafeArrayUnaccessData(DArray.parray);<\/span><br \/>\n<span style=\"font-style: italic;\">}<\/span><\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I would like to retrieve data for the Hong Kong Dollar (QE7) like in the code below. I am not sure what call to make to actually retrieve the data. The functions RetrieveStock and RetrieveContract do not seem appropriate here; the former is for Stocks and the latter is for Futures. Is there an appropriate retrieve function for cash, spot, or FX data?<\/span><\/p>\n<p><span style=\"font-style: italic;\">Dim UA As Object<\/span><br \/>\n<span style=\"font-style: italic;\">Dim NumBars As Long<\/span><br \/>\n<span style=\"font-style: italic;\">Dim ErrNo As Integer<\/span><br \/>\n<span style=\"font-style: italic;\">Set UA = CreateObject(&#8220;UA.Api2&#8221;)<\/span><br \/>\n<span style=\"font-style: italic;\">UA.MarketSymbol = &#8220;QE7&#8221;<\/span><br \/>\n<span style=\"font-style: italic;\">UA.MarketNumber = UA.FindMarketNumber()<\/span><br \/>\n<span style=\"font-style: italic;\">&#8216; This will return MarketNumber = 2257&#8230;<\/span><br \/>\n<span style=\"font-style: italic;\">MsgBox &#8220;MarketNumber = &#8221; &amp; UA.MarketNumber<\/span><br \/>\n<span style=\"font-style: italic;\">ErrNo = UA.GetMarketProfile()<\/span><br \/>\n<span style=\"font-style: italic;\">&#8216; This will return ErrNo = 1&#8230;<\/span><br \/>\n<span style=\"font-style: italic;\">MsgBox &#8220;ErrNo = &#8221; &amp; ErrNo<\/span><br \/>\n<span style=\"font-style: italic;\">&#8216; This will return QE7 : CASH: Hong Kong Dollars per 1 U.S. Dollar-#390(44)&#8230;<\/span><br \/>\n<span style=\"font-style: italic;\">MsgBox UA.MarketSymbol + &#8221; : &#8221; + UA.Exchange + &#8221; : &#8221; + UA.MarketName<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> You would use <span style=\"font-style: italic;\">RetrieveContract<\/span> or <span style=\"font-style: italic;\">RetrieveSnapshot<\/span> for these but specify<br \/>\n&#8220;54&#8221; as the delivery month. Kind of non-standard but that&#8217;s our cash code<br \/>\nhere at CSI.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: We are using the CSI API2 to extract daily options on futures prices. Our &#8216;C&#8217; program uses your OLE interface and is very similar to your example &#8216;C&#8217; code for retrieving option prices. Unfortunately, it takes 4 &#8211; 10 seconds to extract prices for a single option both from the API and using the UA application.<\/span><br \/>\n<span style=\"font-weight: bold;\">A single futures market, CL, currently has 3169 active options. It takes about 6 hours to retrieve prices for these options. We have 50 additional futures markets that we need option prices, so the total time required exceeds 1 day. This makes it impossible to have option prices for all markets available on a daily basis.<\/span><br \/>\n<span style=\"font-weight: bold;\">This seems very high for a process that I assumed would be IO bound.<\/span><br \/>\n<span style=\"font-weight: bold;\">We have a critical need to get daily options prices in a reasonable amount of time. Can you give us a faster way to extract daily prices?<\/span><\/p>\n<p>Answer: We recommend using RetrieveSnapshot when accessing option data, as you have seen, the other method is not practical.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: This is the typical way to get data from a symbol:<\/span><\/p>\n<p><span style=\"font-style: italic;\">7. symbol = &#8220;AMRI&#8221;<\/span><br \/>\n<span style=\"font-style: italic;\">8. UA.MarketSymbol = symbol<\/span><br \/>\n<span style=\"font-style: italic;\">10. MarketNumber = UA.FindMarketNumber()<\/span><br \/>\n<span style=\"font-style: italic;\">11. UA.MarketNumber = MarketNumber<\/span><br \/>\n<span style=\"font-style: italic;\">12. ErrNo = UA.GetMarketProfile()<\/span><br \/>\netc, etc.<\/p>\n<p>However, <span style=\"text-decoration: underline;\">AMRI<\/span> is a symbol name that has been reused and thus exists twice in the DB. CSI API will return a handle to the FIRST one. Now, what is the easiest way to get ALL the handles one by one for symbol &#8220;<span style=\"font-style: italic;\">AMRI<\/span>&#8220;?<\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> In this unfortunate case, you may need to depend in our csi numbers, which are available in the factsheet. You can look up the ones you&#8217;re interested in, or iterate through them.<\/p>\n<\/div>\n<div>\n<hr class=\"styled-hr\" style=\"width: 100%;\" \/>\n<\/div>\n<div class=\"paragraph editable-text\" style=\"text-align: left;\">\n<p><span style=\"font-weight: bold;\">Question: I am needing to make a decision about using the API or pulling the data for stocks, futures, spot etc. from the CSI folders as ASCII. We need to pull the data into a database for processing. Some continuous futures contracts will be required. The guys at CSI did not know if continuous futures contracts would have to be built on each call from the API.<\/span><br \/>\n<span style=\"font-weight: bold;\">I wanted to ask you if:<\/span><br \/>\n<span style=\"font-weight: bold;\">1) Is it better to pull data from the ASCII files and use UA to generate them or use the API, and, if API is the better method,<\/span><br \/>\n<span style=\"font-weight: bold;\">2) you are available for building this for me, or if it is better to have my programmer start from scratch with the API.<\/span><br \/>\n<span style=\"font-weight: bold;\">I figured much of this has already been written, but the guys at CSI said the only thing they have available is the API doc.<\/span><\/p>\n<p><span style=\"font-weight: bold;\">Answer:<\/span> Continuous contracts are rebuilt on every API call. A mechanism can be made to get around this, by first updating the database, and then parsing the update log to see if either a) correction has been posted to the market(s) you&#8217;re tracking or b) a roll has occurred. Then you would call to rebuild, otherwise you can call RetrieveSnaphot to obtain the last day of data.<br \/>\nSome customers are doing this from their software, and their are cases where it&#8217;s sensible, but I think in your case it may be easier to just update a portfolio and then have your software read those files, you&#8217;ll still need to read the whole file into your database, as continuous<br \/>\ncontract data does change back in time, at least back-adjusted ones do.<br \/>\nWe do have several example programs that use the API located under your ua\\API folder. The API is fairly straight forward, your programmer can always request my assistance if you choose<br \/>\nto go that way.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Question: I have been using a piece of software called FDC that interefaces with CSI&#8217;s API to access the data for neary four years now with out any problems. I recently purchased a new laptop with the Windows 7 Ultimate OS (64 bit) on it.\u00a0 On this computer the FDC software is not able to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":625,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/pages\/461"}],"collection":[{"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csidata.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=461"}],"version-history":[{"count":6,"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/pages\/461\/revisions"}],"predecessor-version":[{"id":464,"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/pages\/461\/revisions\/464"}],"up":[{"embeddable":true,"href":"https:\/\/www.csidata.com\/index.php?rest_route=\/wp\/v2\/pages\/625"}],"wp:attachment":[{"href":"https:\/\/www.csidata.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}