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

Adding Arrows to Price Panel from Indicator

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

    Adding Arrows to Price Panel from Indicator

    I am trying to add up and down arrows to a price panel using cross over functions inside an indicator which displays correctly below the price panel. The three <double> series myRSI, myRSILower, and myRSIUpper are displayed correctly on the indicator, however, the arrows are not visible after compiling (with no errors).

    Any suggestions?

    if (CrossAbove( myRSI, myRSILower,1) ) {
    Draw.ArrowUp(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Green,true);
    }
    if (CrossBelow( myRSI, myRSIUpper,1) ) {
    Draw.ArrowDown(this, "tag2", true, 0, High[0] + TickSize, Brushes.Red,true);
    }

    } // End of OnBarUpdate()
    Last edited by pel11; 06-17-2018, 06:29 PM.

    #2
    Hello Pell11,

    Thank you for your note.

    If you set, DrawOnPricePanel = false; within State.SetDefaults, do the arrows draw as expected?

    See DrawOnPricePanel section of our helpguide,


    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      No, I set that to false, and also set the last command in the Draw.... function to false as well, selected Reload Script" on the chart, and no arrows visible on the screen.



      FYI, even the SampleMACrossOver strategy that comes with NT8, which has some display commands for the short and long SMA's don't even appear on the screen after it's loaded to an equity chart with 1000 EOD bars.

      Comment


        #4
        Hello pel11,

        Since DrawOnPricePanel is set in State.SetDefaults, which is only ran once when the indicator is applied to a chart, a reload of NinjaScript would not reflect this change.

        If you remove and reapply the indicator to the chart, do you see the bars?

        Are you seeing the same behavior when you apply the indicator to a 15 minute candlestick chart?

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          I set DrawOnPricePanel = true; and I can only see one up and one down arrow --> the last time the crossovers were true, but not everywhere earlier in the chart.


          The code in the OP is within OnBarUpdate, so I am not sure why the earlier arrows are not appearing?

          Comment


            #6
            Hello pel11,

            The same drawing arrow, "tag1" is being redrawn every time its being called.

            Code:
            Draw.ArrowUp(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Green,true);
            If you make the name of the drawing arrow unique each time its called, you'll see historical arrows.

            To do this you could use,

            Code:
            Draw.ArrowUp(this, [B]"tag1"+CurrentBar[/B], true, 0, Low[0] - TickSize, Brushes.Green,true);
            So each arrow will have a name of "tag1" plus whatever bar number its called on.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              RESOLVED - thanks - works like a charm!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by BarzTrading, Today, 07:25 AM
              2 responses
              21 views
              1 like
              Last Post BarzTrading  
              Started by devatechnologies, 04-14-2024, 02:58 PM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by tkaboris, Today, 08:01 AM
              0 responses
              4 views
              0 likes
              Last Post tkaboris  
              Started by EB Worx, 04-04-2023, 02:34 AM
              7 responses
              163 views
              0 likes
              Last Post VFI26
              by VFI26
               
              Started by Mizzouman1, Today, 07:35 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X