NinjaTrader Support Forum Pivots - Intermediate (NT7)

 Indicator Development Support for the development of custom indicators using NinjaScript.

 04-11-2018, 06:33 PM #1 sandman Senior Member   Join Date: Jun 2010 Posts: 595 Thanks: 144 Thanked 52 times in 42 posts Pivots - Intermediate (NT7) I am using the standard NinjaTrader provided pivots which are usually sufficient. (I have modified it "RoundedToTickSize" which is useful for instruments such as 6J which shows much more decimals on the chart than on the DOM.) But sometimes the gap between these pivots is quite huge and some "intermediate" pivot lines in between PP and R1 and PP and S2 would be useful. I'd like to give it a go and create these and if there is interest for this I can then post the result in the files sharing section. Note this would be for NT7. I would appreciate if someone could tell me a good formula to calculate these mid-pivot lines? The standard ones are as follows. pp = (currentHigh + currentLow + currentClose) / 3; s1 = 2 * pp - currentHigh; s2 = pp - (currentHigh - currentLow); r1 = 2 * pp - currentLow; r2 = pp + (currentHigh - currentLow); sandman
 04-12-2018, 06:09 AM #2 sandman Senior Member   Join Date: Jun 2010 Posts: 595 Thanks: 144 Thanked 52 times in 42 posts I got a formula for mid pivots and have used one for testing purposes. For NT7 that is. I inserted it into the code, it compiles with no errors but it does not show up any pivot at all. What can/should I do? What I did specifically is to take the original NT indicator Pivots, and saved it under a new name called PivotsNTPlus. I then added: in the Variables Section: private double rmid = 0; in the Initialize: Add(new Plot (Color.Black, "RMID")); in OnBarUpdate: rmid = 0.5*(pp + r1); and RMID.Set(rmid); and further down in Properties region: [Browsable(false)] [XmlIgnore] public DataSeries RMID { get { return Values[7]; } } sandman
 04-12-2018, 06:28 AM #3 NinjaTrader_Paul NinjaTrader Customer Service     Join Date: May 2014 Posts: 4,173 Thanks: 437 Thanked 1,091 times in 1,045 posts Hello sandman, Thanks for your post(s). When you applied the indicator, do you see any error messages posted in the "Log" tab of the control center related to the indicator? PaulNinjaTrader Customer ServiceUse Kinetick, NinjaTrader’s preferred market data service - Learn MoreFree online training events - View Schedule
 04-12-2018, 06:39 AM #4 sandman Senior Member   Join Date: Jun 2010 Posts: 595 Thanks: 144 Thanked 52 times in 42 posts Yes, Paul. It says: Error on plotting indicator: Please check the OnBarUpate or the Plot method: Index was outside the bounds of the array.
04-12-2018, 09:45 AM   #6
sandman
Senior Member

Join Date: Jun 2010
Posts: 595
Thanks: 144
Thanked 52 times in 42 posts

Paul. I vaguely get what you are saying but have a difficulty transferring it into code (I am not really a programmer). I counted 6 arrays total in the original version. And I added 1 for the new mid-pivot makes 7 total, yet you saying you count "only" 7 seems to indicate it now needs 8. ???

Could you look over the full code which I have attached as a cs file and indicate where I have to add what?

sandman
Attached Files
 PivotsToTickSizePlus.cs (27.4 KB, 16 views)

 The following user says thank you to NinjaTrader_Paul for this post:
 04-12-2018, 10:01 AM #8 sandman Senior Member   Join Date: Jun 2010 Posts: 595 Thanks: 144 Thanked 52 times in 42 posts Paul. Thank you very much. Needless to say that worked immediately. sandman
 The following user says thank you to sandman for this post:
04-12-2018, 02:59 PM   #9
sandman
Senior Member

Join Date: Jun 2010
Posts: 595
Thanks: 144
Thanked 52 times in 42 posts

Paul.
I am finished with it. I call it PivotsRoundedtoTickSizePlus. Firstly, rounding to tick size is useful for instruments such as 6J. "Plus" because I added pivots in between PP and S1, S1 and S2 and S2 and S3 (same for Resistance). I also added in the Woodie S1 and R1. These additional pivots can be turned on or off with "Addtl pivots" in the Parameters section of the indicator menu.

Before posting it in the files sharing section I thought I would check to see if you would test it to see there is nothing untoward that crept in. And secondly I'd like to make sure I am not violating something as NinjaTrader actually holds the copyright on the indicator. I included a note in that respect in the beginning of the code.

sandman
Attached Files
 PivotsToTickSizePlus.zip (6.4 KB, 7 views)

 04-20-2018, 01:56 AM #11 sandman Senior Member   Join Date: Jun 2010 Posts: 595 Thanks: 144 Thanked 52 times in 42 posts Paul. Thanks. I posted it now (though I took the Woodie Pivots out again). Thanks again for your help. sandman
 The following user says thank you to sandman for this post:

 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 NinjaTrader 8     Platform Technical Support     Add-On Development     Indicator Development     Strategy Development NinjaTrader 7     Platform Technical Support     General Development     Indicator Development     Strategy Development NinjaScript File Sharing     NinjaScript File Sharing Discussion     Version 8 Add-Ons     Version 8 Indicators     Version 8 Strategies     Version 7 Indicators     Version 7 Strategies     Version 7 Miscellaneous NinjaScript Educational Resources     Reference Samples     Tips Suggestions and Feedback     Suggestions And Feedback Historical Beta Archive     Version 8 Beta

 Similar Threads Thread Thread Starter Forum Replies Last Post TazoTodua Indicator Development 19 09-13-2018 12:45 AM aligator Platform Technical Support 11 02-11-2011 08:07 AM Drakmyre Indicator Development 4 10-04-2008 09:58 PM

All times are GMT -6. The time now is 11:35 AM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.