Custom Alert for Ichimoku Strategy

B

british43

New member
Hello Everyone, I'm trying to add a custom alert (other than bell, chime, ding or chimes) to this script I found in the thinkscript Onedrive. Any help would be greatly appreciated. Thank you.

Code:
# Adaptation of Ichimoku Strategy
# Mobius
# Revised Tenkan and Kijun
# V01.12.2013

input nA = 8;
input nB = 21;

#math
def Tenkan = (Highest(high, nA) + Lowest(low, nA)) / 2;
def Kijun = (Highest(high, nB) + Lowest(low, nB)) / 2;
def "Span A" = (Tenkan[nA] + Kijun[nA]) / 2;
def "Span B" = (Highest(high[nA], nB) + Lowest(low[nA], nB)) / 2;

plot Chikou = Inertia(close[-nA], nB);

# Color Config
#"Span A".SetDefaultColor(Color.PLUM);
#"Span B".SetDefaultColor(Color.YELLOW);
Chikou.SetDefaultColor(Color.WHITE);
DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

#AddCloud("Span A", "Span B", GlobalColor("Bullish"), GlobalColor("Bearish"));
##Arrows on Chikou Crossover
# changed from crosses above to >
plot ArrowUp = Chikou crosses above Max("Span A", "Span B");
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetLineWeight(1);
ArrowUp.SetDefaultColor(Color.WHITE);

# changed from crosses below to <
plot ArrowDn = Chikou crosses below Min("Span A", "Span B");
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetLineWeight(1);
ArrowDn.SetDefaultColor(Color.YELLOW);
 
BenTen

BenTen

Administrative
Staff
VIP
Add this to the end of your script:

Code:
# Alerts
Alert(ArrowUp, " ", Alert.Bar, Sound.Chimes);
Alert(ArrowDn, " ", Alert.Bar, Sound.Bell);
 
BenTen

BenTen

Administrative
Staff
VIP
@british43 Yes, but that is using a different setting/method. I don't know if it is compatible with this sort of indicator, though. If anything, you can go to MarketWatch > Alerts and see if you can find anything.

 

Similar threads

Top