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

Strategy Plot Sample

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

    Strategy Plot Sample

    I want to convert my indicator to a Strategy and then add and Indicator plot as per the Strategy Plot Sample and do so to plot in panels 2 and 3. So I understand two copies of StrategyPlot would have to loaded. I imported the reference sample and changed the U.I Panel setting to 2 and 3 respectively. I don't understand how this code can work as is. And after loading it, I see it doesn't. What I don't get is how the Strategy values High[0] and Highs[1][0] values get associated with each separate indicator plot Series. The documentation says the Id is used to differentiate plots but it is not referenced anywhere.

    So I am missing something .

    #2
    Hello,

    Could you provide what you are currently trying as an export? I wouldn't be certain what specifically is wrong by the description but would be happy to look at the modified sample.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Both the Strategy and the Plot Indicator are in the zip file

      Thanks
      Jerry
      Attached Files

      Comment


        #4
        Hello Jerrywar,

        The 1 or 0 in the StrategyPlot(0) and StrategyPlot(1), is the strategy plot ID, which you then assign the Highs[1][0], the high of the secondary series, to that specific plot.

        Code:
        StrategyPlot(1).Value.Set(Highs[1][0]);
        In the sample code you provided, the 2nd strategy plot, StrategyPlot(1), in PanelUI 3, will be assigned the high of a 3 minute series.

        Perhaps I’m not understanding your question correctly, what is the issue you are having or what are you attempting to do which you are having trouble with? I have no issues with the StrategyPlot strategy.

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

        Comment


          #5
          See the pic I posted. I get no plot.
          Why ? is my question.

          Comment


            #6
            Hello Jerrywar,

            Can you enable the strategy and confirm whether or not you see plots?

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

            Comment


              #7
              lol - Duhhh
              I knew I was missing something stupid.
              I obviously do not currently use strategies.

              Comment


                #8
                So now that it is plotting letting me expand upon this sample. How would the sample plot either in the Strategy or the Indicator plot an arrow/triangle/dot on crossing some unique level. My first impression is you can't do this from the strategy as you can't control where the draw goes. It would seem that to do it from the Indicator that it would have to reference values from the strategy calculation. I tried to code a reference to strategy public values but failed miserably. Can you provide some reference to how this is done.

                Comment


                  #9
                  Hello JerryWar,

                  It is not possible to have drawing objects on indicator panel rather than the price panel, however I will add your vote for the following feature request in NT8.


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

                  Comment


                    #10
                    Alan, Could you qualify your answer because clearly it is possible.
                    I draw objects in each indicator panel. See attached.
                    Attached Files

                    Comment


                      #11
                      Here is a picture of SamplePlot with drawing Objects in a SubPanel.
                      Attached Files

                      Comment


                        #12
                        Can I assume that a Strategy can populate any public DataSeries in an the indicator as it does with
                        the DataSeries Plot , Such that I can transfer any calculations or information in the same way to an indicator from a Strategy ??

                        Comment


                          #13
                          Hello JerryWar,

                          You are correct and I was mistaken.

                          Yes, as long as you’ve exposed those data series, the strategy could access them.

                          I have provided a sample strategy and indicator written in NT8 which demonstrates this.

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

                          Comment


                            #14
                            Alan,
                            One related question. As I run the strategy I was trading manually on the Dom. When I cancelled an order
                            the Strategy Disabled. Is there some logical reason this happened i.e. expected behavior or Do I have a Problem ? As I found out earlier when it disables the plots are removed so I want to keep it enabled.

                            Comment


                              #15
                              Hello JerryWar,

                              If your strategy submitted an entry order, profit target or stop loss, and you were to cancel one of these working orders, it would be expected the strategy would disable. You could work manual orders on the dom, which you could cancel, however you may not cancel a strategy order and expect the strategy to continue working.

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

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              11 responses
                              3,229 views
                              0 likes
                              Last Post xiinteractive  
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              441 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post FAQtrader  
                              Working...
                              X