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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment