Global Variables?
Author: Carova
Creation Date: 5/19/2015 12:03 PM
profile picture

Carova

#1
Is there something equivalent to the global variables that existed in WLD4? I could not find anything in the Help files or on the Forum.

I would like to count all of the days that all of the stocks in a watchlist meet a certain set of requirements over the past 60 days, and without a global variable capability I do not see a way to address it.

Any Ideas?

Vince
profile picture

Eugene

#2
QUOTE:
I would like to count all of the days that all of the stocks in a watchlist meet a certain set of requirements over the past 60 days, and without a global variable capability I do not see a way to address it.


Fortunately, your task may not require the added complexity of global variables at all. The key is looping by DataSetSymbols:

Number of stocks up a certain percentage over a period
Number of stocks above their moving average for N periods

If it's a simple price/indicator/fundamental-based condition to be run before the main loop, you're lucky. If it's some Position-based criteria, the technique won't apply.

QUOTE:
Is there something equivalent to the global variables that existed in WLD4? I could not find anything in the Help files or on the Forum.

Sure they exist if you look up in the QuickRef:

Global data?

More examples:

Passing indicator/bar data between Streaming Strategies via files
WealthScript Techniques | Access Data from the Internet on-the-fly
SetGlobal, GetGlobal from DLL
profile picture

Carova

#3
Thanks Eugene!

BTW, I did a search in the User Guide and The Programming Guide. I mistakenly thought that all of the items in QuickRef would be in those two help files. Obviously not!

Vince
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).