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
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
 
D

drdarshil16

New member
2019 Donor
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
 
J

Joules360

New member
Dr.
Can you add buy and sell strategy to this thinkscript ? It works well for alerts.. but would like auto trading.
Thanks,
Joules
 
T

tradebyday

Active member
@Joules360 There is no auto-trading in TOS.. setting the code up as a strategy will just allow you to see backtesting results and will plot the buy/sell orders as they already have been plotted in the code above
 
J

Joules360

New member
Thanks... guess alerts and manual trades will have to do... The PPS signal works well as long as a 3x larger time frame is moving same way in trend.

Joules360
 
D

divot1966

New member
VIP
Can someone supply me with the code for multi time frame for the PPS strategy or does it exist
 

Similar threads

Top