protected override void OnBarUpdate() { if (CurrentBar < 1) return; foreach (IRectangle draw in DrawObjects) { IRectangle Extend = (IRectangle) draw; Extend.EndBarsAgo = 0; }
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
Code to extend manually drawn rectangles
Collapse
X
-
Code to extend manually drawn rectangles
Below is the code I'm using to extend manually drawn rectangles to the current bar. I pulled this code out of another indicator that extends rectangles programmatically drawn and that indicator works fine. The code below does not extend, but it does compile. I realize there is no check for user drawn, but I'm not concerned about that. Also, I checked that my rectangles are not locked. Any ideas where I'm going wrong?
Code:Tags: None
-
Hi Chelsea,
Yes, I'm still running release 15. Does 16 resolve this?
The code is a stripped down version of something in another proprietary indicator of mine. If it would be helpful, let me know how to send it to you via email. I just checked and the original indicator is extending the rectangles correctly.
Thanks for your help on this.
Comment
-
Hi coolmoss,
I cannot give an ETA on when bug fixes or feature requests will be implimented.
Currently our development team is working hard on completing Ninjatrader 8. However, I do know they are continuing to address bugs in NinjaTrader 7.
I can, however, update you in this thread when we receive news this bug has been fixed.Chelsea B.NinjaTrader Customer Service
Comment
-
Chelsea,
Finding a workaround to this would is a priority for me, so, what do you think about trying the following:
Have the script check for the manually drawn rectangles, create new rectangles programmatically which are identical to the manually drawn rectangles, then have the script extend the programmatically created ones.
I realize this isn't terribly elegant, but it might work. Based on your knowledge of the current bug/limitation, is this worth trying? Thanks for your help.
Comment
-
Originally posted by coolmoss View PostChelsea,
Finding a workaround to this would is a priority for me, so, what do you think about trying the following:
Have the script check for the manually drawn rectangles, create new rectangles programmatically which are identical to the manually drawn rectangles, then have the script extend the programmatically created ones.
I realize this isn't terribly elegant, but it might work. Based on your knowledge of the current bug/limitation, is this worth trying? Thanks for your help.
Look up NT_Ryan's code for alert for manually drawn lines... in the file section... if you can hack that to extend a line...you will be on to something.
Comment
-
Hi Coolmoss,
The issue seems to be the same. While I can get a start bar and end bar and then draw a new rectangle, I cannot remove the manually drawn rectangle with RemoveDrawObject. Again this only is working for objects that are drawn with the script and not drawn manually.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Allwest, Yesterday, 10:25 PM
|
2 responses
18 views
0 likes
|
Last Post Today, 04:18 AM | ||
Started by bmandonlidal, Today, 03:34 AM
|
0 responses
1 view
0 likes
|
Last Post
by bmandonlidal
Today, 03:34 AM
|
||
Started by LincolnOrtiz, Today, 03:10 AM
|
0 responses
2 views
0 likes
|
Last Post
by LincolnOrtiz
Today, 03:10 AM
|
||
Started by Dr Kerry, Today, 02:03 AM
|
0 responses
4 views
0 likes
|
Last Post
by Dr Kerry
Today, 02:03 AM
|
||
Started by AndriXF7, 12-06-2023, 10:09 AM
|
5 responses
163 views
1 like
|
Last Post
by Lunorri
Today, 01:56 AM
|
Comment