NinjaTrader Support Forum  
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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

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

Reply
 
Thread Tools Display Modes
Old 11-10-2011, 04:11 AM   #1
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default LBR PaintBars

Can anyone program the following LBR PaintBars indicators for ninja, please?

http://team.thinkorswim.com:7001/man...PaintBars.html

Thanks.
Everest is offline  
Reply With Quote
Old 11-10-2011, 04:23 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

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
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 11-20-2011, 02:14 PM   #3
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

post a sample chart with the inputs used. It looks simple from the description. I will give it a try.
sherazwaqar is offline  
Reply With Quote
The following user says thank you to sherazwaqar for this post:
Old 11-20-2011, 10:53 PM   #4
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default

Here it is, it is very simple actually

http://s50.radikal.ru/i127/1111/77/a5f6540e7170.png
Last edited by Everest; 11-21-2011 at 01:16 AM.
Everest is offline  
Reply With Quote
Old 11-21-2011, 01:55 AM   #5
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

I think it should do let me know if something needs to be corrected
Attached Images
File Type: jpg ES lbrPaintBars.jpg (161.9 KB, 52 views)
Attached Files
File Type: zip lbrPaintBars.zip (5.8 KB, 12 views)
sherazwaqar is offline  
Reply With Quote
The following user says thank you to sherazwaqar for this post:
Old 11-21-2011, 02:55 AM   #6
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default

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.
Everest is offline  
Reply With Quote
Old 11-21-2011, 04:04 AM   #7
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

I know where the problem is .. I will fix it in a little bit ...
sherazwaqar is offline  
Reply With Quote
The following user says thank you to sherazwaqar for this post:
Old 11-21-2011, 06:45 AM   #8
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

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.
Attached Files
File Type: zip lbrPaintBars2.zip (5.8 KB, 17 views)
sherazwaqar is offline  
Reply With Quote
The following 2 users say thank you to sherazwaqar for this post:
Old 11-21-2011, 10:46 AM   #9
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default

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);
Everest is offline  
Reply With Quote
Old 11-21-2011, 11:08 AM   #10
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

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.
sherazwaqar is offline  
Reply With Quote
The following user says thank you to sherazwaqar for this post:
Old 11-21-2011, 11:16 AM   #11
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default

one moment
http://s017.radikal.ru/i430/1111/9f/99f78ce914c2.png
Last edited by Everest; 11-21-2011 at 11:21 AM.
Everest is offline  
Reply With Quote
Old 11-21-2011, 11:32 AM   #12
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

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.
sherazwaqar is offline  
Reply With Quote
The following user says thank you to sherazwaqar for this post:
Old 11-21-2011, 11:41 AM   #13
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default

Can you do it, please ?
Everest is offline  
Reply With Quote
Old 11-21-2011, 11:57 AM   #14
sherazwaqar
Member
 
Join Date: Oct 2011
Posts: 50
Thanks: 4
Thanked 8 times in 7 posts
Default

Sure. Here it is ...
Attached Files
File Type: zip lbrPaintBars3.zip (6.1 KB, 43 views)
sherazwaqar is offline  
Reply With Quote
The following user says thank you to sherazwaqar for this post:
Old 11-21-2011, 12:10 PM   #15
Everest
Junior Member
 
Join Date: Apr 2011
Posts: 7
Thanks: 8
Thanked 0 times in 0 posts
Default

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
Everest is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump

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


All times are GMT -6. The time now is 01:41 PM.