NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-17-2008, 05:57 AM   #1
pipsheker
Junior Member
 
Join Date: Feb 2008
Posts: 16
Thanks: 0
Thanked 0 times in 0 posts
Default CCI formula

Hi,

I am trying to code an indicator based on CCI. I use the command as follow:

a) CCI(50)[0] - Because I want to use CCI 50 and current bar to made a calculation.

I wonder if this is correct.

b) CCI(50)[1] - Because I need the bar before to made other calculation. But somehow I got an out put of "0" when I start to plot the chart.

Question = = Can I use the [1] to represent the parameters of CCI of the pervious bar???

I hope somehow could give a some clue. Thanks

shek
pipsheker is offline  
Reply With Quote
Old 05-17-2008, 06:51 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Yes,

CCI(50)[1] is the value 1 bar ago.

You are likely runing into this problem - http://www.ninjatrader-support.com/v...ead.php?t=3170
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-17-2008, 06:57 AM   #3
pipsheker
Junior Member
 
Join Date: Feb 2008
Posts: 16
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Ray,

I think you are right! Many Many thanks for the help!

I used [5] and that is why I cannot get anything! Hahaha, i have learn something new.

Now my output in the chart made sense!!!

Thanks again.

Shek


Quote:
Originally Posted by NinjaTrader_Ray View Post
Yes,

CCI(50)[1] is the value 1 bar ago.

You are likely runing into this problem - http://www.ninjatrader-support.com/v...ead.php?t=3170
pipsheker 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
Range Bars Count down Formula for Woodiee CCI Pipqueen Suggestions And Feedback 1 11-29-2007 09:41 AM
Using a formula or variable as an input to an Indicator nolantx Indicator Development 5 05-24-2007 03:58 PM


All times are GMT -6. The time now is 10:59 PM.