![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
|
Let's say I use DrawRay() to draw a ray from Open[2] to Open[1]. Is there a way to tell when the CurrentBar closes if Open[0] is above or below the extended ray? I guess I would need to know the price where the ray would intersect each future bar.
Thanks! Bryan
Price-Dynamics.com
A NinjaTrader Official Partner Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy! Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account! |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Yes, this is possible with some advanced programming. For an example, look at the code in the Automatic Trend Line indicator at this link:
http://www.ninjatrader-support.com/v...ks.php?catid=1
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
|
Quote:
Ok, so where in that code is it determining what the value of the extended ray is -- when it's finding out whether the trendline has been crossed?
Price-Dynamics.com
A NinjaTrader Official Partner Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy! Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account! |
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
In the code there are comments, something like "Check for trend line break" etc...This is from memory. You will have to rip through the code to understand what is happening. In a nutshell, it grabs the xy values of the start and end point of the trend line and calculates the slope (change per bar) and then add this to each subsequent bar to determine the line value which then can be checked against the close price etc...
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
|
Quote:
Bryan
Price-Dynamics.com
A NinjaTrader Official Partner Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy! Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account! |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get DrawRay() Line Object Properties | phylum | General Programming | 3 | 06-04-2008 11:33 PM |