Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Guys need some help-Trend Line in strategy
Collapse
X
-
Guys need some help-Trend Line in strategy
I am trying to figure out how I could build a trend line into my rule where if its broken my position will enter or exit depending on current position. Does someone have a way that they build automatic trend lines where its touching just the lowest low and the highest low and vice versa, and ignore the data in between. Drawing it by hand is easy on a chart, but I'm trying to figure out how I could actually have this coded for either a fixed number of bars, where it re checks the slope, or an adaptive level of number of bars based on it extending itself. Any input is greatly appreciated about how I could do this.Tags: None
-
JSeymour,
You would need to determine what kind of logic you want to use to draw it. Then you can use DrawLine() to programmatically draw it, but this is not programmatically accessible. You will have to do math yourself to determine slope and things like that in your code.Josh P.NinjaTrader Customer Service
-
What I mean by it is that you can for sure draw the line at whatever points you want, but after you draw the line you can't, for instance, access the value of the line at any particular point on the line.
The only values at your disposal would be the beginning and ending points of the line.Josh P.NinjaTrader Customer Service
Comment
-
"Draw Objects Enhancements
Draw objects are now associated to an indicator which means that if a user removes a draw object from the chart, it will also remove the indicator. In addition, all draw objects spawned from an indicator share the indicator's z-order.
IDrawObject - IDrawObjects are now returned to the caller on all Draw() methods. IDrawObjects expose draw objects properties.
Work in progress - We will implement programmatic access to draw objects added to a chart manually. For example, you can have a user draw a line on a chart and add a "tag" to this object and you can retrieve this object, read it's value and do something with it."
http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html Hope that helps.Josh P.NinjaTrader Customer Service
Comment
-
getting properties of objects manually drawn on a chart?
Could you please give an example of how to programatically access the properties of a user drawn object that was added to the chart manually, as mentioned by Josh in Post #6 of this thread?
Thank you.Last edited by Ricam; 03-08-2010, 05:08 PM.
Comment
-
Properties of a manually drawn object
In the previous example, the line seems to have been drawn programatically, not manually.
Is there a way to programatically iterate through the manually drawn objects that actually exist on a chart, to obtain their properties?
Thanks.Last edited by ZTR; 03-08-2010, 05:37 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
41 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
3 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
5 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
6 responses
27 views
0 likes
|
Last Post Today, 12:02 AM | ||
Started by mly916, Yesterday, 09:48 PM
|
1 response
14 views
0 likes
|
Last Post Yesterday, 11:54 PM |
Comment