Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Tick difference
Collapse
X
-
Found this on other thread:
if (FirstTickOfBar)
{
Up = 0;
Down = 0;
}
prevTick = currTick;
currTick = Close[0];
if (currTick > prevTick)
Up++;
else if (currTick < prevTick)
Down++;
Will this work?
I am familiar with NT programming now, so my questions these days are more to getting familiar with the APIs that NT provided and other resources that we can use without re-inventing the wheels. Thanks again
Comment
-
I tried both of these snippets:
Method 1 =================
prevTick = currTick;
currTick = Close[0];
if (currTick > prevTick)
tick_count++;
else if (currTick < prevTick)
tick_count++;
Method 2 =============
if (Close[0] >= GetCurrentAsk())
tick_count++;
elseif (Close[0] <= GetCurrentBid())
tick_count--;
===================
Both yield different results. Method 1 seems to always count positive even in red bars, while method 2 gives better results with neg counts in red bar (not always, but it is more realistic)
Any idea why?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
151 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
304 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
244 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
345 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
175 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment