Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Changes in NT7

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

    Draw Changes in NT7

    I am trying to port PKPriceAlert3 to NT7.

    The attached will not work in NT7, but I could find nothing in Code Break Changes that have to do with

    foreach(ChartObject CO in ChartObjectArrayList) {

    double PriceAlert = Math.Round(CO.Value,2);

    ChartObject is no longer supported in NT7. Have to use NT7's newly provided DrawObjects and IDrawObject instead.

    Has anyone experience with these?
    Attached Files

    #2
    For the most part, we only documented code breaking changes for support NinjaScript constructs. There were a few exceptions.

    You are correct, you would need to use the DrawObjects collection for iterating through draw objects. We don't have any reference samples yet although try searching the forum on "DrawObjects" as I believe there might be some threads already discussing this that could give you some guidance.
    RayNinjaTrader Customer Service

    Comment


      #3
      For DrawObject you can try this code snippet:
      Code:
      foreach (IDrawObject draw in DrawObjects)
      {
            if (draw.Tag.StartsWith("@") && draw is ILine)
            {
                  Print("Global Line Object: " + draw.Tag + " Manually Drawn: " + draw.UserDrawn);
                  ILine globalLine = (ILine) draw;
                  globalLine.Pen.Color = Color.Black;
            }
      
            else if (draw is ILine)
            {
                  ILine drawnLine = (ILine) draw;
                  Print("Line Object: " + draw.Tag + " Manually Drawn: " + draw.UserDrawn + " " + drawnLine.StartBarsAgo + " " + drawnLine.EndBarsAgo);
            }
      }
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by f.saeidi, Today, 12:14 PM
      0 responses
      1 view
      0 likes
      Last Post f.saeidi  
      Started by giulyko00, Today, 12:03 PM
      0 responses
      4 views
      0 likes
      Last Post giulyko00  
      Started by AttiM, 02-14-2024, 05:20 PM
      12 responses
      213 views
      0 likes
      Last Post DrakeiJosh  
      Started by cre8able, 02-11-2023, 05:43 PM
      3 responses
      238 views
      0 likes
      Last Post rhubear
      by rhubear
       
      Started by frslvr, 04-11-2024, 07:26 AM
      8 responses
      117 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Working...
      X