Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbie Needs Help

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

    Newbie Needs Help

    Good Morning,

    I imported the NT 7 version from the link below but I am unsure where it is and how to apply/unapply it to given strategies that I built with the Strategy Wizard. Assistance with this would be much appreciated.

    Few more questions:

    Does this work with backtesting?

    I thought I read somewhere that the counter needs to be reset daily. Is this true?

    How do I change the number of trades before the strategy is stopped?

    Last, how do I change it so it will stop the strategy based on the total number of trades (winners and losers) and just not the losers.





    Thank you.

    #2
    Hello Ram011558,

    The example you are referring to is a NinjaScript strategy, so if you wish to integrate its' code into your Strategy Wizard strategies, you will no longer be able to view or edit them using the strategy wizard.

    If you are new to working with NinjaScript, I recommend starting by reading through our educational resources section here: http://ninjatrader.com/support/helpG..._resources.htm

    You would then need to open your strategy in the code editor, as well as the example in a separate code editor, and then begin adding concepts from the example into your own strategy.

    The example you are referring to is just that, an example. It is intended to give you a basic idea of how to accomplish something, but if you want it to meet your needs specifically you will need to alter and edit it further.

    I thought I read somewhere that the counter needs to be reset daily. Is this true?
    This depends on whether you leave your strategy running for more than one session at a time. If so, then yes and this code is already included in the example.
    Code:
    if (Bars.FirstBarOfSession && FirstTickOfBar)
    {
    	lastThreeTrades = 0;
    	priorSessionTrades = Performance.AllTrades.Count;
    }
    How do I change the number of trades before the strategy is stopped?
    To do this you would normally create a property. A property allows you to set the value of a variable when applying the strategy to a chart. Then you would replace '3' or '-3' all throughout the example you are using with the property variable name 'maxTrades' or '-maxTrades'. Here is an example of how to create a property in NinjaTrader 7:
    Code:
    #region Variables
    private int maxTrades = 3; //Set the Default Value
    #endregion
    //...
    
    //...
    #region Properties
    [Description("Max Number of Trades")]
    [Category("Parameters")]
    public int MaxTrades
    {
        get { return maxTrades; }
        set { maxTrades = Math.Max(1, value); }
    }
    #endregion
    Last, how do I change it so it will stop the strategy based on the total number of trades (winners and losers) and just not the losers.
    This would involve changing the following part of the example:
    Code:
    if (trade.ProfitCurrency > 0)
    	lastThreeTrades++;
    else if (trade.ProfitCurrency < 0)
    	lastThreeTrades--;
    To something like:
    Code:
    if (trade.ProfitCurrency > 0)
    	lastThreeTrades--;
    else if (trade.ProfitCurrency < 0)
    	lastThreeTrades--;
    As we are unable to provide custom programming services here at platform support, if you require a 3rd party developer to help you develop what you are looking for, please let me know and I will have a business development representative contact you with further information.

    Please let me know if I may be of further assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Thank You

      Thanks for the quick and detailed reply. Yes, please have someone contact me regarding the 3rd party developer information.

      Once developed, a strategy built with the code editor (versus one that is built with the Strategy Wizard) can be backtested.....correct?


      Again, your help is very appreciated.

      Comment


        #4
        Originally posted by Ram011558 View Post
        Thanks for the quick and detailed reply. Yes, please have someone contact me regarding the 3rd party developer information.

        Once developed, a strategy built with the code editor (versus one that is built with the Strategy Wizard) can be backtested.....correct?


        Again, your help is very appreciated.
        Yes, that is correct. A strategy is a strategy.

        Comment


          #5
          Thanks Sledge. Don't want to be a pain but as a learning newbie, you guys are awesome!

          Comment


            #6
            Hello,

            The NinjaTrader Ecosystem partners with a number of programming consultants that offer custom coding for the NinjaTrader environment.
            Below is a link to these Certified NinjaScript Consultants. You may hover your mouse over each one for a short description.
            http://ninjatraderecosystem.com/Part...ultants.php#81

            Once you have reviewed these consultants, should you have any questions or desire an introduction please let me know and I will be happy to assist.
            JaredNinjaTrader Ecosystem

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X