NexusFi: Find Your Edge


Home Menu

 





Editing an existing IRectangle


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one mk77ch with 2 posts (0 thanks)
    2. looks_two cory with 1 posts (0 thanks)
    3. looks_3 MooreTech with 1 posts (1 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 2,129 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 162 since Oct 2010
Thanks Given: 30
Thanks Received: 423

hey guys,

is there a possibility to edit an existing IRectangle Object on a chart?
i tried something like this without any success:

 
Code
foreach(IDrawObject o in DrawObjects)
{
    if(o.DrawType == DrawType.Rectangle)
    {
        IRectangle rec = (IRectangle)o;
        
        if(rec.EndTime < Time[0])
        {
            rec.EndTime = Time[0];
        }
    }
}
the idea is to create a little helper indicator which automatically expands my drawn support / resistance areas.

thank you and cheers,
mike


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
$134M Ground Entry Contract in Disputed Final Review Aft …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
Expiration Day: Wall Street Rallies on Peace Hopes While …
Prediction Markets & Event Contracts
Hormuz Surges From 14% to 26.5% Intraday as Irans Answer …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093


you may find the code you need in this thread I think


Reply With Quote
  #4 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 162 since Oct 2010
Thanks Given: 30
Thanks Received: 423

hey cory,

thank you for your reply but i cant find any reference in that thread.
the problem is, that if i draw a rectangle for a support or resistance area by using the drawing tools and then try to edit that rectangle in ninjascript, i am able to get the values but i cant edit the object itself.

if i delete the existing object and replace it with a new one created by the indicator, it becomes a drawobject of the indicator and i cant just delete it by hand.

any ideas?


Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557


mk77ch View Post
hey cory,

thank you for your reply but i cant find any reference in that thread.
the problem is, that if i draw a rectangle for a support or resistance area by using the drawing tools and then try to edit that rectangle in ninjascript, i am able to get the values but i cant edit the object itself.

if i delete the existing object and replace it with a new one created by the indicator, it becomes a drawobject of the indicator and i cant just delete it by hand.

any ideas?

You might trying mentioning @cory

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
Posts: 57 since Aug 2010
Thanks Given: 6
Thanks Received: 73


mk77ch View Post
hey cory,

thank you for your reply but i cant find any reference in that thread.
the problem is, that if i draw a rectangle for a support or resistance area by using the drawing tools and then try to edit that rectangle in ninjascript, i am able to get the values but i cant edit the object itself.

if i delete the existing object and replace it with a new one created by the indicator, it becomes a drawobject of the indicator and i cant just delete it by hand.

any ideas?

If you set AllowRemovalOfDrawObjects to true in the Initialize method, you will be able to manually delete the draw objects.

AllowRemovalOfDrawObjects


If you have any questions about our products or services please contact me via Private Message
Follow me on X Reply With Quote
Thanked by:




Last Updated on August 27, 2013


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts