View Full Version : Tick Counter Indicator
hoozifachi
03-18-2006, 01:46 PM
Is there a way to display time/ticks remaining in bar.
Thanks,
Jason
NinjaTrader_Ray
03-19-2006, 03:28 AM
If you have some programming skill, you can create an indicator to do this using NinjaScript.
Ray
hoozifachi
03-20-2006, 08:42 AM
I can probably do that. Is there a class that has the info I need or do I need to keep track of time/ticks in OnBarUpdate()?
Thanks,
Jason
NinjaTrader_Ray
03-20-2006, 02:41 PM
You need to create a variable outside of the OnBarUpdate() method and increment it in the OnBarUpdate() method.
Maybe something like:
// Variables
private int tickCount = 0;
private int activeBar = 0;
OnBarUpdate()
{
if (CurrentBar != activeBar)
{
activeBar = CurrentBar;
tickCount = 0;
}
tickCount++;
Plot0.Set(tickCount);
}
hoozifachi
03-20-2006, 03:51 PM
That's what I thought, but OnBarUpdate() does not seem to be called for every tick.
I have this:
protected override void OnBarUpdate()
{
if (CurrentBar != currentBarHold) {
Print("Bar Close: " + ticks);
currentBarHold = CurrentBar;
ticks = 0;
}
ticks++;
}
Using the simulated data feed with 133 tick interval produces:
Bar Close: 54
Bar Close: 71
Bar Close: 70
Bar Close: 76
Bar Close: 72
Bar Close: 67
Bar Close: 53
I had similar results with IB data feed as well.
NinjaTrader_Ray
03-21-2006, 02:20 AM
We are looking into it and will get back to you tomorrow. Our head of development is out today.
Ray
NinjaTrader_Ray
03-21-2006, 03:57 AM
Just an update:
I did confirm that tick bars are being built correctly so the issue for sure in the firing of the OnBarUpdate() method. This will be investigated tomorrow.
Ray
NinjaTrader_Ray
03-21-2006, 04:28 AM
Here is the deal:
Chart visualization is optimized and we filter out ticks that would not impact a visual change to the chart. We have some connectivity providers that send a lot of ticks and without this optimization NT would be extremely CPU intensive.
What can be done?
We can expose a TickCount property that you could access? You could then implement an indicator that custom draws the tick count. See the attached indicator and the Plot() method to custom draw a string.
hoozifachi
03-21-2006, 03:46 PM
Thanks! Do you have any idea when TickCount might be implemented. I could work on the indicator, but it might take a while. Not a lot of spare time these days.
By the way, I am really impressed with NinjaTrader and your prompt responses.
Thanks,
Jason
NinjaTrader_Ray
03-22-2006, 04:48 AM
You can use the one I created that is attached to this post. You will have to upgrade to 5.1.1000.2 which can be downloaded from the link below. This version is not yet published on our website.
www.ninjatrader-support.com/ninjatrader/nt5/NinjaTrader.Install.new.msi (http://www.ninjatrader-support.com/ninjatrader/nt5/NinjaTrader.Install.new.msi)
hoozifachi
03-23-2006, 03:33 PM
That works great!
I made a couple enhancements to TickCounter:
The user can choose for it to count up or down.
The text will change colors in the last 20% of the bar.
The user can select the two text colors.
If I have time this weekend, I'll see if I can make it work for minute charts as well.
NinjaTrader_Ray
03-24-2006, 01:56 AM
Cool, looks good.
hoozifachi
03-31-2006, 04:40 PM
I added seconds count for minute charts.
Is there a way to put a panel to the right of the chart with price, time left in bar, etc?
Like what you see in many Woodies CCI charts?
NinjaTrader_Ray
04-01-2006, 02:28 AM
Cool.
There is no way to custom draw in the margins.
Ray
Antraman
05-24-2006, 12:34 AM
I just downloaded Tick Counter and tried to install it and got the follwing error message:
NinjaTrader Data Bars does not contain a definition for TickCount.
There is no Tick Counter indicator in my charts when I open one. I have had no problem with installing the other custom indicators.
cheers,
Antramam
0
NinjaTrader_Ray
05-24-2006, 12:38 AM
Make sure you are using the latest NT. Sounds like you are on an old version.
Antraman
05-24-2006, 02:34 AM
5.1.1.4?0
NinjaTrader_Ray
05-24-2006, 03:29 AM
Yes, very old. Please update. Make sure you uninstall via Control Panel first before installing latest.
Antraman
05-24-2006, 03:36 AM
OK, but what about all my chart settings and templates? I spent hours setting them up the way I like...
thankx
ps. a good night on the Euro tonight!
cheers,
Antraman
0
NinjaTrader_Ray
05-24-2006, 07:54 AM
Chart templates will be fine.
TraderTony
05-25-2006, 09:20 PM
The tick count down is great but I have one request to make it more practical. I use a white background in all my charts and the default alert colour for the last 20% is yellow which I cannot see easily. Unfortunately changing the colour to, say, red, does not save. The result is that on every new connection I have to manually change the colour on every chart. Would it be possible to change the default colour?
Many thanks,
Tony
NinjaTrader_Ray
05-26-2006, 12:13 AM
Have to ask the developer of the indicator which is not us.
Antraman
08-09-2006, 09:44 PM
Request to hoozifachi - it seems the newer versions of Ninja don't work with changing the "Text Colour" tag. Earlierversions did, and was fine.
I'm not a script programmer otherwise I'd try it myself mate, so if you or someone has the time and inclination to fix it, ti would be appreciated this end. Its a cool tool.
cheers,
Antraman
0
Antraman
08-16-2006, 03:00 PM
Found the cause of the problem...silly me had two Tickcounters running at same time by mistake, the black one was covering the one I edited, therefore I couldn't see it against black background...
Sorry for being an idiot
<smacks hand to forehead>
cheers,
Antraman
0
mason
03-29-2008, 07:18 PM
I use NT6.5.0.10, but says, there are programming errors with this indicator that need to be resolved first.
Can someone convert this to the latest version please ?
Thanks