To my great surprise I managed to paste in an alert command into the Tick Counter 1 last week. It worked!! Now I still couldn't figure out how to get the number of ticks left that trigger the alarm into a menu panel so that you can change it in the Indicator menu when you change tick charts or markets, but at least it worked.
So I tried pasting in the same code into the TickCounter2 but it just won't compile and I have no idea what to do having played around with various things.
I wonder if anyone would like to take a crack at it?
My insert into TickCounter1 (which I copied in from someone else's code for something else) was:
// Plot the tick count message to the lower right hand corner of the chart
if (Bars.Period.Id == PeriodType.Tick)
{
double tickCount = ShowPercent ? CountDown ? (1 - Bars.PercentComplete) * 100 : Bars.PercentComplete * 100 : CountDown ? Bars.Period.Value - Bars.TickCount : Bars.TickCount;
graphics.DrawString((CountDown ? " Ticks remaining = " + tickCount : "Tick count = " + tickCount) + (ShowPercent ? "%" : ""), ChartControl.Font, textBrush, bounds.X + bounds.Width - textWidth, bounds.Y + bounds.Height - textHeight, stringFormat);
// Generates an alert
if (tickCount<=5)
{Alert("TickBarAlert", NinjaTrader.Cbi.Priority.High, "Tick Bar End", "Alert1.wav", 2, Color.Black, Color.Yellow);
}
The part that I inserted begins with // Generates an alert ...... ends with that last }.
But it won't go into the TickCounter2 code which is somewhat different because of all the nifty new things that have been added to it.
Thxs.
Ash.
Comment