X

## Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com

 08-06-2012, 11:57 AM #31 alabell Senior Member   Join Date: Jun 2011 Posts: 214 Thanks: 34 Thanked 10 times in 10 posts while not entirely intuitive, this makes sense... and so now i would need to do the math for all of s1, r1, s2 and r2.... where can i find these formulae, either in math or in code, as NT calculates them, as I know that there are certain different methods of doing this.
 08-06-2012, 12:02 PM #32 NinjaTrader_Joydeep NinjaTrader Customer Service     Join Date: Dec 2011 Location: India Posts: 3,286 Thanks: 580 Thanked 546 times in 541 posts Hello Andrew, There are several ways to calculate the Pivot values. Please refer to the below site which describes the most common method to calculate the pivot points http://www.mypivots.com/articles/art...aspx?artnum=36 Joydeep M. NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 08-08-2012, 03:45 PM #33 alabell Senior Member   Join Date: Jun 2011 Posts: 214 Thanks: 34 Thanked 10 times in 10 posts Uing the methodology described, I went about creating my own metrics. Day bars are indexed as 1 Variables are doubles protected override void OnBarUpdate() { high = Highs[1][0]; low = Lows[1][0]; close = Closes[1][0]; range = high - low; myPP = ((high + low + close) / 3); myR1 = (2 * myPP) - low; myR2 = myPP + range; myS1 = (2 * myPP) - high; myS2 = myPP - range; //Returns PP value pivotPoint = ((this.PriorDayOHLC().PriorClose[0] + this.PriorDayOHLC().PriorHigh[0] + this.PriorDayOHLC().PriorLow[0]) / 3); //Returns R1 value resistance1 = ((2 * pivotPoint) - this.PriorDayOHLC().PriorLow[0]); //Returns R2 value resistance2 = pivotPoint + (this.PriorDayOHLC().PriorHigh[0] - this.PriorDayOHLC().PriorLow[0]); //Returns S1 value support1 = ((2 * pivotPoint) - this.PriorDayOHLC().PriorHigh[0]); //Returns S2 value support2 = pivotPoint - (this.PriorDayOHLC().PriorHigh[0] -this.PriorDayOHLC().PriorLow[0]); Print(Time[0].ToString() + " R2: " + resistance2.ToString() + " R1: " + resistance1.ToString() + " PP: " + pivotPoint.ToString() + " S1: " + support1.ToString() + " S2: " + support2.ToString()); Print(Time[0].ToString() + "myR2: " + myR2.ToString() + "myR1: " + myR1.ToString() + "myPP: " + myPP.ToString() + "myS1: " + myS1.ToString() + "myS2: " + myS2.ToString()); ____________________________________________ these numbers do not yield identical same pivot/support/resist numbers. at this point i am having issues with the amount of time I have spent, because I keep coding and I can not get a the numbers to match based on the manner inw hich I have been advised. This is not a complicated piece of code, please advise. Thanks, Andrew
 08-08-2012, 05:45 PM #34 NinjaTrader_Matthew NinjaTrader Customer Service     Join Date: Apr 2010 Location: Denver, CO, USA Posts: 4,777 Thanks: 158 Thanked 565 times in 556 posts Can you please clarify who you connect to for data? This is displayed in the bottom left hand corner of the NinjaTrader Control Center. If you disconnect from your data provider, and connect the Kinetick End of Day connection, do you get the results you are looking for? Matthew NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 08-08-2012, 06:27 PM #35 alabell Senior Member   Join Date: Jun 2011 Posts: 214 Thanks: 34 Thanked 10 times in 10 posts I am using kinetick at all times.
 08-09-2012, 04:08 AM #36 NinjaTrader_Joydeep NinjaTrader Customer Service     Join Date: Dec 2011 Location: India Posts: 3,286 Thanks: 580 Thanked 546 times in 541 posts Hello alabell, The below code calculates the pivots based on daily bars Code: `pivotPoint = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).PP[0];` While this code is calculating the pivots based on intraday bars. Code: `pivotPoint = ((this.PriorDayOHLC().PriorClose[0] + this.PriorDayOHLC().PriorHigh[0] + this.PriorDayOHLC().PriorLow[0]) / 3);` As such there can be differences as the data set differs. Also please refer to this post which discusses this in details http://www.ninjatrader.com/support/f...ead.php?t=4676 Joydeep M. NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 08-09-2012, 07:13 AM #37 alabell Senior Member   Join Date: Jun 2011 Posts: 214 Thanks: 34 Thanked 10 times in 10 posts so now we are back to the original formulae which were quoted to me a week or two ago, so please answer this question for me: -- If a daily bar is, as it sounds, a one day bar, with a high, low open and close like I might see in a 2 year daily chart that would have aprox. 500 bars: what is the proper definition of an intraday bar? Thank you kindly.
 08-09-2012, 07:23 AM #38 NinjaTrader_Joydeep NinjaTrader Customer Service     Join Date: Dec 2011 Location: India Posts: 3,286 Thanks: 580 Thanked 546 times in 541 posts Hello Andrew, Intraday bars will be the bars built from either tick data or minute data. Joydeep M. NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 08-09-2012, 07:44 AM #39 alabell Senior Member   Join Date: Jun 2011 Posts: 214 Thanks: 34 Thanked 10 times in 10 posts pivotPoint = ((this.PriorDayOHLC().PriorClose[0] + this.PriorDayOHLC().PriorHigh[0] + this.PriorDayOHLC().PriorLow[0]) / 3); If the above code is built from intraday bars (minute or tick bars), are these bars then scanned to find a day's high, low and close from which to build your pivot point? alternatively, a day bar simply records a H,L,O,C for the specific date in question? is this the difference? If yes, I suppose I get it, but shouldn't they be the same? if no, then I don't understand how the above code would work to calculate "yesterday's pivot point". Thanks as always.
 08-09-2012, 08:05 AM #40 NinjaTrader_Joydeep NinjaTrader Customer Service     Join Date: Dec 2011 Location: India Posts: 3,286 Thanks: 580 Thanked 546 times in 541 posts Hello Andrew, OHLC calculated from intraday bar can differ from Daily bars. There are several factors like: Daily bars are generally based on RTH session while OHLC built from intraday data uses the charts session template (which can be RTH or ETH or any other custom template) to calculate the OHLC. The closing price of a daily bar is based on the volume weighted average price of the last 30 minutes. In case of intraday data it is the last traded price. The pivots will be calculated anyway, based on what data you provide. If the data set differs the pivot values too will differ. Joydeep M. NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 The following user says thank you to NinjaTrader_Joydeep for this post:
