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

StrategyPlot ?

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

    StrategyPlot ?

    Code:
     protected override void Initialize()
            {
                CalculateOnBarClose = false;
    	    Add(StrategyPlot(0));
    			
            }
    This throws an error so far for me:
    Code:
    The name 'StrategyPlot' does not exist in the current context
    I'm so far unable to get this happening, what am I missing?

    #2
    Hi funk101,

    Is this an indicator or strategy?

    May I have an export of the file?

    To export your script do the following:
    1. Click File -> Utilities -> Export NinjaScript
    2. Enter a unique name for the file in the value for 'File name:'
    3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
    4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


    Below is a link to the help guide on Exporting NinjaScripts.
    http://www.ninjatrader.com/support/h...nt7/export.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      It's a strategy, how do I get it to you?

      Comment


        #4
        Hello funk101,

        Thank you for your response.

        We have received your note and the file, I will follow up with you via e-mail.

        Comment


          #5
          Any ideas here?

          Comment


            #6
            Hello funk101,

            Thank you for your response.

            I have not followed up with you yet as I have no information at this time.

            Comment


              #7
              Well, at the most basic level this does not work. I created a brand new strategy with a default variable:
              Code:
              // This namespace holds all strategies and is required. Do not change it.
              namespace NinjaTrader.Strategy
              {
                  /// <summary>
                  /// Enter the description of your strategy here
                  /// </summary>
                  [Description("Enter the description of your strategy here")]
                  public class StrategyPlotTest : Strategy
                  {
                      #region Variables
                      // Wizard generated variables
                      private int myInput0 = 1; // Default setting for MyInput0
                     	
                      #endregion
              
                      /// <summary>
                      /// This method is used to configure the strategy and is called once before any strategy method is called.
                      /// </summary>
                      protected override void Initialize()
                      {
              			Add(PeriodType.Tick, 1500);
              			Add(StrategyPlot(0));
                          CalculateOnBarClose = false;
                      }
              
                      /// <summary>
                      /// Called on each bar update event (incoming tick)
                      /// </summary>
                      protected override void OnBarUpdate()
                      {
                      }
              
                      #region Properties
                      [Description("")]
                      [GridCategory("Parameters")]
                      public int MyInput0
                      {
                          get { return myInput0; }
                          set { myInput0 = Math.Max(1, value); }
                      }
                      #endregion
                  }
              }
              And when compiling the same error comes up:

              Code:
              The name 'StrategyPlot' does not exist in the current context
              Feels like StrategyPlot() is deprecated

              Comment


                #8
                Hello funk101,

                Thank you for your patience.

                Do you have an indicator called StrategyPlot in your installation?

                What indicator do you need to reference for the strategy plotting to work?

                I would recommend reviewing the sample at the following link: http://www.ninjatrader.com/support/f...ead.php?t=6651

                Comment


                  #9
                  Man really?? I was doing that sample code and that's how I got this error. I simply want a way to write text on the chart while in a strategy that is similar to overriding Plot(). Follow me?

                  Comment


                    #10
                    Hello funk101,

                    Got it, makes perfect sense. What indicator exists in your installation for the purpose of being called by the strategy to draw the text? It would seem the error you get is due to the fact the StrategyPlot does not exist. Correct me if I am wrong and please provide details on the indicator you are using.

                    Comment


                      #11
                      So in the thread example, "StrategyPlot()" is actually NOT an NT function, but just an example of "how to call an indicator for plotting"?
                      For instance, I can't just call from strategy:

                      Code:
                      public override void Plot(Graphics g, Rectangle bounds, double min, double max)
                      {
                      blah;
                      }

                      Comment


                        #12
                        I got it, in the sample there's a StrategyPlot.cs file, I did not see. I'll figure it out. Thanks

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Jimmyk, 01-26-2018, 05:19 AM
                        6 responses
                        834 views
                        0 likes
                        Last Post emuns
                        by emuns
                         
                        Started by jxs_xrj, 01-12-2020, 09:49 AM
                        6 responses
                        3,290 views
                        1 like
                        Last Post jgualdronc  
                        Started by Touch-Ups, Today, 10:36 AM
                        0 responses
                        9 views
                        0 likes
                        Last Post Touch-Ups  
                        Started by geddyisodin, 04-25-2024, 05:20 AM
                        11 responses
                        62 views
                        0 likes
                        Last Post halgo_boulder  
                        Started by Option Whisperer, Today, 09:55 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post Option Whisperer  
                        Working...
                        X