Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
This is a very simple strategy that will export the OHLC to a text file. The file path is hard coded because I was lazy and wrote this a long time ago, so open the code and change it or it won't work for you.
While you're in there, you'll see it is …
I have a question regarding this code. I appreciate the effort you have put into this and had no problem setting this up but I was hoping you could answer a question for me.
As the data is stored in a .txt file do you have any suggestions as to how I could access this file and use the data within Excel in real-time for further analysis?
The closest I did personally was with my MySQL project, I was writing tick-by-tick data from Ninja to my MySQL server, and then ran queries from Excel.
But it is far more complex.
You should try asking Hapster, he has a very extensive Excel spreadsheet he trades from, and I feel certain he has incorporated a live data feed.
Incorporating real-time data to Excel from NT is not really NT job, their is no good way to do this.
This is the job of the data feed itself, adding some layers (NT here) between the feed and Excel is not a good idea.
With the IB API, there is an Excel sheet, with DDE stuff, and you can have real-times quotes, position, etc, etc.
Mike, your forum is amazing. This morning I decided to try to export data from NT into text files so I could work on coding simple patterns into TS in order to do easy P-L analysis. I find the NT strategy writing and analysis interface too hard at this point.
I just could not find a way to open any of the txt files in TS2000i which itself is tricky with that stuff. So I come on your forum and bingo, there is a solution.
BUT: I cannot get the hours to separate from the seconds. The NT way of exporting it blends date hours minutes seconds into one cell. Fine, I split it. But then it tracks minutes with seconds which TS cannot handle.
So your code is perfect. Just hours and minutes. But it separates hours and minutes which TS cannot handle. It just want 0734 for 734 am.
So I take your original line for logprefix and get rid of the comma between the hours and minutes but this is what it prints out:
Here is the altered line from your code:
string logprefix = Time[0].Month.ToString("00") + "/" + Time[0].Day.ToString("00") + "/" + Time[0].Year + ", " + Time[0].Hour.ToString("00") + Time[0].Minute.ToString("00") + ", ";
I cannot for the life of me see why it keeps putting in the comma. I closed down strategy analyser, loaded different instrument, different strategies, then put barclose back in but still spits out the commas between hours and seconds despite the code not telling it to.
Any suggestions?
Buy a new computer to clear the cache?
Start over next week after installation of new OS?
BM. Apologies. I didn't realise that it was only appending to existing file so in fact it was working fine.
I have spent a while looking for how to tell it to first erase all previous data before appending but can't find the lingo. Could you please tell me what to write in first to get it to flush out the earlier stuff then start again any time the strat is run?