Simple Pivot High and Low Arrows

D

DazedandCondused

New member
Hello,
This forum has some very talented and imaginative members! I am new here and have a very simple request. I'm trying to paint arrows on my charts at Pivot Highs and Lows. The time span should be adjustable. The code below produces sub-par results for instance in up or down trend consecutive arrows can appear. Any advice or assistance would be greatly appreciated.

Thanks Dazed and Confused

Code:
def PVHighv = high("period" = AggregationPeriod.MONTH, "priceType" = PriceType.last);
def PVLowv = low("period"= AggregationPeriod.MONTH,"priceType" = PriceType.Last);

plot PVhigh = if high == pvhighv then 1 else 0;
plot pvlow = if low == pvlowv then 1 else 0;


pvhigh.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
pvlow.setpaintingstrategy(paintingstrategy.BOOLEAN_ARROW_UP);
 
T

tomsk

Well-known member
VIP
Hello,
This forum has some very talented and imaginative members! I am new here and have a very simple request. I'm trying to paint arrows on my charts at Pivot Highs and Lows. The time span should be adjustable. The code below produces sub-par results for instance in up or down trend consecutive arrows can appear. Any advice or assistance would be greatly appreciated.

Thanks Dazed and Confused

Code:
def PVHighv = high("period" = AggregationPeriod.MONTH, "priceType" = PriceType.last);
def PVLowv = low("period"= AggregationPeriod.MONTH,"priceType" = PriceType.Last);

plot PVhigh = if high == pvhighv then 1 else 0;
plot pvlow = if low == pvlowv then 1 else 0;


pvhigh.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
pvlow.setpaintingstrategy(paintingstrategy.BOOLEAN_ARROW_UP);

I've modified your code slightly, it now displays monthly highs and lows
For best results load up a daily chart of /ES and you can see those arrows plot
Note that I have retained your definitions of High/Low in the code
However normally by definition, a pivot is defined as HLC3 - just whatever floats your boat is the important thing

Code:
def PVHighv = high("period" = AggregationPeriod.MONTH, "priceType" = PriceType.last);
def PVLowv = low("period"= AggregationPeriod.MONTH,"priceType" = PriceType.Last);

plot PVhigh = if high == pvhighv then close else Double.NaN;
plot pvlow = if low == pvlowv then close else Double.NaN;

pvhigh.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
pvlow.setpaintingstrategy(paintingstrategy.BOOLEAN_ARROW_UP);
pvhigh.setDefaultColor(Color.YELLOW);
pvlow.setDefaultColor(Color.CYAN);
pvhigh.SetLineWeight(4);
pvlow.SetLineWeight(4);
 
Last edited:
D

DazedandCondused

New member
@tomsk thanks so much for the prompt reply. This is by far the most helpful forum I've ever seen. Take care my friend.
 
J

jeremyadorna

New member
VIP
@DazedandCondused pivot system above. have you gotten it to work on iOS mobile app? i tried and it doesn't seem to paint the arrows.
 

Similar threads

Top