ATP Pivot Point High/Low Indicators
Author: Jammer
Creation Date: 7/14/2008 12:10 AM
profile picture

Jammer

#1
Over on Fidelity ATP charts we have two Pivot indicators - "Pivot Point High (PPH)" and Pivot Point Low (PPL)". I want to recreate them on WLP, but no one at Fidelity support seems to know the formulas. Can someone on this forum please assist? (These are not the standard pivot lines calculated by using the previous days H, L & C). Thank you in advance.
profile picture

Cone

#2
Not sure how we can help if Fidelity Support cannot provide the formulas.
profile picture

Jammer

#3
How about making a phone call? You are part of the Fideliy family of "software develper" now, correct?
profile picture

rickraphael

#4
Pivot points high indicate a potential reversal if the security trades at a 10 bar high and pivot points low indicate a potential reversal if the security trades at a 10 bar low. The condition is then tested with the price indicated on the pivot point arrow. If the security trades below the price for pivot point high, you enter the position short. If the security trades above the price for the pivot point low, you enter the position long. The price indicator is the "Typical Price" indicator (H+L+C)/3. You can find this information in the "ATP Charting Indicators.pdf from ATP help.
You must be aware that Pivot points "look forward" and can subsequently move the points depending on how the market trades subsequent to the first indication of a potential reversal. Unfortunately, since you do not know at the time (and pivot points cannot tell you) if the trend will continue, you have no way of knowing if the trade will work in advance. You can see this in action on an intra-day chart. Set the pivot point indicators and watch them show up as the day progresses. Occasionally the points will move forward in time (or disappear completely) as the trend goes against the pivot. The problem with pivot points is that they always look perfect n retrospect but involve a degree of risk.
Hope this is of help.
profile picture

Cone

#5
Sure it helps. It's pretty clear that the ATP pivot points aren't useful for real trading since they're forward looking. Nonetheless, you can make a realistic strategy based on a exceeding a 10-day high (low) and entering short (long) on the reverse. The difference is that WLP will make all of these trades even when it's a mistake - you must get out of the trade!

For example, the strategy below follows the guidelines of the "Pivot Point" High/Low indicators and enters short after prices make a new 10-bar high (based on PriceAverageC) and then falls back below that level. A stop is taken on a new high + 6 cents, and the trade is exited for a profit when PriceAverageC makes a new 10-bar low and then reverses above it.

CODE:
Please log in to see this code.


profile picture

rickraphael

#6
I tried running that script in WL 5.3 on a number of data sets but it generated no trades?? Not sure why.
The approach that I believe works is as follows:
Buy on the day following a new 11 day low if the day's high exceeds the previous day's high by 1 cent.
Sell on the day following a new 11 day high if the day's low exceeds the previous day's low by 1 cent.
That is to say, if the security makes an 11 day low, buy the following day if the high exceeds the high on the day of the signal. Do the reverse to sell. I think that the new high confirmation for entry and new low confirmation for exit eliminate many of the false moves.
Any thoughts?
profile picture

Cone

#7
QUOTE:
but it generated no trades?? Not sure why.
Could it be because you didn't compile it after pasting it into the Editor?

Note: Above is a Short-only version of the strategy (Pivot High).
profile picture

rickraphael

#8
Sorry about that. I'm pretty new to this:)
Is it possible to build the strategy I outlined above with Rules? I wouldn't know how to write the code from scratch.
profile picture

Cone

#9
I don't think your requirements are well-thought out. It seems that you've described something of a stop and reverse strategy, but what happens if, for example, the high exceeds previous high after an 11-day low, you buy, and then the market goes straight to zero? This is the move for which you should be short, but the strategy misses it completely!
profile picture

rickraphael

#10
Thanks you for your observations. I agree.
I have reworked the code that you sent to trade only long positions. It seems to work well, however, I don't understand what it is doing. Could you annotate the code to explain the functions? If you have any suggestions I would appreciate them.
Thanks.

CODE:
Please log in to see this code.


profile picture

Cone

#11
Which functions are you having trouble with? Functions like CrossOver and BuyAtLimit are pretty self-explanatory are they not?

Tip:
Put the cursor on a WealthScript function (like BuyAtLimit, LastPosition, etc) and hit F1 for the QuickRef.
profile picture

rickraphael

#12
I don't understand what's happening here:
CODE:
Please log in to see this code.

profile picture

Cone

#13
It returns the max value of:
a. the high on the position's entry bar, or,
b. the high on the bar prior to the entry (the signal bar).

.. minus 1 penny.
profile picture

rickraphael

#14
Thanks Cone. I still don't really understand but that's not your fault and you've been very kind. I was kind of hoping I could tweak this in an intelligent fashion rather than randomly reversing or changing variables.
Beyond that, what I don't get is why this code is returning such extraordinarily high results, e.g., on the nasdaq 100 from 12/17/08 to 2/02/09, with 100K starting capital and $20K per trade the WL Score is 917, win rate 72.97%, $19,175 Profit. Are these numbers to be believed? And is this trade-able?
Finally, how do i get an email alert when you have responded?

Thank you.

V5:
CODE:
Please log in to see this code.

profile picture

Cone

#15
Email option for the forum isn't yet available. You can bookmark a topic and check back periodically for new posts, which show up as a "+" icon.

QUOTE:
Are these numbers to be believed?
No, you've created a peeking strategy, and less importantly, you're not considering all the different backtest possibilities when sizing with such large positions.

PROBLEM #1: Never (unless you know what you're doing) use bar + n, where n > 1 in a trading signal. You used bar + 2 in the SellAtLimit.

PROBLEM #2: Always (unless you know what you're doing) use bar + 1, for AtMarket, AtLimit, and AtStop orders.

Related: (Version 4 articles, but apply the same to Version 5)
Bars, Loops, and Bar + 1
Tips to Avoid Peeking in your Wealth-Lab Scripts
Tips to Avoid Peeking into the Future
profile picture

Eugene

#16
QUOTE:
Email option for the forum isn't yet available.

...but there are tools that detect web page changes and can alert by e-mail. However, my vote goes for Dapper.net - IMHO a state-of-art RSS'izer.
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).