PPS and PMC Custom Scanner


Tags:
Category:
0
0

hey Pete,

I am using the John Person’s PPS and PMC indicator lately with quite a pretty good success. On the TOS, there is a pre-built PPS Buy/Sell scanners but I am looking to combine the PPS indicator with the PMC indicator to get a more confirmed buy/sell signal as Mr. Person explained in this video:

I am hoping the custom scanner can do:

  1. Signal only when PPS indicator has fired and PMC indicator has already shown the bullish/bearish trend for the past x of days. (Quite similar to your work on TTM Squeeze which only signal when there are two more days of confirmation of trend).
  2. Another request – sometime post the PPS buy/sell signal, only after a couple of days later, the PMC indicator is showing the reversal. Maybe the custom scanner can also provide the option to look “backward” in time at the PPS signal. ie., PMC indicator is showing reversal trend, and there is buy/sell PPS signal fired  y number of days before.

I know it is pretty complicated, however, I am sure many will benefit from this. Thank you in advance!

 

RESOLVED
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on May 12, 2018 11:42 pm
4490 views
1
Private answer

Since you did not claim to have made any attempt to work this out on your own I will assume you don’t care to know how this works. But if you do, just let me know if the comments area below and I will explain how this code works.

You have one input, xDays. There are four scan signals at the very bottom of the code. As per usual, you will select which signal to run by moving the “#” symbol in front of the ‘plot scan’ statements.

input xDays = 2;
def ppsBuy = PPS().BuySignal;
def ppsSell = PPS().SellSignal;
def buy = !IsNaN(ppsBuy);
def sell = !IsNaN(ppsSell);
def pmcDiff = PMC().Diff;
def pmcMA = PMC().DiffMA;
def lightBlue = pmcDiff > 0 and pmcDiff > pmcMA;
def darkBlue = pmcDiff > 0 and pmcDiff < pmcMA; def red = pmcDiff < 0 and pmcDiff < pmcMA; def magenta = pmcDiff < 0 and pmcDiff > pmcMA;
def confirmDaysBullish = (Sum(lightBlue, xDays) + Sum(magenta, xDays)) >= xDays;
def confirmDaysBearish = (Sum(red, xDays) + Sum(darkBlue, xDays)) >= xDays;
def confirmedBuy = buy and confirmDaysBullish;
def confirmedSell = sell and confirmDaysBearish;
def buyWithReversal = magenta[1] and lightBlue and Highest(buy, xDays) > 0;
def sellWithReversal = lightBlue[1] and red and Highest(sell, xDays) > 0;
# use this to scan for PPS buy signals that follow bullish PMC
plot scan = confirmedBuy;
# use this to scan for PPS sell signals that follow bearish PMC
#plot scan = confirmedSell;
# use this to scan for bullish PMC reversals that follow a PPS buy
#plot scan = buyWithReversal;
# use this to scan for bearish PMC reversals that follow a PPS sell
#plot scan = sellWithReversal;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 14, 2018 10:15 am
0

Hello Pete, Installing this as a watchlist column seems to be working for a friend but the same script on my computer produces results that are 90% NaN and a few zero’s.
1. should the script be used as is for a watchlist column as we’ve tried to do?
2. your thoughts on why we would get different results using the (checked and crosschecked) identical script?
Thanks!
Doug

( at July 28, 2018 1:11 pm)
0

I tested this in a watchlist column on mine and I get all NaN with a few zeros. I tried different time frames, different signals. Then I tried using OnDemand. None of those variables changed the behavior.

I can tell you from experience I have seen this before. It happens when one or more lines in the code is assigning a value or Double.NaN to a signal or a signal’s components. The correction is to modify the code to remove the Double.NaN assignment and opt for a True/False assignment in it’s place. However this is a licensed study and we have no way of modifying the source code.

You can see that in the very first lines of code I have to check if the signal coming from PPS code is NaN:
def buy = !IsNaN(ppsBuy);
def sell = !IsNaN(ppsSell);

This is not the cause of the problem, but rather a symptom. This was required because that’s the way the signals are being delivered from the PPS study itself.

Why is it working on someone else’s computer? I suspect it is not. I would suspect any values on that other computer are incorrect. Not saying they are. Just saying I would not trust them until they are verified as being correct.

( at July 28, 2018 3:06 pm)
0
Good evening Pete. Is there a simple way to integrate PMC and PPS together into a scan where the following occurs. If you're bullish, alert only occurs when: PPS buy signal ONLY when PMC is purple or cyan. If you're bearish, alert only occurs when: PPS sell signal ONLY when PMC is dark blue or red. Thank you for your time
( at December 6, 2020 9:54 pm)
0
You can build that as a completely separate study filter using the Condition Wizard. The color scheme is very simple for this study. Diff > 0 and Diff > Diff[1] colors the bars cyan. Diff < 0 and Diff > Diff[1] colors the bars magenta.
( at December 7, 2020 9:32 am)