Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help drawing arrows

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

    Need help drawing arrows

    Hello, hoping to get an answer to this. I've spent a lot of time on something I think should (probably will be) simple. Trying to show arrows on chart below/above bar when RSI is below 30 or above 70. I got a RSI code to compile with the following but nothing is showing on chart... any help appreciated. I'd make a new post but dont know how

    if (CrossAbove(RSI(14, 1), 50, 1))
    DrawArrowUp("rsi up" + CurrentBar, false, 0, Low[0], Color.Green);
    else if (CrossBelow(RSI(14, 1), 50, 1))
    DrawArrowDown("rsi down" + CurrentBar, false, 0, High[0], Color.Red);
    RayNinjaTrader Customer Service

    #2
    Hello,

    Your code worked for the 50 line. You just needed to change it to 70 and 30 (also see attached screen shot):

    if (CrossAbove(RSI(14, 1), 70, 1))
    DrawArrowUp(
    "rsi up" + CurrentBar, false, 0, Low[0], Color.Green);
    elseif (CrossBelow(RSI(14, 1), 30, 1))
    DrawArrowDown(
    "rsi down" + CurrentBar, false, 0, High[0], Color.Red);
    Attached Files
    DenNinjaTrader Customer Service

    Comment


      #3
      Ben, your display is what I want but it doesnt plot on screen for me, does it matter where I insert the snipet? I put it on lines 50-57 after the plot area... I'd like the arrows to continue to print untill RSI crosses 70/30line again as well, probably can use some loop type statement that I believe I could do but the real issue for me is just to get the arrows to show...thx

      Comment


        #4
        this is what i have, highlighted in red is code that was entered for desired arrows, thx


        Add(new Plot(Color.Green, "RSI"));
        Add(
        new Plot(Color.Orange, "Avg"));
        Add(
        new Line(System.Drawing.Color.DarkViolet, 30, "Lower"));
        Add(
        new Line(System.Drawing.Color.YellowGreen, 70, "Upper"));



        PriceTypeSupported =
        true;

        DrawOnPricePanel =
        true;

        if (CrossAbove(RSI(7, 1), 70, 1))
        DrawArrowUp(
        "rsi up" + CurrentBar, false, 0, Low[0], Color.Green);
        else
        if (CrossBelow(RSI(7, 1), 30, 1))
        DrawArrowDown(
        "rsi down" + CurrentBar, false, 0, High[0], Color.Red);




        ......

        Comment


          #5
          Ben I moved the code down to lines 100- below indictors calculated where it has header
          ///<summary>
          /// Calculates the indicator value(s) at the current index.
          ///</summary>

          That did it! now it works! thanks

          Comment


            #6
            One last question, is it possible to continue to print the arrows at bottom/top of bar as long as the condition exists(RSI above 70 or below 30)? I tried the return funcion but didnt write it correctly I guess.

            Thanks Again,
            Bert

            Comment


              #7
              Hello,

              Yes, you can. So if it is above or below 70/30 draw? Just build a condition that compares RSI right now (use this index: [0]) to 70/30, then it will draw the entire time it is above/below 70/30.

              Give it a try or pay me to code it for ya. *wink*

              Comment


                #8
                Sounds like a plan! Thanks again :-)

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Frank1000, Today, 03:05 AM
                0 responses
                3 views
                0 likes
                Last Post Frank1000  
                Started by ntdev, Today, 01:14 AM
                4 responses
                15 views
                0 likes
                Last Post ntdev
                by ntdev
                 
                Started by ct, Today, 02:22 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by yodaler, Yesterday, 06:12 PM
                4 responses
                12 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by sinpeople, 05-07-2021, 04:38 AM
                2 responses
                21 views
                0 likes
                Last Post hedgeplay  
                Working...
                X