Issue compiling a translated scanner script with AddScanColumn
Author: denoving
Creation Date: 9/9/2012 11:30 PM
profile picture

denoving

#1
Hi: I was attempting to compile this (below) script, and I got
the following message.....


error CSA1022 @(84,1): Type or namespace definition, or end-of-file expected

What do I need to do to get the script to compile, and also...

The addscancolumn capability was very useful. is there a way to get that or an
equivalent capability with WL6 ?

Thanks in advance for any help you can offer.

Regards,
Dan

CODE:
Please log in to see this code.
profile picture

Eugene

#2
AddScanColumn is not supported in WL5/6. The only you can do is comment it out like you did.

Likewise, LinearRegPredictSeries is not available in WL5/6 and will not compile. Furthermore, it should not be used in scripts because it was designed only for PerfScript use (script-driven, tabular "performance visualizers" in WL3/4) and creates a peeking into the future effect.

After fixing these, google the CS1012 error and follow what MSDN suggests. Every compiler error message gets documented there, and this one's pretty easy:

Compiler Error CS1022

P.S. I added it to the FAQ | "Missing" features.
profile picture

denoving

#3
re: addscancolumn.....is it possible to write a text file output with data instead?

I am SOOOOOOOOOOOOOOOOOOOOOOOOO frustrated with trying to do anything
with C#. The main problem is I don't get C# and I don't get OOP.

I've used a dozen different programming languages over the trailing
40 years, and never had any problems with any of those, but none of this
makes ANY SENSE.

I've got to think that it's possible to do things in C#, but I couldn't prove
it to anybody.

how do you do subroutines in C#?

how do you do function calls in C#?

What part is "main"?

What's the meaning of {}, and when do you use ; ?

How does logic work in C# SUCH AS if, then, else, for, do while do until, etc.

Don't you have an example program where all of this stuff is used at least once
somewhere on the website to use as a reference?

I tried to use the F11 reference for a buyatmarket, but it's based on WL3/4,
and that doesn't work on WL6 as you know.

Thanks. SOrry I'm so frustrated. Is there a good place to learn about OOP?
profile picture

Eugene

#4
I can understand your frustration. It's like being thrown into the water w/o a crash course in swimming. Don't try fixing WealthScript Translator output at this stage. Check out this FAQ, start with some C# 101:

How do I start with C# ?

All questions above will be solved by any entry level book and/or tutorial.
profile picture

Eugene

#5
QUOTE:
re: addscancolumn.....is it possible to write a text file output with data instead?

Sure, we've got many code examples found by searching the forums.
profile picture

Eugene

#6
You should throw away this script. It's peeking into the future, being based on wrong assumption that LinearRegPredictSeries can be used in scripts/scans.
profile picture

denoving

#7
could you point me to an example of where some kind of data about a stock, say a
stock price is being written to a .csv file with the stock name, so for example
you run the script on the dow 30 and a .csv file is written to "my documents" that
has 1 column of the dow 30 tickers and 1 column of the closing price for bar-1 ?
profile picture

Eugene

#8
profile picture

denoving

#9
Thanks for your help.

I'll study this.

I was thinking about a text file. This is about an excel file. But I could make that work ok probably.

regards,
Dan
profile picture

Eugene

#10
This is a comma-separated plain text ASCII file. Its format definition (i.e. what goes into the file) is up to you.
profile picture

denoving

#11
That should work ok. Thanks for your help.

regards,
Dan
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).