Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Draw an arrow as signal

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

    Draw an arrow as signal

    Hello everyone

    I have built a simply indi to know when 15 minutes and 60 minutes bars move in the same direction "backbrushing" the chart...

    I would like just draw an arrow at the beginning of every section. Any idea or example of how can I do that?

    Thanks Click image for larger version

Name:	10_05_2021_0859.jpg
Views:	255
Size:	107.2 KB
ID:	1155366

    #2
    Link below is the coding to draw arrow :


    Basically, you have to make a condition for it to draw. For example :
    Code:
    if (Condition here)
    Draw.ArrowUp(this, "tag1 " + CurrentBar, true, 0, Low[0] - TickSize, Brushes.Red);
    ** Remember to plus CurrentBar


    From your picture, it must be have condition for it to draw the region.
    Make you just put the draw arrow function inside there function.

    Comment


      #3
      Hello Cincai

      Thanks for your answer. I know how to draw an arrow. What I need to know is how to do just once at the beggining of each section.

      Sincerely,

      Comment


        #4
        Hello Rosario,

        Thanks for your post.

        You would need to devise some logic to create the situation you have. The situation is that you have a variable length of background drawing.

        One approach to this would be to create an int variable to use as a counter. When you do NOT have the condition to draw the background you would set the counter to 0. When you do have the condition to draw the background you increment the counter. When the counter is 1, you draw the arrow.

        if (some condition to draw the background)
        {
        BackBrush =...
        myCounter++; // increment counter
        if (myCounter == 1)
        {
        Draw.arrow....
        }
        }
        else
        {
        myCounter = 0; // reset the counter if NOT drawing the background
        }
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello, Paul

          Thanks for your reply. Attached file. It works ok.

          Sincerely,
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by TheMarlin801, 10-13-2020, 01:40 AM
          20 responses
          3,914 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by timmbbo, 07-05-2023, 10:21 PM
          3 responses
          150 views
          0 likes
          Last Post grayfrog  
          Started by Lumbeezl, 01-11-2022, 06:50 PM
          30 responses
          806 views
          1 like
          Last Post grayfrog  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          3 responses
          11 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by Johnny Santiago, 10-11-2019, 09:21 AM
          95 responses
          6,194 views
          0 likes
          Last Post xiinteractive  
          Working...
          X