Percentage of stocks above Hull MA
Author: Harapa
Creation Date: 12/8/2019 9:35 PM
profile picture

Harapa

#1
Which format for ' Binary Series' is right?
CODE:
Please log in to see this code.

or
CODE:
Please log in to see this code.


In my hand, both formats works.
profile picture

Harapa

#2
Here is the real issue.
I want to plot an output showing % stocks above 5/13 TD using Hull MA. I first tried Index lab and Price/Indicator cross over using HullMA as indicator. This didn't produce any output "invalid Indicator Settings". So to work around I created the desired out put in a strategy. Surprisingly this strategy yield an out put similar for two time frames. Any help to fix will be greatly appreciated.
Note the strategy shown here is abbreviated to show the setup for the two output and out put for full length strategy is attached.
Not to confuse the issue,same setup works fine with a list of 35 stocks!
CODE:
Please log in to see this code.
profile picture

Cone

#3
Here's a template you can use to create that percent indicator and save it to global memory. Then you can just GetGlobal to access it from another script. If you're using Norgate Data for backtests with real historical watchlists, let me know... there's more work to do if that's the case.

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

Eugene

#4
Re: your real issue aside, here's a tip on forum search. Often times questions have been discussed before and answers can be found as you type by entering a few keywords in the "Search Forum..." text box. Like "Binary" for example:

Transform DataSeries into binary
Kaufman's Adaptive Moving Average Binary Wave
Binary (intermarket) trading strategy

The key is to make a good search query with correct keywords. As "Coding help" was a suboptimal choice of topic title (too general), I've renamed it to "Coding Binary DataSeries".
profile picture

Harapa

#5
QUOTE:
The key is to make a good search query with correct keywords.


Question was posted after exhausting the search option including term like 'Binary'.
None of the above links (which I had looked before posting the original question) offer a clarification or show a line that can help answer the original question. A clear answer will make this conversation a good reference for the future.


Cone,
Thanks for the help, I will give it a try. I am not using Northgate data. Mine is either WL or Fidelity.
profile picture

Harapa

#6
Cone,
How do I invoke "GetGlobal" in a script ?

And here is another solution (inspired by your snippet) that does the job. It can be adapted to any available MA type.

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

Eugene

#7
QUOTE:
How do I invoke "GetGlobal" in a script ?

You'll find this questions answered in the QuickRef tool.
profile picture

Harapa

#8
Got it. Thanks Eugene.
Though I am good for now using either Cone's or my solution. I remain interested in knowing the correct format for the Binary Series data set creation (my original question). I have used this type of routine many times before without a problem, so I am trying to find a reason for it not functioning as desired this time.
profile picture

Eugene

#9
Could you clarify what is "the Binary Series DataSet"?
profile picture

Harapa

#10
I meant creating a DataSeries using 'Binary Series' as is being done in my 2nd code example.
eg.
CODE:
Please log in to see this code.
profile picture

Eugene

#11
Answering your post #1:
QUOTE:
In my hand, both formats works.

Each DataSeries must have a unique description to prevent caching errors hard to catch in troubleshooting.

P.S. I've been very busy to warn you about posting very different questions (a general question re: DataSeries description and creating a very specific Strategy) to one forum thread, sorry. This is bad for forum management. "One question one topic" works much better. Please follow it.

P.P.S. Upon review, neither the DataSeries description nor "binary DataSeries" are good as the topic's title. The former has a link too weak to the question which is creating the specific code logic. The latter is just plain confusing. You're not creating no "binary DataSeries" at all as we mean it (i.e.see links in post #4). Renamed again.
profile picture

Harapa

#12
Update:
Giving unique description to each data series as shown below fixed the problem in code posted in post #2. So in post #1 correct input format is the 2nd one
CODE:
Please log in to see this code.

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