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
Drawing objects
Collapse
X
-
Hello JTizz,
Thank you for your post.
Are you referring to manually drawn drawing objects? Theoretically this may be possible - you'd need to check the anchors of each drawing tool and then when one changes, modify the other drawing object(s). This would get fairly complicated quickly, however, as you'd need to specifically code it to modify the specific type of drawing object, and then even more complicated if you want it to monitor multiple objects. Here's a link to a forum post that shows how the price anchor of a line drawing object could be modified from a script that you could use as a jumping off point to try this; however, it would be extremely complex if even possible.
I've drawn a textbox manually and I would like to update it's position via my strategy. Basically I want to be able to edit the text on the chart so I can pass
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
I have created drawing objects that build off each other and know about each other. When one changes, it notifies its attachments that it has changed. One important aspect to making this work was adding a GUID to every drawing object involved in the connection. This is important for re-establishing connections from NinjaTrader's save/load functionality.
Comment
-
GUID is a global unique identifier. Its a common mechanism as part of the C# system runtime that allows one to create unique ID's. https://docs.microsoft.com/en-us/dot...tframework-4.8
In order to have drawing objects reference each other, they need a mechanism that allows each object to find the attached object when loading a workspace. I also added a global look up table that maps GUIDs to drawing objects. The drawing objects register with the table when they are created or loaded, and use the table to find the associated drawing object. You also need to handle what happens if the associated drawing object is deleted. It is complicated but it can be done.
Comment
-
Hello JTizz,
Thank you for your reply.
The easiest way to submit an order based on a drawing object would be with an alert. Here's a link to our help guide with an example of creating an alert that plays a sound and submits an order based on the price crossing out of the drawing object's area:
Please let us know if we may be of further assistance to you.
Kate W.NinjaTrader Customer Service
Comment
-
Hello JTizz,
Thank you for your several replies.
Yes, an Alert can trigger an order when it goes off. To have an alert trigger an order, in the Alerts window you would need to click Add under Actions, then select Submit an order and set up your order. You can see the various options for actions as well as the settings used to submit an order here:
Yes, alerts can be triggered when a price touches or crosses a manually drawn object. If you want it to alert only when the price touches the line, you would want to use equal to set the alert.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 03:49 AM
|
0 responses
7 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
9 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
10 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
||
Started by dustydbayer, Today, 01:59 AM
|
0 responses
4 views
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 12:32 AM |
Comment