Adding Position.Priority
Author: Carloseta
Creation Date: 9/13/2009 11:45 AM
profile picture

Carloseta

#1
This is a simple script that looks back 6 months to screen for a higher price.
I need to find the top performing stocks for the period.
I was able to do it using /SetPositionPriority/ in Wealth lab 4 but I can't find a way to do it in 5.4

Any suggestions?
CODE:
Please log in to see this code.


profile picture

Eugene

#2
QUOTE:
I was able to do it using /SetPositionPriority/ in Wealth lab 4 but I can't find a way to do it in 5.4

Hint: Hit F11 for the QuickRef tool, type in Priority to see how have SetPositionPriority transformed in WL5. In pseudocode:
CODE:
Please log in to see this code.
profile picture

Carloseta

#3
Where do I add this and what is the correct identifier

Thanks
profile picture

Eugene

#4
It was meant to be a drop-in replacement for your string starting with "BuyAtClose..."

For more details and a complete code example, see the QuickRef tool.
profile picture

dansmo

#5
I´d like to give my positions a certain priority criteria. However, I get these messages:
QUOTE:
Error processing symbol TKA GY Object reference not set to an instance of an object.
Error processing symbol VOW3 GY Object reference not set to an instance of an object.


This is the code:
CODE:
Please log in to see this code.


What am I doing wrong?
profile picture

Eugene

#6
To quote the Wiki FAQ on "Object reference not set to an instance of an object":
QUOTE:
Note: this is a pretty multifaceted error message - it can happen outside of a Strategy. But should you experience the run-time error in your Strategy telling you that "Object reference not set to an instance of an object", you need to know that there's a variable that has not been initialized, in other words it's null. Either you haven't assigned a value to some variable, or a method/function that you called has set the variable to null.

It's a too generalized error, and chances are the Priority is out of question; I suggest creating a new topic.
profile picture

dansmo

#7
This error is only happening when I enable the line
CODE:
Please log in to see this code.
profile picture

Eugene

#8
...and it is being enabled incorrectly. Should be:
CODE:
Please log in to see this code.
profile picture

dansmo

#9
OIC, that makes sense.
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).