NexusFi: Find Your Edge


Home Menu

 





simple strategy to enter CCI cross +45/-45


Discussion in NinjaTrader

Updated
    1. trending_up 4,666 views
    2. thumb_up 4 thanks given
    3. group 1 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

simple strategy to enter CCI cross +45/-45

  #1 (permalink)
 emini_Holy_Grail 
Dallas,TX
 
Experience: Intermediate
Platform: NinjaTrader, OpenQuant
Broker: Zaner/Zen Fire
Trading: ES,6E,6B,GC,CL
Posts: 597 since Nov 2009
Thanks Given: 176
Thanks Received: 126

{
// Condition set 1
if (CrossAbove(Close, CCI(14), 1))
{
EnterLong(DefaultQuantity, "");
}

// Condition set 2
if (CrossBelow(Close, CCI(14), 1))
{
EnterShort(DefaultQuantity, "");
}
}

This is to make a simple strategy to enter Long when CCI cross a certain value like +45 or vice versa for -45. I believe this code will enter Long when CCI crosses zero? sorry guys I am brand new to coding, so need some help.
Any help is appreciated

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quant vue
Trading Reviews and Vendors
REcommedations for programming help
Sierra Chart
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
  #3 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090



emini_Holy_Grail View Post
{
// Condition set 1
if (CrossAbove(Close, CCI(14), 1))
{
EnterLong(DefaultQuantity, "");
}

// Condition set 2
if (CrossBelow(Close, CCI(14), 1))
{
EnterShort(DefaultQuantity, "");
}
}

This is to make a simple strategy to enter Long when CCI cross a certain value like +45 or vice versa for -45. I believe this code will enter Long when CCI crosses zero? sorry guys I am brand new to coding, so need some help.
Any help is appreciated

Hi,

You forgot to set the numeric value of your CCI

protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (CrossAbove(CCI(14), 45, 1))
{
EnterLong(DefaultQuantity,
"");
}
}

For such strategy you better use the NT strategy wizard once you have finished you can unlock the code and modify it

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 emini_Holy_Grail 
Dallas,TX
 
Experience: Intermediate
Platform: NinjaTrader, OpenQuant
Broker: Zaner/Zen Fire
Trading: ES,6E,6B,GC,CL
Posts: 597 since Nov 2009
Thanks Given: 176
Thanks Received: 126

redratsal

Thks and will try it, but is my logic correct?

I gave pirce close crossabove and below CCI value,(unlike price close > EMA 20) etc, but in this case it is not price in the CCI panel. would you mind verify that for me

Started this thread Reply With Quote
  #5 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090


emini_Holy_Grail View Post
redratsal

Thks and will try it, but is my logic correct?

I gave pirce close crossabove and below CCI value,(unlike price close > EMA 20) etc, but in this case it is not price in the CCI panel. would you mind verify that for me

The script refet to price close: if the bar[0] crossabove the level 45 of your CCI than enter long.
Since I am using a cross strategy in "the battle of the bot" thread you can download it and use it as an example.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 emini_Holy_Grail 
Dallas,TX
 
Experience: Intermediate
Platform: NinjaTrader, OpenQuant
Broker: Zaner/Zen Fire
Trading: ES,6E,6B,GC,CL
Posts: 597 since Nov 2009
Thanks Given: 176
Thanks Received: 126

Thks and let me check out there

Started this thread Reply With Quote




Last Updated on January 8, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts