Rules: %K Crossing %D By a Defined Amount
Author: pestocat2
Creation Date: 4/13/2018 5:03 PM
profile picture

pestocat2

#1
I'm looking for a condition where %K crosses %D and also by a defined amount. Is this something I need to program.
profile picture

Eugene

#2
Yes. However, it's really easy to get the basic condition working in Strategy from Rules first and then convert it to code to add the missing piece e.g.

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

pestocat2

#3
Eugene,
I'm new to Wealth Lab. It's easy to get the crossing condition, but not sure how to get the amount that %K has crossed %D. Thank you.
profile picture

Eugene

#4
Gary, it's here:
CODE:
Please log in to see this code.


Here's how you can control it via "parameter slider" at the bottom left of your WLP workspace. Just drag "Amount":

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

pestocat2

#5
Thank you again, Eugene. I printed the Programming manual and so will get to know this process better.
Have a good weekend,
Gary
profile picture

Eugene

#6
You're welcome.
profile picture

superticker

#7
QUOTE:
looking for a condition where %K crosses %D and also by a defined amount
A "defined amount" relative to what? Relative to its previous value (which is the solution given in post #4) or relative to the two indicators, %K and %D? If you want the latter, then just add or subtract amount to one of the DataSeries indicators.
CODE:
Please log in to see this code.