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
convert a drawing object into an indicator
Collapse
X
-
Hi Jim,
many thanks for your quick and detailed reply
I'll go through your post carefully to figure out how to perform what I want since I'm not really well with coding
I'll let you know if I have any questions since there seems to be no easy implementation...
BRLast edited by ninjistu10; 02-25-2020, 03:48 PM.
-
Hello ninjistu10,
Thanks for your post.
We can create Alert conditions that fire limit orders at a defined price, but we cannot set an up alert for say "When price touches X line, submit a limit order at this price." The most straightforward way this could be accomplished is if NinjaTrader allowed for attaching orders to drawing objects, where the order will stay attached to where the line intersects with the current bar. We have a feature request tracking interest behind this and I have submitted a vote on your behalf. The internal ticket ID is SFT-1275. This is not a public ID but new features will be listed and described in the Release Notes page of the Help Guide upon implementation.
Drawing objects cannot be converted to an indicator, but to use the Attach to Indicator feature with orders, you would want to capture the drawing object, and then assign the drawing object's anchor price to the indicator's plot. You could then submit your limit order and attach it to the indicator plot. I have attached an example that can help you get started.
You can also consider looping through the DrawObjects collection, find your line and its anchors, and then you could perform some math to determine the price level you should be using for the current bar to hit that price. This would be more complicated. You would have to find the intersection of the line and a vertical line from the current bar, and then convert the Y coordinate of that intersection point to a Price value with ChartScale.GetValueByY(). I use some similar math in my Labeled Lines Drawing Tool, but you would be on your own for developing a way to find intersection, convert to price, and use to submit an order. Orders can be submitted from an indicator using AddOn code. See Account.CreateOrder for more details.
LabeledLines Drawing Tool - https://ninjatraderecosystem.com/use...-drawing-tool/
Account.CreateOrder - https://ninjatrader.com/support/help...reateorder.htm
Order objects - https://ninjatrader.com/support/help...nt8/?order.htm
We look forward to assisting.Attached Files
- Likes 1
Leave a comment:
-
convert a drawing object into an indicator
Hi,
I would like to know if it's possible to convert a drawing object (e.g. a line) into an indicator and be able to attach an order to that line since is only possible to do it whit indicators
Also, I considered to create an alert for that line but it's not fine for me because don't allow add a Limit order (under actions in alert properties), just a market order or an MIT order
The final idea is to put a limit order when the price touches an inclined line (or any another drawing object in the chart)
In the pic, a Limit Sell order should be submitted at 1,08985 if the last candle at that moment touches my line
Any idea or suggestion is more than welcomed
Thanks
Tags: None
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mattbsea, Today, 05:44 PM
|
0 responses
2 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
31 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
2 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
2 responses
20 views
0 likes
|
Last Post
by WHICKED
Today, 03:36 PM
|
Leave a comment: