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,233 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: 425

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?
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
CME Group CEO Calls CFTC-Approved Crypto Perps Dangerous …
Traders Hideout
Post-Summit Market Verdict: ES -1%, NQ -1.5%, 10-Year Yi …
Traders Hideout
US Prop Firms Race Inside the CFTC Perimeter -- Tradeify …
Funded Trading Evaluation Firms
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


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: 425

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,577


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