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

Add horizontal lines to indicator in strategy script

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

    #61
    Originally posted by NinjaTrader_JC View Post
    Hello alexstox,

    If you are visually displaying MAX/MIN on the chart using a Plot then AutoScale will be applied to all Plots. If you want to not have them be on the AutoScale list you may want to use a Drawing object so that way you can toggle if it is going to be AutoScale or not in part of the overloads. It will be a "bool autoScale" that you may set to false to do this.

    http://www.ninjatrader.com/support/h...l?drawline.htm
    I thought Draw() method is only for strategy script. Does this method load processor more resource-intensive than Plot()? And how will Draw() draw through history?
    Last edited by alexstox; 01-14-2014, 03:09 PM.

    Comment


      #62
      Hello alexstox,

      Draw objects can be used in both Indicator and Strategies. They do use a bit more resources than Plots but it would be the only way to not have the AutoScale effect it. Otherwise, you would have to manually change the Plot values to be similar to the others. Draw objects will be process Historically as well so you may have objects being drawn in the past.

      Happy to be of further assistance.
      JCNinjaTrader Customer Service

      Comment


        #63
        Originally posted by NinjaTrader_JC View Post
        Hello alexstox,

        Draw objects can be used in both Indicator and Strategies. They do use a bit more resources than Plots but it would be the only way to not have the AutoScale effect it. Otherwise, you would have to manually change the Plot values to be similar to the others. Draw objects will be process Historically as well so you may have objects being drawn in the past.

        Happy to be of further assistance.
        Dear JC, thank you very much!
        1) How can I add any value in the right corner of indicator panel (window)? For example MAX value.
        2) In my indicator I need one component to be plot in other panel (window) on the chart. For example, MAX of my value, will be plotted in next panel (window) on the chart. How to script this? For example in strategy script I've used
        Code:
        MyIndicator().Panel=1;
        Last edited by alexstox; 01-15-2014, 04:10 PM.

        Comment


          #64
          Hello alexstox,

          1. This one will be a two part item. The first, to draw on the same panel as your Plot you will want to set "DrawOnPricePanel" to false.



          The second, to draw in the text in a specific position of the screen you may use the DrawTextFixed() method. For example "DrawTextFixed("tag1", "Text to draw", TextPosition.BottomRight);"



          2. To have your Indicator plot on another panel you may just want to use "Overlay = false;" inside of Initialize().

          JCNinjaTrader Customer Service

          Comment


            #65
            Well, I for second question I need to clarify.
            MyIndicator consists of several components: Max(), Min(), SMA() etc. How to order from MyIndicator to plot Max() in other panel than MyIndicator? Is it possible?

            Comment


              #66
              Hello alexstox,

              It would not be possible to draw plots on multiple panels from one Indicator. To plot on different panels you may want to create a new indicator for each plot you want on a different panel.
              JCNinjaTrader Customer Service

              Comment


                #67
                Originally posted by alexstox View Post
                Well, I for second question I need to clarify.
                MyIndicator consists of several components: Max(), Min(), SMA() etc. How to order from MyIndicator to plot Max() in other panel than MyIndicator? Is it possible?
                DrawOnPricePanel controls where all drawings go, subsequent to where the instruction is assigned.

                Comment


                  #68
                  What about CalculateOnBarClose? Does it matter if in strategy and indicators it different? For example, in MyIndicator COBC=true and in strategy COBC=false, or or vice versa? Note: I called for MyIndicator() in strategy script.

                  Comment


                    #69
                    Hello alexstox,

                    Your Indicator will use the same COBC settings as your strategy so if your Strategy is COBC set to false your Indicator will use COBC false as well.

                    If you still want to keep your logic at the close of each bar you check for the FirstTickOfBar so that way it will only process your Indicator when a bar has been closed.

                    Here is an example of this that you may view.
                    JCNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by egordleo, Today, 05:50 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post egordleo  
                    Started by kevinenergy, 02-17-2023, 12:42 PM
                    118 responses
                    2,778 views
                    1 like
                    Last Post kevinenergy  
                    Started by briansaul, Today, 05:31 AM
                    0 responses
                    9 views
                    0 likes
                    Last Post briansaul  
                    Started by fwendolynlpxz, Today, 05:19 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post fwendolynlpxz  
                    Started by traderqz, Yesterday, 12:06 AM
                    11 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Working...
                    X