08-09-2012, 08:19 AM   #41
alabell
Senior Member

Join Date: Jun 2011
Posts: 214
Thanks: 34
Thanked 10 times in 10 posts

Quote:
 Originally Posted by NinjaTrader_Joydeep Hello Andrew, OHLC calculated from intraday bar can differ from Daily bars. There are several factors like: Daily bars are generally based on RTH session while OHLC built from intraday data uses the charts session template (which can be RTH or ETH or any other custom template) to calculate the OHLC. The closing price of a daily bar is based on the volume weighted average price of the last 30 minutes. In case of intraday data it is the last traded price. The pivots will be calculated anyway, based on what data you provide. If the data set differs the pivot values too will differ.

The Close of a daily bar is the VWAP of the last half hour? I had no idea. This surprised me greatly.

 08-09-2012, 08:43 AM #42 NinjaTrader_Joydeep NinjaTrader Customer Service     Join Date: Dec 2011 Location: India Posts: 3,286 Thanks: 580 Thanked 546 times in 541 posts Hello Andrew, To be more specific, closing price is the Settlement price in a daily bar. Joydeep M. NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News and Announcements     News and Announcements Application Technical Support     ATM Strategies (Discretionary Trading)     Automated Trading     Charting     Connecting     Installation and Licensing     Market Analyzer     Miscellaneous Support         Historical Version 7 Beta Threads             Critical Information - Please review             Version 7 Beta General Questions & Bug Reports         Historical NinjaTrader 6.5 Archive             Historical NinjaTrader 6.5 Beta Threads     Strategy Analyzer     SuperDOM and other Order Entry Windows NinjaScript Development Support     General Programming     Indicator Development     Strategy Development NinjaScript Educational Resources     Reference Samples     Tips NinjaScript File Sharing     NinjaScript File Sharing Discussion     Version 7 Indicators     Version 7 Strategies     Version 7 Miscellaneous Suggestions and Feedback     Suggestions And Feedback

 Similar Threads Thread Thread Starter Forum Replies Last Post imagineer Indicator Development 1 06-07-2010 12:56 PM andrew100 Strategy Development 18 02-17-2010 07:42 AM saeed Charting 3 12-22-2009 08:03 AM blazer Indicator Development 2 10-11-2009 04:12 AM mballagan Indicator Development 6 10-01-2009 10:44 AM

All times are GMT -6. The time now is 03:38 AM.

 -- Fixed Width ---- Fluid Width NinjaTrader Support Forum - Archive - Top