Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
5minute count down
Collapse
X
-
5minute count down
Hey guys, I'm curious if I want to make an indicator that draws an arrow every 5 min, using Times[1][0] and Add (Period.Minute, 5); How would I write that? I just don't get it. Is there a way to write a Timer Code that can just do Something every "x" minutes"?Tags: None
-
Hello ginx10k,
Thank you for your inquiry.
If you would like to have your script draw an arrow at the bar close of a five minute secondary DataSeries, assuming CalculateOnBarClose is set to true, you can do this:
Code:protected override void OnBarUpdate() { if (BarsInProgress == 1) // draw an arrow if the secondary DataSeries called OnBarUpdate (this is assuming that the five minute bar is at BarsArray[1]) DrawArrowUp(....); }
If you would like to draw an arrow based on a timer instead, I would suggest taking a look at the included BarTimer indicator as this indicator does utilize a timer.
Please, let us know if we may be of further assistance.Zachary G.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by lorem, Yesterday, 09:18 AM
|
4 responses
14 views
0 likes
|
Last Post
by lorem
Today, 12:17 PM
|
||
Started by Spiderbird, Today, 12:15 PM
|
0 responses
5 views
0 likes
|
Last Post
by Spiderbird
Today, 12:15 PM
|
||
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
12 responses
42 views
0 likes
|
Last Post Today, 12:09 PM | ||
Started by FrazMann, Today, 11:21 AM
|
0 responses
6 views
0 likes
|
Last Post
by FrazMann
Today, 11:21 AM
|
||
Started by geddyisodin, Yesterday, 05:20 AM
|
8 responses
52 views
0 likes
|
Last Post Today, 10:45 AM |
Comment