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
Skipping CurrentBar during processing
Collapse
X
-
Thanks for the verification. After remembering, and commenting out that code (and subsequent vanishing of the problem), I suspected there was a minimum granularity for the timestamps, and that was causing the problems.
-
Originally posted by Antny View PostStill not sure why it skips processing some of the bars, unless it has to do with fast printing bars having the same time code.
Naturally, on time-based charts, every bar has a different timestamp.
But for other charts, such as Tick, Range, Renko, etc, absolutely you will find many bars with the exact same timestamps, exactly at those moments where price was moving very fast.
For example, an "instantaneous" price drop of 10+ ticks will create at least 2 bars on a 4-Range chart ... and each bar will have exact same timestamp.
Leave a comment:
-
Fast tick bars or 1 range bars may have same time stamps. 1 tick bars are the worst. Every bar will have a bar number though so you would need to not filter by time stamps to process all the prints.
Leave a comment:
-
Hahahahaha! Why is it always the little bugs that cause the big problems? Okay...so I figured out the problem.
I primarily use tick and range bar charts. The indicator recalcs on every tick. I wanted to reduce the frequency of data dumps to the output window, so I dropped in a simple piece of code to force it to process once per bar.
As it turns out, tick charts and range charts do not play well with this. I shifted the code to a later point, and suddenly...no more skipped CurrentBars.
The code I used was this...
Code:if(bartesttime==Time[0]) {return;} else {bartesttime=Time[0];}
Leave a comment:
-
Thanks for the responses. I have no problems posting more info...but I am having to wait for the problem to happen again. So far it has not happened today. Will post more info when I can catch it happening again.
Leave a comment:
-
Hello Antny,
So that I may have a more complete picture of what is happening on your end, would it be possible to use the freely and publicly available screen capture software Jing, https://www.techsmith.com/jing.html , or a similar program which can record video of what is happening on your screen, so that you can show me what is occurring on your end? These quick instructions can get you started with Jing.
- When you start Jing, a yellow half circle will appear near the top of your screen. Please hover over it with your mouse
- A small + sign will extend out of this half circle. Please click on it
- When your cursor becomes two intersecting lines, please click and drag your mouse over an area of your screen you would like to record
- Please press the film strip button that appears to begin recording
- When you are finished recording, please press the square stop button that appears
- Please press the share button that appears. It consists of three vertical upward pointing arrows.
You will then have the option to view your video on screencast.com . This is the link which can help me diagnose what is happening on your end. It is possible you will need to set up a free account in order to share videos.
Thank you very much in advance for providing us with this information. If this procedure is not an option for you, or if there are any other questions we can answer, please let us know.
Leave a comment:
-
Originally posted by Antny View PostFor some reason ninja is not accessing every bar on the chart.
(Lol, how could I pass up a plug for The Princess Bride?]
Originally posted by Antny View PostI am attaching a pic of a chart this is happening on, and a pic of the relevant data dump from the output window.
Is this occurring over a session boundary on your chart?
[It looks to me, from your attached image, the answer is yes]
What is your Session Template setting for the chart?
Have you tried right clicking in the chart window and "Reload All Historical Data"?
What is your Merge Policy for your data?
Also, during debugging, I would recommend printing Time[0] when you print CurrentBar, the second screenshot you attached would have been much more helpful with this timestamp information.
Leave a comment:
-
Skipping CurrentBar during processing
Alright....so I am trying to get an indicator coded...everything is going great thus far... and then...
For some reason ninja is not accessing every bar on the chart. I am using ninja 7. The code I was working on when ninja started this problem is identical to the code in the "@Stochastics.cs" file in the custom indicators folder.
I noticed it when my indicator was returning null for some values in the K plot. I had the indicator dump the values to the output window and it showed some values of CurrentBar are being skipped. As long as the bars on the chart do not change, the exact same values are skipped when I re-apply the indicator. If I connect to my broker and update the chart, it skips completely different bars.
It doesn't seem to matter what the bars are doing (moving up vs moving down), or what size they are. In addition, all bars report correct values in the Data Box, and on the skipped bars, the indicator reports "N/A" for the K value. I have tried it on different charts and it still skips seemingly random bars.
I am attaching a pic of a chart this is happening on, and a pic of the relevant data dump from the output window.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 03:49 AM
|
0 responses
4 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
7 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
10 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
||
Started by dustydbayer, Today, 01:59 AM
|
0 responses
2 views
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 12:32 AM |
Leave a comment: