PPS indicator Strategy code

2

2sureshk

Member
Hi Ben/ Team

I am looking for help on PPS indicator strategy . I see this indicator is good in 4 hrs and 2 hrs time frame.

Please share if there an existing strategy or help with code if possible to write as Strategy


Thanks
Suresh
 
T

tomsk

Well-known member
VIP
Warehouse
Note that PPS is one of the few studies where the source code is protected and not viewable by the public
If TOS unlocks that study so that we see how the algorithm is written, someone may possibly convert that to a strategy
 
2

2sureshk

Member
Thank you .. do you have a procedure if you have a code for any study where we have access to the code
 
T

tomsk

Well-known member
VIP
Warehouse
Thank you .. do you have a procedure if you have a code for any study where we have access to the code
Actually someone asked a very similar question recently and I wrote a simple EMA strategy.
You can read about it here. I'm not too much into strategies but you can use this procedure

 
D

drdarshil16

New member
VIP
Here is the code with alerts, although it uses PPS, but PPS original code is still not revealed. Has alerts

Code:
input ArrowsOn = yes;
input TracerLinesOn = no;
input PriceColorOn = Yes;
AddLabel(PriceColorOn, "SH PriceColorOn");

input ShowTodayOnly = no;
input ShowExtraDays = 0;
def Today =
if !ShowTodayOnly then 1 else
if GetDay() + ShowExtraDays >= GetLastDay() && GetYear() == GetLastYear() then 1 else 0;
input ArrowSpace = .233;
def space = Average(high - low) * ArrowSpace;

#Input AlertsOn = no;
#AddChartLabel(AlertsOn, "SH AlertsOn");
def BuyIt = PPS().buysignal;
def SellIt = PPS().sellsignal;

plot ppsBuy = if !Today or !ArrowsOn then Double.NaN else BuyIt - space;
ppsBuy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
ppsBuy.SetDefaultColor(Color.WHITE);
ppsBuy.SetLineWeight(3);
Alert(ppsBuy, “PPS Buy Signal”, Alert.BAR, Sound.Ring);

plot ppsSell = if !Today or !ArrowsOn then Double.NaN else SellIt + space;
ppsSell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
ppsSell.SetDefaultColor(Color.WHITE);
ppsSell.SetLineWeight(3);
Alert(ppsSell, “PPS Sell Signal”, Alert.BAR, Sound.Ring);


AddLabel(ArrowsOn, "WhiteArrows=SH", Color.WHITE);

rec PriceAtBuy = if BarNumber() == 1 then close else if !IsNaN(BuyIt[0]) then open[0] else PriceAtBuy[1];
rec PriceAtSell = if BarNumber() == 1 then close else if !IsNaN(SellIt[0]) then open[0] else PriceAtSell[1];


rec trigger = if PriceAtBuy <> PriceAtBuy[1] then -1 else if PriceAtSell <> PriceAtSell[1] then 1 else trigger[1];
plot BuyPrice = if TracerLinesOn && trigger == -1 then PriceAtBuy else Double.NaN;
BuyPrice.SetDefaultColor(Color.GREEN);
BuyPrice.SetPaintingStrategy(PaintingStrategy.POINTS);
plot SellPrice = if TracerLinesOn && trigger == 1 then PriceAtSell else Double.NaN;
SellPrice.SetDefaultColor(Color.RED);
SellPrice.SetPaintingStrategy(PaintingStrategy.POINTS);

AssignPriceColor(if !PriceColorOn then Color.CURRENT else if trigger == 1 then Color.RED else Color.GREEN);
 
2

2sureshk

Member
@drdarshil16 Thank you for the details, but it is not working as strategy , as PPS indicator already available it is same as the PPS . Where as I am looking for the code with buy and sell order which i was unable to code.

Any inputs or update on the code will help
 
Thread starter Similar threads Forum Replies Date
T Questions 2
R Questions 2
MrD Questions 8
T Indicators 0
chenthy Questions 3

Top