Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
indicator values for non-daily bars not consistent with daily bars?
Collapse
X
-
joe,
It has never been within in our support policy to provide custom code for users. There has been a considerable amount of time spent on this topic and the contributors to this thread have went over beyond what we normally provide for support to help you with the learning curve. However what you're asking us to do at this point is more than we offer as a general support service. If another user wants to step in to help, we will leave this thread open. Otherwise, for additional assistance, you will need to work with a NinajScript consultant.
-
Unfortunately I have spent a ridiculous amount of time on this. At this point I would ask that you simply identify the modified lines of code WHICH HAVE ALREADY BEEN WRITTEN. Why is that such a big deal? Your what appears to me to be a small amount of additional effort will save me a lot of time in getting set up to back test and verify the modified code. Please reconsider.
Leave a comment:
-
joemiller, unfortunately this is not something we could provide here as we do not offer custom coding or code modification services, Chelsea has gone above and beyond explaining the different approaches you could use and has also provided a courtesy sample for your review as a base to start from. At this point I would ask that you please check with our external consulting partners regarding a professionally coded solution for your custom works - http://www.ninjatrader.com/partners....pt-Consultants
Leave a comment:
-
Thanks Chelsea.
instead, if you would please, send me just snippets of code showing the code modifications. That will save me a lot of time.
Much appreciated.
Leave a comment:
-
Hello joemiller,
I have modified your indicator script to show an example of obtaining the information you would like without using Bars.GetDayBar.
Bars.GetDayBar is intended to be used to make a day bar using the session template and data of the underlying data series. This is because many users try to avoid using the provider filtered day bar. The provider filtered day bar does not return the open of the first tick of the day and instead uses an open that is decided by them. Also, the provider filtered day bar is forced to use the session template they have decided is used for the instrument and this cannot be changed.
To get around this, Bars.GetDayBar was developed. This is to be used when the provider filtered day bar will not work as the data for a script.
For your script, you are wanting to use the daily bar that is filtered by the provider. Because of this I would not recommend that you use Bars.GetDayBar. Instead the modifications I have made will give you the data you would like by using a secondary data series.Attached Files
Leave a comment:
-
Hi Chelsea,
Thanks for the follow-up and summary, which is always interesting.
In summary, my perspective and current understanding is:
As an end user I prefer to use NT as effortlessly as possible with minimum time devoted to trying to understand how it does what it does.
I won’t be able to do as proposed in this thread until if/when a second Bars.GetDayBar function is written by the software development team.
A request has been submitted to program development to write the new Bars.GetDayBar function. I will receive a tracking number when it is available.
Leave a comment:
-
Hello joemiller,
The issue here is the discrepancy between a Daily bar that is filtered by the data provider and a 1440 minute bar using the same Forex template that may not show the same open price.
Daily bars are created by the data provider and will not always match the open high low or close of intraday data.
Please open a chart with 1440 minute bars using the Forex template and a daily chart using the same Forex template. Compare the open prices looking back for a few weeks.
For example with a $EURUSD Daily bar on FXCM the bar for yesterday 8/26 opens at 1.3375 while a 1440 minute bar with the same template opens at 1.3378 a difference of 3 ticks.
Please open two charts to the $EURUSD. One with a daily bar and one with a 1440 minute bar. Please compare the open prices for these bars for August 26th 2013.
Regarding Bars.GetDayBar tool with NinjaTrader, this is from our help guide.
Returns a Bar object that represents a trading day whose properties for open, high, low, close, time and volume can be accessed. This bar is a virtual bar built off of the underlying data series. In some cases, the trading day bar can be used to represent a daily bar. Since this bar is virtual, its property values are calculated based on session definitions contained in the trading day only. This does not necessarily represent the actual day.
http://www.ninjatrader.com/support/h.../getdaybar.htm
This means that you can have Bars.GetDayBar reference the provider made daily bar if you use a day bar for your chart.
Leave a comment:
-
Hi Bertrand,
If it takes 58 posts to get to this point without being advised of an easy fix, plus a lot of time spent by me and NT, then something needs to be fixed. I will try to understand and do what you advise [which is more mickey mousing around]. Any additional detailed coding examples to accomplish the goal will be appreciated.
An undetected/unrealized discrepancy between the indicator daily and hourly bars could even potentially generate lawsuits claiming use of faulty software tools provided by NT. People sue all the time on flimsier grounds. [There is no threat from me to do so. I am not one of those, plus all my trading using NT has been simulated, not real.]
Leave a comment:
-
Hi Joe, reviewing this suggestion made I guess I'm not clear on why this would be beneficial, the provider native daily bar series could be for example added through the Add() method in the script's Initialize() and you could reference the data then or have an indicator method run on this series as well.
Leave a comment:
-
Hi joemiller,
I have submitted this feature request for a second Bars.GetDayBar which uses the data provider filtered Daily Bar.
I cannot comment on when or if this will be implemented in NinjaTrader, that will be up to our development team to decide.
I will give you a tracking number for this request when I receive one from development so that you can check in on the progress at a later time.
Thank you for the great suggestion to improve NinjaTrader.
Leave a comment:
-
Re: Would you like me to submit this request in your behalf?
Definitely yes, please do. Thank you and much appreciated. How long do you think it will take until implementation?
Re: adding TraceOrders = True
I am only interested in seeing results as reflected in the analyzer profit graph, which can only be achieved using minute bars, so I think there is a need for the minute bar analysis. The profit target/stop loss was only an example of the kind of info hidden in a day bar which can only be exposed with minute bar analysis.
Leave a comment:
-
Hello,
Bars.GetDayBar returns the Open, High, Low, and Close for a 1440 Minute Bar (non-filtered Day Bar).
This is the intended functionality of Bars.GetDayBar.
If you would like Bars.GetDayBar to return the OHLC for the filtered day bar (filtered by the data provider) I can submit a feature request in your behalf to include a second type of GetDayBar that uses the filtered day bar.
Would you like me to submit this request in your behalf?
In response to your statement mentioning that on the daily bar that you are running this strategy on you would like to know if the stop or the target is hit, adding TraceOrders = True will allow you to see if it is the stop or the target is hit. If you are wanting some indication of when this happens, then add logic to the the OnExecution part of your script to print or draw when the stop or target is filled.
There is no need to have intra-bar granularity to see if the profit target or stop loss is being filled.
Leave a comment:
-
I know that day bars are giving me the correct indicator so I need to then proceed from there.
I know that 1440 minute bars and 1 minute bars result in indicators that that are equal to each other, which sounds great, but they are not equal to the day bar indicator so they are of no use.
My indicator is a function of yesterday’s bar open, high, low, close. If those open, high, low, close values are different for minute bars and day bars then there is no point in running the minute bar back test.
I must continue trading on a day bar basis. I don’t have the time or interest to manage trades on an intra day basis. My strategy is to enter GTC orders. When position close out occurs [on the first day or any day thereafter] then I am flat for the remainder of the day, entering new orders the next day. Valid minute bar analysis will tell me whether or not, for instance, the worst case scenario of always hitting the stop loss price first is likely to occur.
The implication to me is that getdaybar values of open, high, low, close do just simply that…and I don’t understand why that cannot simply be done, all the values are there and available. Looks to me like NT does hundreds of things seemingly far more complicated than that.
Leave a comment:
-
joemiller,
I am saying that you should use 1440 minute bars for running this strategy and to stop using day bars.
Day bars are shaped by the data provider.
Regarding not know if the stop or target is hit add TraceOrders = true; to the initialize part of your script.
This will let you know the names of the orders being filled.
Leave a comment:
-
In my strategy analyzer back testing using day bars, on many days both the profit limit and stop loss prices are hit. Not knowing which is hit first, the conservative guess is to assume the stop loss price is touched first.
When I have made a back test using day bars, I then need to back test using minute bars. The use of minute bars presents the answer to which was hit first during the day to close out the position.
Are you suggesting that simply running a one minute bar back test will accomplish my objective?
[I would of course use minute bars rather than 60 minutes, 360 minute, 1440 minute bars etc. Those longer duration bars have been used only to try to simplify our discussion.]
Leave a comment:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
60 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
148 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
284 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Leave a comment: