"BuyAtTrailingStop"?
Author: wombat04
Creation Date: 10/22/2011 6:54 PM
profile picture

wombat04

#1
Hi everyone,

I'm a newbie to WL (downloaded the trial) and just trying to get my feet wet by coding a simple strategy. To start off with, I'd just like to repeat the following steps:

(1) Buy a stock with a trailing stop limit as a percentage, a trade that Fidelity allows. For the initial purchase, it could be a limit based off market open. For argument's sake, let's say I want to create a buy at trailing stop limit order once the stock drops 3%. (Bear in mind that I do NOT mean 3% in a single bar, as WL seems to mean it, but 3% over whatever time period has passed since the initial condition was set.

(2) Put in a condition that puts in the sell at trailing stop limit only after a condition has been met. Let's say, in this case, that the condition is that the current price be 5% higher than entry.

(3) Execute a sell at trailing stop limit order that is set at, for example, 2%. Again, I mean a trailing limit order in the sense that Fidelity means it -- good 'til canceled, not for just the particular bar I'm currently on.

(4) Loop back to (1) to buy once again with a trailing stop limit once we've "dropped enough"... say again, 3%.

Am I missing some obvious logic somewhere? This seems like a very simple strategy, but I can't figure out how to do it for the life of me in WL.

Thanks in advance!

Wombat04
profile picture

Eugene

#2
Welcome to the forums E F,
QUOTE:
(Bear in mind that I do NOT mean 3% in a single bar, as WL seems to mean it, but 3% over whatever time period has passed since the initial condition was set.

To imitate such conditions, a technique featured in this KB article will certainly help:

Tutorial: Setups, Triggers, Delays, and Timeouts
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).