![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Can anyone program the following LBR PaintBars indicators for ninja, please?
http://team.thinkorswim.com:7001/man...PaintBars.html Thanks. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
Welcome here Everest, if no one takes it up here as a project you could always contact a certified NinjaScript consultant from this list :
http://www.ninjatrader.com/partners#...pt-Consultants
Bertrand
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Last edited by Everest; 11-21-2011 at 01:16 AM.
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Hey, great thank you. it is almost done, but indicator is not showing regular bars in ninja. here is two screenshots of the same period.
Screen from Thinkorswim http://s017.radikal.ru/i425/1111/20/d3dbb0d7e514.png Screen from Ninja http://s017.radikal.ru/i411/1111/da/307fce9b1e1c.png (select, copy and paste then)
Last edited by Everest; 11-21-2011 at 03:58 AM.
|
|
|
|
|
|
#8 |
|
Member
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
|
updated indicator attached ...
From the second chart you posted, I realized that the indicator is not supposed to highlight the bars that are in b/w the two Upper and Lower Volatility plots ... so I made the adjustments. Can you give some information, how you use this indicator? I think you are using it to filter out ranging market areas. |
|
|
|
|
The following 2 users say thank you to sherazwaqar for this post: |
|
|
|
#9 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Sherazwaqar, thank you for your efforts, you are very close, but it still has differences, but they are very little - 1 or 2 bars.
Here is how it looks like in thinkorswim code, if it tells you something that will be of help.: # @new # @reference # # thinkorswim, inc. (c) 2011 # input HLLength = 16; input ATRLength = 9; input factor = 2.5; input paintBars = yes; def AATR = factor * Average(AvgTrueRange(high, close, low, ATRLength), ATRLength); def band1 = Lowest(low, HLLength) + AATR; def band2 = Highest(high, HLLength) - AATR; plot UpperVolatility = close > band1 and close > band2; plot LowerVolatility = close < band1 and close < band2; UpperVolatility.SetPaintingStrategy(PaintingStrate gy.BOOLEAN_POINTS); UpperVolatility.SetLineWeight(3); UpperVolatility.SetDefaultColor(Color.GREEN); UpperVolatility.hide(); LowerVolatility.SetPaintingStrategy(PaintingStrate gy.BOOLEAN_POINTS); LowerVolatility.SetLineWeight(3); LowerVolatility.SetDefaultColor(Color.RED); LowerVolatility.hide(); DefineGlobalColor("Bullish", Color.GREEN); DefineGlobalColor("Bearish", Color.RED); AssignPriceColor(if !paintBars then Color.CURRENT else if UpperVolatility then globalColor("Bullish") else if LowerVolatility then globalColor("Bearish") else Color.CURRENT); |
|
|
|
|
|
#10 |
|
Member
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
|
I am employing essentially the similar logic as you have posted in the thinkscript code. Can u please post a chart from the thinkorswim terminal for ES Dec Contract. Also please mention the time template used.
|
|
|
|
|
The following user says thank you to sherazwaqar for this post: |
|
|
|
#11 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Last edited by Everest; 11-21-2011 at 11:21 AM.
|
|
|
|
|
|
#12 |
|
Member
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
|
Well I have scanned through the code, and the reason for the differences for 1 or bar is that I have put in a condition in indicator to return 0 values if there are less 16 bars (length for calculating the highest high and lowest low), if i get rid of that condition, the charts are similar.
In my view the indicator should not be calculating any values until it has 16 bars on the chart, because the highest high and lowest low returned are not in conformity with the indicator logic. If you like I can repost the indicator ... also if you increase the number of days on your thinkorswim terminal, the number of volatility bands will change as it will have more bars for the calculation of first value, and for the ninjascript that I have written values will remain the same, as it is already employing the logic as it should be. |
|
|
|
|
The following user says thank you to sherazwaqar for this post: |
|
|
|
#13 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Can you do it, please ?
|
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
|
Sherazwaqar, I use it to find my entry points after Divergence has happened. Market makes new high, but momentum indicator shows that momentum is slowing down and it doesn't make a new high. After this I start looking for paintbar to change color and this is my entry.
Example: http://s39.radikal.ru/i086/1111/85/364de9abb0c1.png |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Paintbars and Candles | Mindset | Suggestions And Feedback | 12 | 09-07-2011 11:52 AM |
| NT7 and NT6.5 Paintbars being redrawn | mefTrader | Indicator Development | 8 | 07-22-2010 08:26 AM |
| Paintbars based on 4 indicators all agreeing | simpletrades | Indicator Development | 17 | 08-22-2009 09:09 PM |
| PaintBars | pjwinner | Indicator Development | 13 | 09-28-2008 06:42 AM |
| PaintBars | jojojo | General Programming | 9 | 08-10-2007 10:56 AM |