NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

Reply
 
Thread Tools Display Modes
Old 01-19-2008, 04:42 PM   #1
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 4 times in 4 posts
Default Inside BAr

Attach is an Indicator to help you identify the inside bars, includes an alert.(you can turn on/off the alert and modify the inside bar color)

Regards
Attached Images
File Type: jpg InsideBar.jpg (63.7 KB, 496 views)
Attached Files
File Type: zip InsideBAr.zip (2.0 KB, 291 views)
Last edited by PrTester; 01-28-2008 at 05:11 PM.
PrTester is offline  
Reply With Quote
The following user says thank you to PrTester for this post:
Old 01-19-2008, 05:52 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,460
Thanks: 1
Thanked 159 times in 82 posts
Default

Cool. Thanks for the contribution.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-28-2008, 03:33 PM   #3
NinjaCustomer
Senior Member
 
Join Date: Jan 2008
Posts: 143
Thanks: 0
Thanked 0 times in 0 posts
Default

I am new to NinjaScript... how do I import this indicator?
NinjaCustomer is offline  
Reply With Quote
Old 01-28-2008, 03:54 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,349
Thanks: 10
Thanked 168 times in 99 posts
Default

Unfortunately, the format (.ntns) was temporarily supported with an older beta version. We have since reverted this change.

If PrTester is willing to repost this with the latest beta version, it will be a (.zip) file which you can import via File > Utilities > Import NinjaScript.
NinjaTrader_Ray is offline  
Reply With Quote
Old 01-28-2008, 05:12 PM   #5
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by NinjaTrader_Ray View Post
Unfortunately, the format (.ntns) was temporarily supported with an older beta version. We have since reverted this change.

If PrTester is willing to repost this with the latest beta version, it will be a (.zip) file which you can import via File > Utilities > Import NinjaScript.
It's posted with a zip format.

Regards,
PrTester is offline  
Reply With Quote
Old 01-28-2008, 05:14 PM   #6
NinjaCustomer
Senior Member
 
Join Date: Jan 2008
Posts: 143
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by PrTester View Post
It's posted with a zip format.

Regards,
cool, thanks!
NinjaCustomer is offline  
Reply With Quote
Old 03-04-2008, 04:32 PM   #7
Pipqueen
Member
 
Join Date: Jun 2007
Posts: 77
Thanks: 3
Thanked 0 times in 0 posts
Default

Thank you! I Love it!

Quote:
Originally Posted by PrTester View Post
Attach is an Indicator to help you identify the inside bars, includes an alert.(you can turn on/off the alert and modify the inside bar color)

Regards
Pipqueen is offline  
Reply With Quote
Old 11-24-2008, 10:01 AM   #8
ryebank
Senior Member
 
Join Date: Nov 2008
Posts: 113
Thanks: 0
Thanked 0 times in 0 posts
Default Inside Bar

Great indicator thanks for the source code.

I was wondering if it could be tweaked slightly... If it's a down inside bar then have it one color, if it's an up inside bar then have it another?

Thanks
Rye
ryebank is offline  
Reply With Quote
Old 11-24-2008, 11:36 AM   #9
ryebank
Senior Member
 
Join Date: Nov 2008
Posts: 113
Thanks: 0
Thanked 0 times in 0 posts
Default Inside Bar Calculator

I've been watching this indicator identify inside bars but i've noticed that it doesn't always identify them.
Attached Files
File Type: zip inside bar.zip (29.0 KB, 84 views)
Last edited by ryebank; 11-24-2008 at 11:39 AM.
ryebank is offline  
Reply With Quote
Old 11-24-2008, 02:41 PM   #10
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by ryebank View Post
I've been watching this indicator identify inside bars but i've noticed that it doesn't always identify them.
ryebank,

This logic behind the indi is the following :

First Calculate 4 previous range

range1 = Math.Abs(Close[0]-Open[0]);
range2 = Math.Abs(Close[1]-Open[1]);
range3 = Math.Abs(Close[2]-Open[2]);
range4 = Math.Abs(Close[3]-Open[3]);
Then

Check for InsideBar pattern

if(High[0] < High[1] && Low[0] > Low[1]
&& range4 < range3
&& range4 < range2
&& range4 < range1

where [0] is the Current Bar, [1] is the previous Bar and so on.

Hope that help.
PrTester is offline  
Reply With Quote
Old 11-24-2008, 03:07 PM   #11
ryebank
Senior Member
 
Join Date: Nov 2008
Posts: 113
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi PrTester

Bear with we because i don't know how to program but does this mean i can change the code to calculate on 1 range ie 1 bar:

Change - if (CurrentBar < 4) return
To - if (CurrentBar < 1) return

range1 = Math.Abs(Close[0]-Open[0]);
range2 = Math.Abs(Close[1]-Open[1]);
Delete range3 and range4

Then

Check for InsideBar pattern

if(High[0] < High[1] && Low[0] > Low[1])
ryebank is offline  
Reply With Quote
Old 11-24-2008, 03:31 PM   #12
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by ryebank View Post
Hi PrTester

Bear with we because i don't know how to program but does this mean i can change the code to calculate on 1 range ie 1 bar:

Change - if (CurrentBar < 4) return
To - if (CurrentBar < 1) return

range1 = Math.Abs(Close[0]-Open[0]);
range2 = Math.Abs(Close[1]-Open[1]);
Delete range3 and range4

Then

Check for InsideBar pattern

if(High[0] < High[1] && Low[0] > Low[1])
Yes you are correct, just delete the other range and you will be ok.
PrTester is offline  
Reply With Quote
Old 11-24-2008, 05:43 PM   #13
ryebank
Senior Member
 
Join Date: Nov 2008
Posts: 113
Thanks: 0
Thanked 0 times in 0 posts
Default Inside Bar

Thanks PrTester

I've made the changes and it now works how i'd like it to.

Can i ask, what is the relevance of having a range of 4 bars and only indentifying an inside bar (IB) based on this?

Could you, if possible, help me to modify the code so i can have different colours for for up and down IB's?

Thanks
Rye
ryebank is offline  
Reply With Quote
Old 11-24-2008, 06:55 PM   #14
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by ryebank View Post
Thanks PrTester

I've made the changes and it now works how i'd like it to.

Can i ask, what is the relevance of having a range of 4 bars and only indentifying an inside bar (IB) based on this?

Could you, if possible, help me to modify the code so i can have different colours for for up and down IB's?

Thanks
Rye

Just try to identify strong signals, post your conditions for up and down and I make the change or give you the lines to modify yours.

Regards
PrTester is offline  
Reply With Quote
Old 02-06-2009, 10:04 PM   #15
thalestrader
Junior Member
 
Join Date: Dec 2008
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi there,

How would I edit the script so that the low of 0 could be > or = to low of 1 and the high of 0 could be < or = the high of 1? In other words, I want to define an inside bar as one in which the high or low might be equal to the high or low of the previous bar.

Thank you,

thalestrader
thalestrader 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
Changing plot colors inside of a strategy or indicator NinjaTrader_Ray General Programming 5 06-23-2007 11:30 AM
Accessing BarsArray[0].Period.Value inside Initialize() jbeninga Strategy Development 10 03-22-2007 01:49 AM


All times are GMT -6. The time now is 08:35 PM.

FULL RISK DISCLOSURE: Futures 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.