TradingView
MattDeLong
Dec 20, 2017 3:33 AM

PET-D Steve Primo 

Intel CorporationNASDAQ

Description

This is the technical indicator that Steve Primo calls the "PetD" and charges $495 USD. My gift to you for free.

Release Notes

Fixed typo and added alert conditions as suggested here. 6 Apr 2019
Comments
MattDeLong
Made some updates this weekend new version below:

//@version=3
//author = tradingview.com/u/MattDeLong/

study("PET-D Steve Primo", overlay=true)
petda = (ema(close,5) > ema(close,15)) ? 1 : 0
petdb = (ema(close,15) > ema(close,5)) ? 1 : 0
marker = input(title="Show Entry/Exit Markers", type=bool, defval=true)

barcolor((petda) ? green : red)
mychar1 = crossover(petda, petdb) and marker ? 1 : 0
mychar2 = crossover(petdb, petda) and marker ? 1 : 0
plotshape(mychar2, style=shape.triangledown, location=location.abovebar, size=size.tiny, color=red)
plotshape(mychar1, style=shape.triangleup, location=location.belowbar, size=size.tiny, color=green)

// === ALERT ===
alertcondition(mychar1 or mychar2, title="Signal Alert",message="SIGNAL")
alertcondition(mychar1, title="Long Alert",message="Long")
alertcondition(mychar2, title="Short Alert",message="Short")
Aunkon
@MattDeLong, Is this the entire code? BTW thnx.
mohanee
@MattDeLong, Hi Matt , god work. Just a question : petda and petdb are numbers either 1 or 0. you have used crossover function on petda and petdb. does it work ?
MattDeLong
//@version=3
//author = tradingview.com/u/MattDeLong/

study("PET-D Steve Primo", overlay=true)
petda = (ema(close,5) > ema(close,15)) ? 1 : 0
petdb = (ema(close[1],5) > ema(close[1],15)) ? 1 : 0
marker = input(title="Show Entry/Exit Markers", type=bool, defval=true)

barcolor((petda) ? green : red)
mychar1 = crossover(petda, petdb) and marker ? 1 : 0
mychar2 = crossover(petdb, petda) and marker ? 1 : 0
plotshape(mychar2, style=shape.triangledown, location=location.abovebar, size=size.tiny, color=red)
plotshape(mychar1, style=shape.triangleup, location=location.belowbar, size=size.tiny, color=green)
TradingClue
@MattDeLong, Shouldn't it be:
petda = (ema(close,5) > ema(close,15)) ? 1 : 0
petdb = (ema(close,15) > ema(close,5)) ? 1 : 0
Or am I missing something?
MattDeLong
@stefcom, should be

petda = (ema(close,5) > ema(close,15)) ? 1 : 0
petdb = (ema(close[1],5) > ema(close[1],15)) ? 1 : 0
MattDeLong
@MattDeLong, commetns are chopping off the code, see the original in color (above)
TradingClue
@MattDeLong, the source code of your study is protected, I can't see it. petda and petdb seem to be exactly the same?
faijanpatel
@MattDeLong, Triangle not showing with this code
Mirrella
The Pet-D seems to be nothing more than a cross of the 8 EMA, with a change of colour bars. Perhaps befitting the T-line cross strategy of Rick Saddler.
More