• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveDrawObject in Class

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uupsa
    replied
    Hello Zachary,

    thanks a lot for your reply. Sometimes it is so easy. I defined the Indicator class in my custom class and now I am able to work with the RemoveDrawObject().

    Thanks
    uupsa

    Leave a comment:


  • NinjaTrader_ZacharyG
    replied
    Hello uupsa,

    Thank you for your inquiry.

    Your custom class will not contain a definition for the RemoveDrawObject() method, hence why you are getting the CS0103 error.

    The Indicator class contains the definition of RemoveDrawObject().

    As you would like to remove a draw object from the current instance of the indicator, you would need to pass the indicator instance to your custom class' method.

    As an example:
    Code:
    public class ClassTest : Indicator
    {
         .......
         private CustomClass theCustomClass;
         theCustomClass = new CustomClass();
         protected override void OnBarUpdate()
         {
              theCustomClass.DestroySomething(this);
         }
    }
    
    public class CustomClass
    {
         public void DestroySomething(Indicator indicator)
         {
              indicator.RemoveDrawObject("TheDrawObject");
         }
    }
    Please, let us know if we may be of further assistance.

    Leave a comment:


  • uupsa
    started a topic RemoveDrawObject in Class

    RemoveDrawObject in Class

    Hello together,

    I am working with NT8 and built a class to draw several things on the chart. I am not experienced with building classes..

    Now, I would like to use the "RemoveDrawObject" to remove some drawings on my chart, but inside the class I can´t use it:

    RemoveDrawObject("TradeID");

    ErrorCode CS0103.

    Is there any possibility to get this working? Why and how do I have to declare the object?

    Thanks for your help!
    Regards
    uupsa

Latest Posts

Collapse

Topics Statistics Last Post
Started by Simon Thompson, Yesterday, 11:00 PM
0 responses
2 views
0 likes
Last Post Simon Thompson  
Started by rontronimous, Yesterday, 09:41 PM
0 responses
5 views
0 likes
Last Post rontronimous  
Started by 400396, Yesterday, 09:34 PM
4 responses
13 views
0 likes
Last Post 400396
by 400396
 
Started by sandman55, Yesterday, 08:00 PM
0 responses
4 views
0 likes
Last Post sandman55  
Started by Oracletrades, 11-16-2019, 02:56 AM
1 response
11 views
0 likes
Last Post NinjaTrader_ChelseaB  
Working...
X