I'm using the COM API to get market cap for a stock. I want weekly data rather than daily data.
When I make the following call, I can get all of the daily data.
Step3_CreateRData("MSFT.O", "TR.CompanyMarketCap(Scale=6)", "SDate=0 EDate=-100", "RH:Date CH:Fd");
Step4_RequestDex2Data();
But, if I change it to the following in order to get a weekly data series. I get the error "Invalid name of display parameter"
Step3_CreateRData("MSFT.O", "TR.CompanyMarketCap(Scale=6)", "SDate=0 EDate=-100", "FRQ:W RH:Date CH:Fd");
Step4_RequestDex2Data();
Also note that the following works in Excel just fine
=@TR("MSFT.O","TR.CompanyMarketCap","SDate=0 EDate=-100 Frq=W CH=Fd RH=Date",L22)
How do I get weekly market cap data instead of daily?
Many thanks in advance!
Robby
Here is the code for my two methods. It fails on the call to Step4_RequestDex2Data()
public void Step4_RequestDex2Data()
{
//Send the RData request to Dex2
if (MyRData != null)
MyRData.Subscribe(); // FAILS HERE
}
public void Step3_CreateRData(String instrumentsList, String fieldsList, String requestParametersList, String displayParametersList)
{
returnedText = "";
CreateRData(instrumentsList, fieldsList, requestParametersList, displayParametersList);
}
private void CreateRData(string InstrumentIDList,
string FieldList,
string RequestParam,
string DisplayParam)
{
// Create a RData
MyRData = MyDex2Mgr.CreateRData(MyDex2Cookie);
MyRData.OnUpdate += OnUpdate;
// Initialize the RData to request
if (MyRData != null)
{
MyRData.InstrumentIDList = InstrumentIDList;
MyRData.FieldList = FieldList;
MyRData.RequestParam = RequestParam;
MyRData.DisplayParam = DisplayParam;
}
}