Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawingTools.TrendChannel

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

    DrawingTools.TrendChannel

    Hi,

    Is it not possible to get and compare TrendChannel using below code? When I tried to debug the program, I am getting draw as NinjaTrader.NinjaScript.DrawingTools.TrendChannel but it is not going inside the condition draw is NinjaTrader.NinjaScript.DrawingTools.TrendChannel and returns false. How do I fix the issue? Additionally, how do I filter in the foreach loop to get only TrendChannel DrawObjects. Thanks


    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    // Finds line objects that are attached globally to all charts of the same instrument
    if (draw is DrawingTools.Line)
    {
    myBuyLine = draw as DrawingTools.Line;
    }
    else if (draw is NinjaTrader.NinjaScript.DrawingTools.TrendChannel)
    {
    trendChannel = draw as DrawingTools.TrendChannel;
    }
    }​
    Last edited by kezyclaire; 03-27-2023, 04:45 PM.

    #2
    Hello kezyclaire,

    If you are wanting assistance with an error message, please provide the full error message. Ctrl + c to copy, Ctrl + v to paste. Or provide screenshot.

    Your suggested code does not show the variable definitions, which is where the issue could be.

    Making a test script, I don't see anything that would be wrong with that code.

    TrendChannelsDrawObjectsTest_NT8.zip
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by WilliCarls, Today, 02:01 AM
    0 responses
    5 views
    0 likes
    Last Post WilliCarls  
    Started by Pa_Baz, 12-14-2024, 09:40 PM
    47 responses
    793 views
    1 like
    Last Post Gianmarco Giorgi  
    Started by powbordon1126, 02-06-2025, 08:47 PM
    3 responses
    28 views
    0 likes
    Last Post rockmanx00  
    Started by dhanushatrader96, Yesterday, 10:24 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by reynoldsn, Yesterday, 07:52 PM
    0 responses
    9 views
    0 likes
    Last Post reynoldsn  
    Working...
    X