Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Real-Time Price Detection
Collapse
X
-
Hello chaddweston,
Thanks for your post and welcome to the NinjaTrader forums!
If you want to see real time data then you would need to set your codes "calculate mode" to Calculate.OnEachTick. In this mode Close[0] IS the current price on the right edge as the bar forms and Close[1] is the close of the previously completed bar.
One caution though is that if you check to see if the current tick has crossed the SMA you need to understand that on the next tick it could cross back and this could occur hundreds of times in the forming bar. So you would need to give some thought about how to deal with that. On the other hand, staying with Calculate.OnBarClose, Close[0] points to the last completed bar and it will not change on you...
References: http://ninjatrader.com/support/helpG...?calculate.htm
You can have your strategy run Calculate.OnEachTick and have some parts run once per bar and other parts run on each tick. Here is a link to a reference example that reviews and demonstrates how to do this: http://ninjatrader.com/support/forum...ad.php?t=19387
-
Real-Time Price Detection
How do identify the current price to compare against say the SMA? If I wanted to do something like:
IF Current price crosses below the SMA... [Do something]
Right now in the price section I only see open close high low, but those are defined after a candlestick bar is done. I need to keep track of the price and compare in real-time.
Please advise.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mlurskint8, Today, 05:27 PM
|
3 responses
14 views
0 likes
|
Last Post
|
||
Started by SteveTheCPA, Today, 04:54 PM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by SteveTheCPA
Today, 04:54 PM
|
||
Started by Unsuitable, Today, 02:42 PM
|
2 responses
9 views
0 likes
|
Last Post
![]()
by Unsuitable
Today, 03:42 PM
|
||
Started by ralett, Today, 11:52 AM
|
4 responses
24 views
0 likes
|
Last Post
![]()
by ralett
Today, 03:05 PM
|
||
Started by _Zero_, 04-10-2020, 02:21 PM
|
38 responses
907 views
2 likes
|
Last Post
|
Leave a comment: