LineAlert is a superb indicator (strictly 'method'). Pure price action - everyone should use it!
I'm trying to adjust this to accommodate some of the sound files I've recorded and to have different alerts for buys and sells. However, my new indicator doesn't work and I must have made a mistake in the coding somewhere.
Firstly, to say that:
Dow_BUY_LineAlert.wav
Dow_SELL_LineAlert.wav
are the files I've recorded. They work and I've placed them in the folder 'C:\Program Files\NinjaTrader 7\sounds'.
This is what I've adjusted:
In Variables, I've put:
private string soundFileUP = "Dow_BUY_LineAlert.wav"; private string soundFileDOWN = "Dow_SELL_LineAlert.wav";
[Description("The name of the sound file. NT will look for this file in \\Program Files\\NinjaTrader\\sounds")] [GridCategory("Parameters")] public string SoundFileUP { get { return soundFileUP; } set { soundFileUP = value; } } [Description("The name of the sound file. NT will look for this file in \\Program Files\\NinjaTrader\\sounds")] [GridCategory("Parameters")] public string SoundFileDOWN { get { return soundFileDOWN; } set { soundFileDOWN = value; } }
else { //Alert Checking is done here. Can add your own actions to the block if desired. if(CrossBelow(Close, lineValueAtLastBar, 1) || CrossAbove(Close, lineValueAtLastBar, 1)) { Alert("AlertLineCrossing", Cbi.Priority.High, alertMessage, soundFile, 0, Color.White, Color.Black); } }
else if( CrossAbove(Close, lineValueAtLastBar, 1)) { Alert("AlertLineCrossing", Cbi.Priority.High, alertMessage, soundFileUP, 0, Color.White, Color.Black); } else if( CrossBelow(Close, lineValueAtLastBar, 1) ) { Alert("AlertLineCrossing", Cbi.Priority.High, alertMessage, soundFileDOWN, 0, Color.White, Color.Black); }
Any advice will be much appreciated.
Comment