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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
42 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
29 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
46 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
38 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment