Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw a rectangle to capture trade in strategy

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

    Draw a rectangle to capture trade in strategy

    I am trying to code my strategy to draw a rectangle on chart from the entry price to exit price on exiting the position. I am using historical data. This is what I have, but no workie:

    DrawRectangle("Trade Area" + CurrentBar, false, BarsSinceEntry(), Open[BarsSinceEntry()], 0, Close[0], Color.Transparent, Color.Cyan, 3);

    Any idea what I am missing?

    Example:
    Attached Files

    #2
    Can you please clarify what you feel is incorrect in your screenshot provided?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      The screenshot I provided is an example of what I want it to look like when working properly. Currently there is no rectangle appearing. Sorry for the confusion.

      Comment


        #4
        Ok, no worries - on which condition do you draw the rectangle? Do you see any errors in the log tab, like an index out of bounds error?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand:

          I have no idea why, but for some reason the rectangles are drawing properly now. Thanks anyway!

          Comment


            #6
            Thanks for getting back, please let us know if you would see any issues.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by tsantospinto, 04-12-2024, 07:04 PM
            6 responses
            98 views
            0 likes
            Last Post tsantospinto  
            Started by rocketman7, Today, 02:12 AM
            5 responses
            25 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by ZenCortexReal, Today, 08:54 AM
            0 responses
            1 view
            0 likes
            Last Post ZenCortexReal  
            Started by ZenCortexReal, Today, 08:52 AM
            0 responses
            0 views
            0 likes
            Last Post ZenCortexReal  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            7 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X