Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Export/Import Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thnkbigr
Posted : Friday, October 29, 2010 1:54:56 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
Bruce,

After running a Market Indicator I like to export the values out to an excel and import it back in as an indicator whenever I need it so I don't have to run the Market Indicator again.

This should save me a lot of time.

How do I do this?
Bruce_L
Posted : Friday, October 29, 2010 2:11:21 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You can export a Custom Index from StockFinder 4 by selecting File | Export Data, checking the desired Indicator and exporting just a single symbol. You will normally need to save this data as a .CSV file from Excel to be able to read it back into StockFinder.

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

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Tuesday, November 2, 2010 8:59:44 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
Bruce,

I just watched thes two videos a few times and I think MarketDataReader should be better for me since I am not doing any sorting and things like that which Kuf was talking about at the end of the RealCodeFileReader video.

I have exported a Custom Index values out to excell and it is under the Export folder in SF and it seems to me its saved as a cvs file. 

Now I need to bring it back to SF and plot it as an indicator.

Here is what I copied from the 1st video but how do I select the cvs folder with the CI values?

<WBIGuid("76b4423a-2bf4-45e0-ac9e-a8ba377a0c6e"),FriendlyName("RealCodeIndicator"),BlockTemplateEmptyMethodOnly()> _

Public partial Class RealCodeIndicator

                Inherits RealCodeIndicator_base

               

                Sub New

                                autoloop = False

                End Sub

    Public Overrides function Plot() as System.Single

                                Dim reader As New MarketDataReader(Me.Currentsymbol & ".csv")

                                reader.dateindex = 0

                                reader.valueindex = 1

                                reader.delimiter = ","

                                reader.convertToEndOfDay = True

                                reader.outputfile(Me)

 

 

 

end function

End Class

Bruce_L
Posted : Wednesday, November 3, 2010 9:34:31 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The MarketDataReader can only read data from the DataFiles folder. So your file must either be directly in this folder or in a sub folder of the DataFiles folder. If it is in the DataFiles folder itself, your current version should work. If it is in a sub folder, the line where you are create the MarketDataReader should be more like the following:

