Buy at limit at a close price multiple
Author: mike5
Creation Date: 12/7/2009 2:32 PM
profile picture

mike5

#1
I am very new to WLP. I have been building some strategies from the rules to get an idea of how it all works. I have been viewing the strategies as code to help me understand it. In a strategy I'm using the rule "buy at limit". The code for that is:

{
BuyAtLimit(bar + 1, Close[bar], "Group1|");
}

I'd like to change it so that rather than buying at the Close price on the next bar, it will buy at a 5% discount to the Close price as a limit. Is there anyone who can tell me how to alter the previous code so that it will perform that calculation? Or is there a section of the Help site that someone can direct me to so that I can look it up for myself? Thanks for your time.
profile picture

Eugene

#2
Welcome aboard, Mike.

You need to simply multiply the value by 0.95 in this case, for example:
CODE:
Please log in to see this code.
profile picture

mike5

#3
Thank you Eugene. Is there someplace I can learn more about using the code? I feel guilty just coming in here and asking dumb questions. I don't mind learning it myself, but I don't know where I can do that.
profile picture

Eugene

#4
Start by reading this FAQ "How do I start with C# ?" and "I'm a Wealth-Lab 3/4 user, how to learn C# ?" (scroll down the page). Please feel free to ask any additional questions.
profile picture

mike5

#5
Thanks again, I'll get on it.
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).