NinjaTrader Support Forum  

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

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 03-05-2008, 06:45 AM   #1
ohowie
Senior Member
 
Join Date: Dec 2007
Posts: 190
Thanks: 0
Thanked 0 times in 0 posts
Default Using ray in a cross?

I noticed I won the most online here so thanks for the help and I will keep it short. Is it possible to use a Ray drawn and tagged by a strategy in crossabove/below?
Thanks a mill,
Howie
ohowie is offline  
Reply With Quote
Old 03-05-2008, 06:55 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Not sure I follow, but a strategy can create a Ray object and paint in on chart.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-05-2008, 07:26 AM   #3
ohowie
Senior Member
 
Join Date: Dec 2007
Posts: 190
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Dierk,
Understood. Is there a way to test a crossover i.e. CrossAbove(Close,MYRAYNAME,1) ?
Thank you
ohowie is offline  
Reply With Quote
Old 03-05-2008, 07:33 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Sorry not sure I follow. MYRAYNAME needed to be a data series. Is it?
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-05-2008, 07:36 AM   #5
ohowie
Senior Member
 
Join Date: Dec 2007
Posts: 190
Thanks: 0
Thanked 0 times in 0 posts
Default

MYRAYNAME would be the ray created and drawn by the strategy. I would like to trap as a signal to trade the crossing of the Close and the Ray created and drawn by the strategy.
ohowie is offline  
Reply With Quote
Old 03-05-2008, 07:39 AM   #6
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

I see. Unfortunately this is not supported. A ray is just a drawing object and not a data series which you would need for your calcs.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-05-2008, 07:45 AM   #7
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

You could check out the Automatic Trend Line Detection indicator I coded. Its located in the NinjaScript File Sharing section. If my memory serves me correctly, I calculate the trend line and draw a ray and I then have code that detects when there is a cross of that ray by price.
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-05-2008, 07:47 AM   #8
ohowie
Senior Member
 
Join Date: Dec 2007
Posts: 190
Thanks: 0
Thanked 0 times in 0 posts
Default

Dont take this the wrong way Ray... I love you
ohowie is offline  
Reply With Quote
Old 03-05-2008, 07:53 AM   #9
ohowie
Senior Member
 
Join Date: Dec 2007
Posts: 190
Thanks: 0
Thanked 0 times in 0 posts
Default

Awesome!!!!
ohowie 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
EMA cross Question Ninja Learner Strategy Development 23 05-28-2009 07:13 AM
Simple STO Cross problem gyoung General Programming 4 02-18-2008 11:19 AM
MTF Ema Cross buderim Market Analyzer 1 10-17-2007 04:17 AM
How to write second cross over of MACD? Jenny Strategy Development 2 07-18-2007 06:23 AM
Alert on cross over/under scjohn Market Analyzer 5 05-25-2007 07:21 AM


All times are GMT -6. The time now is 02:21 PM.