Dim reader As New MarketDataReader("Your Sub Folder Name Here\" & currentsymbol & ".csv")

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, November 3, 2010 10:50:59 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
I don't see DataFiles folder in any of my computers
Bruce_L
Posted : Wednesday, November 3, 2010 10:59:06 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You may need to create it. It will be on the same level as the Export folder:

\StockFinder\(Your Username)\DataFiles\

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, November 3, 2010 2:36:32 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
I created a folder called DataFiles under SF, Username 

Then I saved the excel sheet with the exported data as a .csv file in the DataFiles folder

I copied and pasted the RC above in the class tab and nothing plots 

I am confused bc I know there is only 1 excel sheet in the DataFiles folder and soon I will have many more so how does the code above know which excel to plot.

This is values of a Custom Index that I exported and it has nothing to do with any symbol. After you import it and plot it as an indicator it should plot the same thing as you space bar through symbols. 

Dim reader As New MarketDataReader(Me.Currentsymbol & ".csv")

The excel file is called InTrade Count 6 Months. Don't I have to include that some where so SF knows which file to open.






Bruce_L
Posted : Wednesday, November 3, 2010 2:42:51 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The RealCode in the video assumes you have a file for each symbol named after that symbol and is designed to insert the symbol into the file name.

If the file is just called InTrade Count 6 Months.csv, the line would look like:

Dim reader As New MarketDataReader("InTrade Count 6 Months.csv")

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, November 3, 2010 3:17:07 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
Still no plot

When you export an indicator on line 1 it says Data Export from SF, Line 2 Column A Date, Column B Time, Column C Vaues of teh indicator. Do I have to delete any of that or make any changes to it? 
Bruce_L
Posted : Wednesday, November 3, 2010 4:07:09 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You will want to get rid of that first line if you are using the MarketDataReader. It is only expecting whatever data you specify as being there.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, November 3, 2010 4:50:47 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
Have you tried this on you end bc no matter what I am not getting any plot and it seems I am following your steps 

I tried it on 2 computers and same results 

Nobody at the support desk knows how to do this either

This is what the excel looks like and it is saved as a .csv file in the DataFiles folder  

Date Time Index-InTrade Count 6 Months 
7/1/1997 4:00 PM 148
7/2/1997 4:00 PM 151
7/3/1997 4:00 PM 155
7/7/1997 4:00 PM 162
7/8/1997 4:00 PM 165
7/9/1997 4:00 PM 165
7/10/1997 4:00 PM 166
7/11/1997 4:00 PM 170
7/14/1997 4:00 PM 175


And this is what I have in the class tab of the RC 

<WBIGuid("76b4423a-2bf4-45e0-ac9e-a8ba377a0c6e"),FriendlyName("RealCodeIndicator"),BlockTemplateEmptyMethodOnly()> _
Public partial Class RealCodeIndicator
 Inherits RealCodeIndicator_base
               
 Sub New
  autoloop = False
 End Sub
 Public Overrides function Plot() as System.Single
  Dim reader As New MarketDataReader("InTrade Count 6 Months.csv")
  reader.dateindex = 0
  reader.valueindex = 1
  reader.delimiter = ","
  reader.convertToEndOfDay = True
  reader.outputfile(Me) 

end function
End Class

Sorry for the trouble

Bruce_L
Posted : Wednesday, November 3, 2010 5:00:46 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If I delete the first line of the data file and use a valueindex of 2 (you have the time in the 1 column), it works in SF4 on my computer. Keep in mind that you have to scroll way back to see the data.

Attachments:
InTrade Count 6 Months.csv - 1 KB, downloaded 580 time(s).
InTrade Count 6 Months.sfIndRC - 5 KB, downloaded 721 time(s).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, November 3, 2010 5:12:39 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
It works now 

thanks
thnkbigr
Posted : Wednesday, November 3, 2010 8:34:41 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
This is great 

I don't have to run all of these CI's anymore

Essene
Posted : Friday, November 5, 2010 2:16:42 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 2
Is there a fast and easy way to export Symbol,Open,High,Low,Last,Volume,PercentChange in StockFinder.  Telechart will dump this for all items in about one minute but the Change field is always 0.  I have tried exporting these fields in StockFinder with only 3,500 stocks and it takes over an hour -- far too long to be of any use.  I have also tried to do it with TCDK routines but just don't understand those routines well enough to make it work.  I have searched the web for help -- even looking for a programmer in TCDK -- but have turned up nothing.  The claims that StockFinder operated at machine language speed so far appears to a myth to me.  Thanks for any help you can give.
StockGuy
Posted : Friday, November 5, 2010 4:29:29 PM

Administration

Joined: 9/30/2004
Posts: 9,187
How much history are you exporting?  I just exported the latest day for the US Common Stocks list (6038 symbols) and it took about 15 minutes.
thnkbigr
Posted : Friday, November 5, 2010 4:50:24 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
Bruce,

So far all I have exported is CI's which is the same value no matter which symbol you are on.

I like to export out the Rank indicator for a watchlist of stocks so that going forward I don't have to run the Rank. This is the Block diagram version that ranks the stocks from 0 to 100. 

How do I do this that after I import it back in as I space bar through the symbols the indicator will plot the rank of that stock (Active symbol). This like exporting out the vakues of Stochastics for the symbols in the watchlist, each stock will have diff values.

Many thx
Bruce_L
Posted : Friday, November 5, 2010 4:58:29 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
thnkbigr,
Yes, you are going to need to select Export WatchList and Multiple Files (Per Symbol) when exporting.

That's what the Currentsymbol & ".csv" secion of the original RealCode is for when reading the data.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Essene
Posted : Saturday, November 6, 2010 7:45:28 AM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 2
My need to export Symbol,Open,High,Low,Last,Volume,PercentChange is just for the latest real time quote for analysis in my own programs.  I want something that will do that quickly and, if possible, repeatedly with automation.
StockGuy
Posted : Saturday, November 6, 2010 11:06:16 AM

Administration

Joined: 9/30/2004
Posts: 9,187
We don't have an automated method for exporting the data.  Sounds like you need more of a real time API to stream the data to your programs which we do not offer.
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.