With all the info ive gathered, I have been tinkering with the code to get sound alerts. All the time it falls short. Sometimes it shouts even when the candle is forming, or doesnt alert all the time or alerts only for a few instruments. I have zero coding knowledge. I have following requirements.
1. Get sound alerts like to say what i define in the code. So whenever a buy signal occurs it should say "Buy Now" or whatever is put in the code. Would also be better if it also says the ticker name. The most important thing is for the sound alert to come after the closing of the candle.
2. Now the same alert system if i put a code in AutoScan mode in analysis window.
I attach a sample code below. Do modify.
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
_N( Title = Title +"\n" + _DEFAULT_NAME() );
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Buy = Close > Open
AND MACD( 12, 26 ) > MACD( 6, 13 );
Sell = Close < Open
AND MACD( 12, 26 ) < MACD( 6, 13 );
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0,Low,Offset=-15);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),coloryellow,0,Low,Offset=-50);
1. Get sound alerts like to say what i define in the code. So whenever a buy signal occurs it should say "Buy Now" or whatever is put in the code. Would also be better if it also says the ticker name. The most important thing is for the sound alert to come after the closing of the candle.
2. Now the same alert system if i put a code in AutoScan mode in analysis window.
I attach a sample code below. Do modify.
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
_N( Title = Title +"\n" + _DEFAULT_NAME() );
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Buy = Close > Open
AND MACD( 12, 26 ) > MACD( 6, 13 );
Sell = Close < Open
AND MACD( 12, 26 ) < MACD( 6, 13 );
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0,Low,Offset=-15);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),coloryellow,0,Low,Offset=-50);