In the forum there are several posts re Excel automation, seems that for one or the other reason we all use good old Excel for either debugging purposes, import of data, or interaction with excel number crunching....
As up to my knowledge there has been little shared knowledge so far, here a script that shows some automation using the standard Excel COM functionality, e.g. new file, write, read, chart, close, etc.
"Excel_Com_Demonstration.azf" on http://drive.google.com/folderview?id=0B2nAWp8wo_B6eXpPcVYxVXRSOXc&usp=sharing
See instructions for usage in script.
I'd suggest that either QS or we, the community, develop some further standard classes / functions in QS for the basic interactions with Excel, so we can use in basic and special AMM / Chart and Simulation scripts more easily..
Alexander - Just wanted to say thanks for posting this. I'd love to contribute to classes / standard functions, but don't currently have the C# skills. That said, if there are things that would be of value to me as well as the community, I'd be willing to pay to have things coded.
I currently don't have a clear vision of how I'd use the Excel integration. If you have specific ideas of how it might be used, maybe we could start a list and see what applications would have broad appeal.
thanks for taking this up and improving my laymen code example! Let's see if somebody els jumps on the train to further develop.
Excel also accepts range to array / array to range like this, that seems faster and more convenient for large arrays:
Example using your code from blog:
public void FillExcelRange(Excel.Worksheet sheet, string[,] data)
{
Excel.Range range = sheet.get_Range("A1", "A1").get_Resize(data.GetLength(0),data.GetLength(1));
range.Value2 = data;
}
I wish if I could join this joint development.But my programming knowledge is nil.So Let me provide a link where this programming aspect is explained in simple step ,with a hope that it may help somebody to contribute to this thread meaningfully
In India,No Broker provide Trading Terminal with DDE capabilty and tick data is not available easily.So only mean to get RT tick data to QS is through excel that is connected to TT through RTD.
QS has provided a sample code to retrieve data from excel in last blog
I hope somebody with programming skill may develop it further such that it may replace DDE pluggin
(MICRO SOFT HAS DISCONTINUED DDE)
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.