thinkScript

declare lower; 

input length = 14; 

input trendSpeed = 25; 

input thresholdLine = 20; 

plot Threshold = thresholdLine; 

Threshold.setDefaultColor(color.green); 

Threshold.setStyle(curve.FIRM); 

Threshold.setLineWeight(2); 

plot Bullish_Power = DiPlus(length = length); 

Bullish_Power.setPaintingStrategy(paintingStrategy.HISTOGRAM); 

Bullish_Power.setLineWeight(5); 

Bullish_Power.setDefaultColor(color.white); 

plot Bearish_Power = DiMinus(length = length); 

Bearish_Power.setPaintingStrategy(paintingStrategy.HISTOGRAM); 

Bearish_Power.setLineWeight(5); 

Bearish_Power.setDefaultColor(color.red); 

plot Trend_Speed = ADX(length = length); 

Trend_Speed.setDefaultColor(color.yellow); 

Trend_Speed.setLineWeight(5); 

 

alert(crosses(Bullish_Power, Bearish_Power, CrossingDirection.ABOVE), “Power Shift Bullish”, Alert.BAR, sound.Ring); 

alert(crosses(Bullish_Power, Bearish_Power, CrossingDirection.BELOW), “Power Shift Bearish”, Alert.BAR, sound.Ring); 

alert(crosses(Trend_Speed, Threshold, CrossingDirection.ABOVE), “Trending”, Alert.BAR, sound.Ring); 

alert(crosses(Trend_Speed, Threshold, CrossingDirection.BELOW), “Choppy”, Alert.BAR, sound.Ring); 

# end  

Leave a Reply