Trailing stop loss based on External Symbol?
Author: Carova
Creation Date: 3/25/2020 4:29 PM
profile picture

Carova

#1
Is there a way to trigger a trailing stop loss for an Equity Symbol based on an External Symbol, e.g. an Index Symbol? Thanks!

Vince

profile picture

Eugene

#2
Yes, it's possible.
profile picture

Carova

#3
;)

OK, any hints on "How?"

Vince
profile picture

Eugene

#4
How on "what" exactly? Your question lacks any detail or rules. Like question, like answer.
profile picture

Carova

#5
How to use an External Symbol (e.g. the SPX) to trigger a Trailing Stop Loss on an Equity Symbol (e.g. AAPL) in a DataSet?
profile picture

Eugene

#6
No, this doesn't help at all. Care to provide some clear rules of using an external symbol?
profile picture

Carova

#7
OK.

Example: If the SPX Index drops 4% from its recent high at anytime translate that to immediate TrailingStop orders for all positions (as if each of those positions had reached their individual trailing stop). Essentially I want to use the action of this external symbol as a trailing stop for all current positions so that it would be triggered immediately rather than on the next Bar.

Is that a clear enough description? Thanks!

Vince
profile picture

Panache

#8
I'm confused by why you want to use SellAtTrailingStop.

In real time, you could program a strategy to tell you to sell based on a partial bar for an external symbol. Is the problem you're trying to get around is that Alerts have to be on bar + 1? If so, just pop a message box up on your screen saying "SELL EVERYTHING".

For back testing you can use SellAtClose on bar, which, if you're planning to trade on partial bar data, in most situations wouldn't be peeking. It won't be completely accurate, because there is no way to know what the price of any other security was at the time the partial bar for the SPX Index reached your 4% threshold. The only thing the bar data tells you is the OHLC. However, using the low for the external symbol and the close for your positions would be the closest approximation I can think of.
profile picture

Eugene

#9
QUOTE:
immediately rather than on the next Bar.

That's a "hidden agenda" question. ;) And no, this will not work. Here's how the process is in Wealth-Lab according to the FAQ:

* A complete bar updates (can be 1-minute, 1-day, etc.)
* Your strategy executes over all the bars in the chart and determines if it wants to trade on the next bar.
** If it doesn't, you don't do anything.
** If it does, you place orders for the next bar and they're worked by your broker. (Process complete).


So, no immediate triggering regardless if external symbol is involved or not. Your strategy will have to issue the trailing stop on the next bar to get an Alert.

QUOTE:
Example: If the SPX Index drops 4% from its recent high

There's no shortage of examples for this kind of task. Here's for instance:

Buy/sell signal using external symbol SPY or .SPX
Enter if another symbol is up for the day
profile picture

Carova

#10
Thanks!

The rationale for my question is that not everyone designs their systems around Daily or Minute bars. Some of us also use Weekly and Monthly timeframes and, as we have seen in past few weeks, the general Market can have very significant moves. I was looking for an approach that would allow me to design and backtest models that would employ a "sell all" before the individual equities stops were hit, thereby preserving more capital.

Well, back to the drawing board!

Vince
profile picture

Eugene

#11
Although it's possible to peek inside the data from a lower time frame (Accessing Intraday data from Daily - but should be equally applicable to Weekly/Daily or Monthly/Hourly pairs, for example), that doesn't affect the Alert generation (re: post #9) and order execution.

You might consider designing your system to operate on the lower bar scale (e.g. Daily) while your logic that makes trading decisions is based on the Weekly/Monthly synchronized DataSeries.
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).