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
draw line with box as tail
Collapse
X
-
draw line with box as tail
Is there a way to draw a box line instead of arrow line? And also I have drawn a line and user can move it on chart but it doesn't scale automatically the y axis with respect to chart ticksize, zOrder=1 in lines doesn't work too. Can someone help me on this?Last edited by luxurious_04; 11-03-2017, 06:19 AM.Tags: None
-
Hello luxurious_04,
Thanks for opening the thread.
There is not a specific "Box line" drawing tool that comes with NinjaTrader, but there are line and rectangle drawing tools that you may be able to use to accomplish your goal. Otherwise, you could consider creating your own tool to create a an "Arrow Line" through custom plotting. Custom plotting is reserved for advanced programs that would like to do their own drawing in NinjaTrader 7. We do not provide support for custom drawing code, but we do ship a SampleCustomPlot indicator with NinjaTrader 7 that demonstrates how it can be done.
As for auto scaling a draw object, you can create a drawing object with the autoscale bool set to true, and then you can unlock the drawing object so it can be moved manually. If the chart scale is set to automatic and is not in fixed mode, you will be able to adjust the scale of the chart with the drawing tool.
Code:if(CurrentBar < 10) return; ILine myLine = DrawLine("tag", true, 10, Close[0] + 100 *TickSize, 0, Close[0] + 100 *TickSize, Color.Black, DashStyle.Solid, 2); myLine.Locked = false;
An example script can be found here: https://ninjatrader.com/support/foru...9&postcount=10
DrawingObject properties can be referenced in our help guide here: https://ninjatrader.com/support/help...drawobject.htm
If you have any additional questions, please don't hesitate to ask.JimNinjaTrader Customer Service
-
Is there a way to merge the line and rectangle? I want to move line then the rectangle also follows with the line. Something I want to group the two drawn objects just like the MS Word wherein you can group a line and a rectangle. Also how to set the chart scale to automatic?
Comment
-
Hello luxurious_04,
There is not an ability to link drawing objects together, but we have a feature request tracking interest in this field. I will submit a vote for you on your behalf. The ticket ID is SFT-2625. Keep in mind, NinjaTrader 7 is in a freeze and this request would be for implementation in NinjaTrader 8.
This feature's implementation can be found in the Release Notes of the version of NinjaTrader 8 that includes the feature. You can find the Release Notes here: https://ninjatrader.com/support/help...ease_notes.htm
Feature requests are fulfilled based on our development team's schedule and priorities and we cannot provide a time frame for it to become available.
In the meantime, you may be able to find a workaround by constantly checking one of your drawing objects anchors, and if one object moves, you could move the other. I have attached an example indicator that draws a line once and then updates its start and end anchors with each bar update. This example is only for demonstration purposes as is not intended to be copy and pasted into a real script.
If there is anything else I can do to assist, please let me know.Attached FilesJimNinjaTrader Customer Service
Comment
-
Comment
-
Hello luxurious_04,
Thanks for your reply.
There is not a drawing tool that can be used to recreate order markers. You could create your own tool that can do this through custom plotting and checks to see if certain mouse clicks are within the bounds of what you would like to have selectable. Otherwise, you could use a combination of existing drawing tools and use your own logic to update the drawing objects positions after one is being adjusted.
There is an example that a colleague of mine has shared that can demonstrate how to register mouse clicks. This script and the CustomPlotSample script that is included with NinjaTrader 7 could provide some direction to help you get started creating your own script with custom plotting.
Mouse click to price level example - https://ninjatrader.com/support/foru...d.php?t=103995
Please let me know if I can offer further help.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by r68cervera, Today, 05:29 AM
|
0 responses
3 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
6 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,240 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
7 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment