Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Testing OHLC, pivots and session breaks
Collapse
X
-
Some suggestions for the Pivot Indicator
Thanks again for the new Pivots Indicator which is really useful. After checking it I have a few suggestions - maybe not all of them are correct as I am just a C#/NinjaScript beginner. All points refer to the CalcfromIntraDayData mode:
- False Pivots returned - Line 104: What does dailyBars.GetBar(Time[0].AddSeconds(-1).Date)) return, if Time[0] is on a Saturday or Sunday? This can easily happen on intraday charts. False values for Pivots disappeared after I had added a condition that excluded Saturdays and Sundays. What about holidays?
- The Narrow Lines Monday Problem - Line 109: Monday pivots can be calculated from Saturday or Sunday data. To make sure that Monday pivots are always calculated from Friday intraday data I added “&& Time[0].AddSeconds(-1).Date != currentDate && marketTime.Date.DayOfWeek != DayOfWeek.Saturday & currentDate.DayOfWeek != DayOfWeek.Sunday” in the Daily Line.
- Test for historical backfill - Line 113: firstPeriod condition of previous indicator version should be maintained for CalcfromIntraDayData to prevent calculation of false Pivots if historical data is insufficient.
- RoundUpTimeToPeriodTime - Line 290: Would “if (pivotRange == PivotRange.Weekly) return time.AddDays(6 - Convert.ToInt16(time.DayOfWeek)).Date;” work as well?
Comment
-
Hi Harry !
1) False Pivots returned
This assignment is not used, when type is CalcFromIntraDayData, because existsDailyData can only be true for DailyData, and when there are >= 1 bar.
But you may be right for type DailyData. I'll look into that.
2) The Narrow Lines Monday Problem
In chart properties, you can set the ExcludeWeekend property to true. This resolves the Satday & Sunday problem.
3) Test for historical backfill
Sorry, don't know what you mean with 'firstPeriod condition. And in which version ?
4) RoundUpTimeToPeriodTime
Unfortunately we can not comment on the correct of your code. We suggest using our code if you want to be sure.
Thanks for your feedback,
ChristianChristianSenior Software Developer
Comment
-
Hi Christian,
(1) Of course, only for DailyBars method.
(2) You would not want to exclude week-end data,
- because for ES/ER2 etc. the Sunday afternoon session is part of the normal Monday session
- if you are located further East (depends on your local time zone) the Friday evening session might leak into Saturday
(3) Can't find it either. haven't collected the version. When Pivots are calculated form IntraDayData the first calculation of Pivots would yield false values, because calculated from incomplete period. For example if you have intraday backfill going back for 2 months until mid-december, monthly pivots should show up only from February 1, but not January 1. This problem is only specific to CalcfromIntradayData, does not occur with DailyBars...
But again congratulations for the DailyBars method. That did solve my problem - and I do not need other charting software to check Pivots, I feel safe with NT now!
Comment
-
Originally posted by Harry View PostDierk, I have a live account with IB. You cannot connect to IB live accounts during the week-end before Sunday 12 pm ET.
I am also using a simulation account that I created within my live account and which I use for testing. Live and simulation account have the same market data.
Hi Harry,
does this mean you are able to download historical data from IB during weekends? Could you please explain how you created this simulation account at IB? Thanks in advance.
Comment
-
DailyBars option of NT 6.5.10 Pivot Indicator
NT occasionally hangs, when I am setting the Pivot indicator (modified version) to DailyBars. I just saw that the latest version of the NT pivot indicator has been modified. Here is my question: If intradayBarTime (line 111) is a Sunday or Holiday (may happen because local PC time would be different from exchange time), what would be the value for dailyBar (line 112)?
Comment
-
Hi Harry !
1) Can you please send me (christian AT ninjatrader DOT com) your 'Logs and Traces' via the Mail to support function, and point me to a timestamp, where one of these hangups occured ?
2) Do you recall the steps you did, when this happened ? Or better, can you provide me with a reproducable scenario ?
3) To your question: the if block starting with line 114-122 will make sure, that the right dailyBar is used here. This will be the last day for which a daily bar is set.
Kind regards,
ChristianChristianSenior Software Developer
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by love2code2trade, Today, 01:45 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 01:45 PM | ||
Started by 09try, 03-29-2024, 01:27 PM
|
9 responses
81 views
0 likes
|
Last Post
by ntcat
Today, 01:16 PM
|
||
Started by ninza33, Today, 06:28 AM
|
4 responses
17 views
0 likes
|
Last Post
by ninza33
Today, 12:38 PM
|
||
Started by ScottWalsh, Yesterday, 04:29 PM
|
4 responses
18 views
0 likes
|
Last Post Today, 12:00 PM | ||
Started by Gibranes, Today, 10:05 AM
|
4 responses
20 views
0 likes
|
Last Post
by Gibranes
Today, 11:54 AM
|
Comment