Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to declare DrawObjects in addons?

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

    How to declare DrawObjects in addons?

    the following line works fine within an indicator, but errors out in an addon.

    Code:
    foreach (DrawingTool drawing in DrawObjects)
    the error that I get is:
    Code:
    The name 'DrawObjects' does not exist in the current context.
    because DrawObjects is not a namespace, as a non-coder, its got me stumped.
    Any suggestions?

    Thanks!

    #2
    Hello gubbar924,

    Thank you for your post.

    DrawObjects is a collection that belongs to the IndictorRenderBase. So we need to set an indicator as a variable in the class we are building and then call DrawObjects from that indicator variable.

    For example:
    Code:
    private SMA mySMA;
    
    foreach (DrawingTool drawing in mySMA.DrawObjects)

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Today, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Today, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Today, 07:51 PM
    0 responses
    11 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,980 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X