Hi guys how are you? Can you help me with the original code of TOS to set sound alerts?
Thanks guys!!!
This is the code.
#
# TD Ameritrade IP Company, Inc. (c) 2009-2021
#
#wizard text: CLOSE
#wizard input: crossingType
#wizard input: band
#wizard text: Inputs: length:
#wizard input: length
#wizard text: std deviation:
#wizard input: Std_Deviation
#wizard text: average type:
#wizard input: averageType
input length = 20;
input Std_Deviation = 2.0;
input band = {default upper, middle, lower};
input crossingType = {default above, below};
input averageType = AverageType.SIMPLE;
def bollinger;
switch (band) {
case upper:
bollinger = BollingerBands(length = length, Num_Dev_Dn = -Std_Deviation, Num_Dev_up = Std_Deviation, averageType = averageType).UpperBand;
case middle:
bollinger = BollingerBands(length = length, Num_Dev_Dn = -Std_Deviation, Num_Dev_up = Std_Deviation, averageType = averageType).MidLine;
case lower:
bollinger = BollingerBands(length = length, Num_Dev_Dn = -Std_Deviation, Num_Dev_up = Std_Deviation, averageType = averageType).LowerBand;
}
plot signal = Crosses(close, bollinger, crossingType == CrossingType.above);
signal.DefineColor("Above", GetColor(1));
signal.DefineColor("Below", GetColor(2));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));
signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);