Creating 5.5 series from 4.5 code - error in way I apply PriceClose & Bar
Author: tedclimo
Creation Date: 11/24/2009 4:40 PM
profile picture

tedclimo

#1
I am attempting to create a new series in 5.5. Error msg tells me that I am mistaken in my usage of PRICECLOSE, BAR & BARNUM.
I've searched the programming guide, but can't figure out what I am doing wrong.
Would appreciate some help here. Below, you will find the 4.5 code, the WSTL translation & how far I got in 5.5 before I got stuck.

Here is 4.5 code: --- This works great
CODE:
Please log in to see this code.


Here is WSTL code: --- This also works great
CODE:
Please log in to see this code.


Here is the 5.5 code where I ran into trouble:
It tells me I am using PriceClose, Bar & Barnum incorrectly.
CODE:
Please log in to see this code.


Thanks in advance,
Ted
profile picture

Eugene

#2
There are no PriceClose, PriceOpen and BarNum any more:

PriceClose = Close[bar]
PriceOpen = Open[bar]
BarNum = IntradayBarNumber

Hint: see the WealthScript Guide > DataSeries and in the QuickRef.
profile picture

tedclimo

#3
Thanks Eugene,
I made the substitutions you suggested and all errors vanished.

One question:... Is "(double)Close[Bar]" same thing thing as "Bars.Close[Bar]" ? They both Compile, just want to be sure I used correct one.

Here's the code as it stands now:
CODE:
Please log in to see this code.




Thanks for tips!
Ted
profile picture

Eugene

#4
QUOTE:
One question:... Is "(double)Close[Bar]" same thing thing as "Bars.Close[Bar]" ? They both Compile, just want to be sure I used correct one.

Bingo! I just wanted it to keep it simple.

By the way, you may drop the so called cast i.e. (double) - it's not required here: Close[bar] would be enough.
profile picture

tedclimo

#5
Thank You!
I've managed to get the 5.5 syntax correct all the way thru the Buying loop. Selling loops are proving more challenging, but making progress.
Happy Thanksgiving.
profile picture

dowen

#6
I was looking for an automated way to convert my code and just registered for the 5.5 site. It looks like I am SOL and have to re-write the code. Does anyone have a code converter?
profile picture

Eugene

#7
In the future, please create a new topic, thank you.

The download link is here, scroll down to: Will Wealth-Lab Developer 5.x recognize my chartscripts?
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).