Trailing Stop Buy Entry Rule
Author: billrt
Creation Date: 1/18/2019 1:31 PM
profile picture

billrt

#1
Need a Trailing Stop Buy Entry Rule, Anyone have one?

Trailing Stop Cover does not Enter. Fidelity allows an order to buy with a trailing stop.

I want to test a strategy for an Auto trading scheme.

Any help would be appreciated.

-billrt


profile picture

Eugene

#2
I think there's some confusion. What kind of "trailing stop buy" do you need, how does it work? There are existing entry rules to buy at ATR or Channel stop, for example.
profile picture

billrt

#3
It is a BUY order based on a Trailing Stop. if the price goes up $10 from the last lowest close- trailing, a Buy executes.

Sorry, if I'm not expressing the terms correctly.

-billrt

profile picture

billrt

#4
Tried Both ATR & Channel Stop, neither allow for a dollar based trailing stop.

-billrt
profile picture

Eugene

#5
No existing rule or condition implements your idea exactly. Let's see if a quick & dirty solution is available:

1. One approximation can be found under "Price (or Volume) Action", called "Price is higher by $ than it was a number of bars ago", but it doesn't consider a lowest N-period close - just a head to head price comparison.

2. Another and more closely matching option might be to use "Price crosses X% above Indicator" (from "General Indicators" group). Choose "NRTR_Percent" (Bars, X% e.g. 10%) from Community Indicators as the "Indicator" and enter 0 (or more) as the "Percent". The catch is that this is a percent- (not dollar-based) trailing reverse indicator which at the same time makes it slightly more adaptive to the stock price.

I'd suggest you give #2 a try. Also, drop the NRTR% indicator onto a chart to visualize the trailing X% reversals from the lowest/highest price.

In TASCIndicators v2019.02 (not yet released) we're going to have a seemingly perfect match: an extension of SVEHLZZperc indicator to accept Point values. A crossover of price with such indicator would mean that the price went up $X from the lowest N-period low (close etc).
profile picture

Eugene

#6
To make it easier for you, I've added the requested rules to the Community.Rules library. Log in to the Wiki with your account and follow installation instructions. You'll find "Buy (Short) at point based Trailing Stop" under "Trailing Stops".
profile picture

billrt

#7
Thank you, Eugene.

There is a typo in the code "Valued".
I fixed it in the code, so it runs, but I can't change it in the rule.

Playing with Period & Points.

-billrt
profile picture

Eugene

#8
Hmm, there is simply no "Valued" string in the new rule's code. How can I reproduce what you're seeing? Step by step please.
profile picture

billrt

#9
1. Open Strategy
2. New Rule Based Strategy
3. Trailing Stops
4. Drag, 'Buy at point based Trailing Stop'
5. Drag 'Sell at dollar based Trailing Stop'
6. Click on 'Period' & 'Points' sliders

See error box pop up, click 'Open Code in new Strategy Window'.

'Valued' found in last line of code.
profile picture

billrt

#10
The 'Points' and 'Period' of your new Rule are too complicated for my use.

Just need a Buy Rule that behaves like a Fidelity Trade Order...
Choose Trade, Buy, Type-Trailing Stop $, Trail Amt.
It will trail the price, then execute the Buy order at the trailing Stop.

No 'Points', no 'Period'.
profile picture

Eugene

#11
QUOTE:
'Valued' found in last line of code.

Thanks I see: it's the parameter exposing that makes difference. Fixed. Please download the updated library.

QUOTE:
No 'Points', no 'Period'.

:D What a "Holy Grail" magic button!

1. Period is used to determine the lowest low: it may be OK to look at yesterday's Low for you but what if another user's trading horizon is not that short-term?
2. Points is the "dollar"-based trailing amount (points from the X-period lowest low).

So it might still make limited sense without the 'Period' for your use but without 'Points' it cannot function technically.

QUOTE:
The 'Points' and 'Period' of your new Rule are too complicated for my use.

I have never seen that Fidelity trade order but to my mind, I've correctly implemented your request. And hopefully others may make use of these new rules, too. Before we introduce a feature we try to evaluate if it would be universal or single-user feature.
profile picture

billrt

#12
Thank you for your help.

FYI, I have attached a Fidelity Trade Order, used by thousands, everyday.

The 'Period' starts when the order is placed, based on Last.

How do I specify the 'Period' starting now?


Thanks again for your effort.
profile picture

Eugene

#13
Thanks. IMHO the closest thing to 'starting now' is Period = 1 i.e. 1-period lowest Low.
profile picture

billrt

#14
Still get Strategy Parameter error when Slider is selected.

I apologize for not being clear in my request for help.


1. I want to use WLP to paper trade.
2. I want to enter the trade with the trade order attached above.
3. Could you please help me get started ?

Step by step, please.
profile picture

Eugene

#15
I've double checked and the error is no longer there. Like I said above, please download the updated library, replace the file as instructed, and recreate your Strategy from Rules.

For step by step instructions on getting started kindly refer to the Wealth-Lab User Guide.
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).