I am working on creating a custom strategy; however, when I try to utilize Time[0] it pulls the left most bar on the chart instead of the most recent. When I try Time[1] it tries to pull the bar to the left of the first bar on the chart, so that operates as intended, but for some reason it won't pull the current bar. Additionally, if I change the chart to look back more or less days, Time[0] will adjust to still pull the left most bar shown on the chart depending on how many days I have shown. Does anyone have any ideas on how to fix this?
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
Time[0] Not Pulling Current Bar
Collapse
X
-
Time[0] Not Pulling Current Bar
Hello,
I am working on creating a custom strategy; however, when I try to utilize Time[0] it pulls the left most bar on the chart instead of the most recent. When I try Time[1] it tries to pull the bar to the left of the first bar on the chart, so that operates as intended, but for some reason it won't pull the current bar. Additionally, if I change the chart to look back more or less days, Time[0] will adjust to still pull the left most bar shown on the chart depending on how many days I have shown. Does anyone have any ideas on how to fix this?Tags: None
-
Hello hooblerm1,
Thanks for your post.
What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
How exactly are you defining the print in your script?
When testing a print for Time[0] in the attached sample script, I am seeing the most recently closed bar's time print to the NinjaScript Output window.
See this demonstration video: https://brandonh-ninjatrader.tinytak...N18yMjUxMjc4OQ
Please test the attached sample strategy using the same steps seen in the demonstration video. Do you see a different behavior when testing the attached script on your end?Attached FilesBrandon H.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by WaleeTheRobot, 04-28-2024, 04:42 PM
|
1 response
20 views
0 likes
|
Last Post Today, 10:53 AM | ||
Started by burtoninlondon, Today, 10:13 AM
|
1 response
14 views
0 likes
|
Last Post Today, 10:52 AM | ||
Started by ezrollin, 02-26-2022, 11:14 PM
|
11 responses
218 views
0 likes
|
Last Post
by kenz987
Today, 10:43 AM
|
||
Started by Ticks_66, Today, 09:50 AM
|
1 response
5 views
0 likes
|
Last Post Today, 10:32 AM | ||
Started by Aquila_Welokk, 04-29-2024, 01:14 PM
|
1 response
20 views
0 likes
|
Last Post Today, 10:18 AM |
Comment