Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Importing Data Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
wickew
Posted : Tuesday, August 16, 2011 5:58:00 PM
Registered User
Joined: 3/6/2010
Posts: 3
Hey, I am trying to backtest an indicator that I have created from an excel file. How would I import this data into Stockfinder and backtest it. Thank you very much for the help.
Bruce_L
Posted : Wednesday, August 17, 2011 8:17:21 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
There isn't a way to actually import external data, but StockFinder has the ability to Plot external CSV data contained in a text file.

Market Data Reader Overview
RealCode File Reader Overview

The blogs containing the examples no longer exist. That said, the Minutes Data is incomplete topic contains both an example file and a RealCode Indicator which can display its contents in StockFinder.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
Posted : Wednesday, August 17, 2011 2:23:20 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

QUOTE (Bruce_L)
There isn't a way to actually import external data, but StockFinder has the ability to Plot external CSV data contained in a text file.

Interesting ... I either didn't know (or had long forgotten) that StockFinder can plot external data from a text file.

I learn something new every day in these forums.

Mike From Philly
Posted : Wednesday, August 24, 2011 8:56:52 AM
Registered User
Joined: 9/18/2009
Posts: 60
Is there a way to import daily stock info (high, low, open, close, vol.) and have it added to a chart?
 
Specifically, Yahoo has historic price data going back a long long time. In the Dow's case: 1928. I'd like to suck in that data and have my DJ-30 daily chart use that data until 2004 where SF has the data in its system (I'm a gold user - although I'm the only guy in the US doesn't own any gold).
 
In addition, I'd like to capture the data from yahoo for stocks that disappear whether through bankruptcy or buyouts so that those charts are available in the future for study.

Thanks,
Mike
Bruce_L
Posted : Wednesday, August 24, 2011 8:58:08 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You can't import data.

You can display data. You would need to review the references in my Wednesday, August 17, 2011 8:17:21 AM ET post to learn how.

If you try those techniques and can't get them to work, I can look at your RealCode and try to help you, but there are no guarantees you will be able to do what you want.

An important part of the distinction between being able to import data and display data is that you cannot actually create artificial symbols which are treated like symbols by StockFinder. While you can plot the price data for symbols which are not included in StockFinder, the resulting plot is an indicator, not a symbol.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Mike From Philly
Posted : Wednesday, August 24, 2011 9:38:56 AM
Registered User
Joined: 9/18/2009
Posts: 60
Is it possible to do an indicator in candle stick fashion (O,H,L,C)? I've only done lines.Thanks,Mike
Bruce_L
Posted : Wednesday, August 24, 2011 9:40:37 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Yes it is possible to create an Indicator with Open, High, Low and Close data. The references in my Wednesday, August 17, 2011 8:17:21 AM ET post actually contain examples of this.

The basic format for this using the AutoLoop in the Code tab would be something like:

OpenValue = Price.Open
HighValue = Price.High
LowValue = Price.Low
Plot = Price.Last

While using AddToOutput in the Class tab with AutoLoop = False might look like (there would be other RealCode needed to support this fragment):

For i = 0 to Price.Bar.Count - 1
      AddToOuput(Price.Bar.DateValue(i), _
      Price.Bar.OpenValue(i), _
      Price.Bar.HighValue(i), _
      Price.Bar.LowValue(i), _
      Price.Bar.Value(i))
Next

In both cases, you would just be re-outputting Price.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Mike From Philly
Posted : Wednesday, August 24, 2011 7:00:02 PM
Registered User
Joined: 9/18/2009
Posts: 60
Thank you. I watched the videos but didn't look at the post. I'll try this this weekend.
Mike From Philly
Posted : Saturday, August 27, 2011 9:28:32 PM
Registered User
Joined: 9/18/2009
Posts: 60

Amazingly, I got it to work.  

Is there a reason why the daily candles before 9/13/2003 are not being affected/colored by my up bar condition? The condition works from 9/14/2003 to the present. 

BTW - Here's my program:


'# Cumulative
Dim reader As New RealCodeFileReader(currentsymbol & ".csv")
Try
 reader.open
 While reader.EndOfFile = False
  Dim Line As String = reader.readline
  Dim Values() As String = line.Split(",")
  AddToOutput(Me.EndOfDay(values(0)), Values(1), Values(2), Values(3), Values(4))
 End While
    
Catch
Finally
 reader.close   
End Try


Bruce_L
Posted : Monday, August 29, 2011 10:15:09 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
What are your current Number of Bars settings under Settings | Data Manager?

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Mike From Philly
Posted : Monday, August 29, 2011 7:01:34 PM
Registered User
Joined: 9/18/2009
Posts: 60
2,000. The box says 5,000 is the maximum. Is there a workaround? Any chance we could get a 100 years of daily bars?
Bruce_L
Posted : Tuesday, August 30, 2011 7:23:18 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
So when you changed it to 5000 bars, you got more bars painted? If so, you may be able to get around the 5000 bar limit with the Length Limit Block (but maybe not).

If you left-click on Price History to bring up its Edit window and select Block Diagram, there should be Block called Prices. This Block should have an unconnected Output Limit input. If you left-click and Drag on this input, you can select Select Block & Connect | Parameter: Length Limit to add an option for the number of Bars of data used for the Price History Indicator.

This will allow you to exceed the 5000 Bar Limit, but you will generally need to adjust the Block Diagrams of any Indicators with Price or Volume Blocks in them individually.

That said, the 5000 Bar Limit is there for a reason. It should be strongly noted that this can dramatically affect the performance of StockFinder and slow things down significantly because of the additional memory used and calculations required. If things slow down too much, the first thing you should try is to decrease the Length Limit or avoid using this workaround altogether.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Mike From Philly
Posted : Tuesday, August 30, 2011 8:36:36 PM
Registered User
Joined: 9/18/2009
Posts: 60
I tried changing the limit in blocks without success.  I didn't try too hard though.  I feel very lucky to get the DataReader to work and didn't want to push my luck.    

The DataReader, even with its 1980's uni-color, is helping me study past market cycles.  Last night,  I was studying the Dow back in the 1929-32 period .   I was sweating in fear as I scrolled through it on a daily basis and thinking about my buy/sell moves.  It was a scary plunge.  Here's a screen capture of that time.

http://screencast.com/t/igv37rh1d

Thank you for the help with this and all of my past questions.  I love SF5!  SF5 is a powerful tool.


BobMc
Posted : Wednesday, August 31, 2011 11:46:43 AM
Registered User
Joined: 10/7/2004
Posts: 816
Nice chart Mike.

That must have taken a lot of effort.

Regards
BobMc
Mike From Philly
Posted : Wednesday, August 31, 2011 6:17:16 PM
Registered User
Joined: 9/18/2009
Posts: 60

Bob, its really easy once the DataReader program is setup.    Yahoo has a link where you can download historic prices.   Download the data and clean it up 3 ways .... 1) delete the title row, 2) delete the volume column, 3) sort the data so that the old data is on top.  Save the file with the symbol name in the Data directory and as a csv file.   If you do this enough times, it is a 1 minute drill.

Here is a where to look on the yahoo page for the data:

http://screencast.com/t/k2Rdp79Kfov4

BobMc
Posted : Wednesday, August 31, 2011 7:32:18 PM
Registered User
Joined: 10/7/2004
Posts: 816
Thanks Mike

Regards
BobMc
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.