Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sample strategy.

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

    sample strategy.



    people with nt,



    i have been reading on the nt vendor program.



    there are multiple recommendations in those sections for distribution, best practices, encryption and multiple other situations.


    i request that nt provide a sample of how does a distributed file looks like, specially one that follows all the recommendations.



    very well, regards.


    #2
    Hello rtwave,

    For samples of how to export items for the vendor program you would need to become a vendor and speak with the representative you are working with about guidelines and the samples they have.
    JesseNinjaTrader Customer Service

    Comment


      #3

      people with nt,


      thanks.


      my interest in inspecting files that have been prepared for distribution is due to the fact that i am certain that the files i have right now are nowhere near what a distributed file could look like. i would like to have an idea of what i would be getting into if i participate in the nt vendor program before i do register for the nt vendor program.

      Comment


        #4
        Hello rtwave,

        Your question is not clear here. What specifically are you asking to see that is prepared? A compiled assembly is not something you can explore so you won't be able to see what an already distributed file contains. That also won't be a good item to compare against, all items that get compiled are different due to what is contained, your export will be unique based on what you export.

        To see the code for licensing specifically you have to become a vendor and get the samples/guide on how to edit your item to support licensing. General compiled exports will all differ based on the contents, there is not a specific example that you should try to achieve. The guidelines in the help guide are for specific coding concepts which include how the platform works like including templates or files, or coding concepts known to cause issues so there are certain standards.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Code:
          #region Using declarations
          using System;
          using System.Collections.Generic;
          using System.ComponentModel;
          using System.ComponentModel.DataAnnotations;
          using System.Linq;
          using System.Text;
          using System.Threading.Tasks;
          using System.Windows;
          using System.Windows.Input;
          using System.Windows.Media;
          using System.Xml.Serialization;
          using NinjaTrader.Cbi;
          using NinjaTrader.Gui;
          using NinjaTrader.Gui.Chart;
          using NinjaTrader.Gui.SuperDom;
          using NinjaTrader.Gui.Tools;
          using NinjaTrader.Data;
          using NinjaTrader.NinjaScript;
          using NinjaTrader.Core.FloatingPoint;
          using NinjaTrader.NinjaScript.Indicators;
          using NinjaTrader.NinjaScript.DrawingTools;
          #endregion
          
          //This namespace holds Strategies in this folder and is required. Do not change it.
          namespace NinjaTrader.NinjaScript.Strategies
          {
              public class tealternatingcurrentbar : Strategy
              {
                  protected override void OnStateChange()
                  {
                      if (State == State.SetDefaults)
                      {
                          Description                                    = @"te alternating current bar.";
                          Name                                        = "tealternatingcurrentbar";
                          Calculate                                    = Calculate.OnBarClose;
                          EntriesPerDirection                            = 1;
                          EntryHandling                                = EntryHandling.UniqueEntries;
                          IsExitOnSessionCloseStrategy                = true;
                          ExitOnSessionCloseSeconds                    = 30;
                          IsFillLimitOnTouch                            = false;
                          MaximumBarsLookBack                            = MaximumBarsLookBack.TwoHundredFiftySix;
                          OrderFillResolution                            = OrderFillResolution.Standard;
                          Slippage                                    = 8;
                          StartBehavior                                = StartBehavior.ImmediatelySubmitSynchronizeAccount;
                          TimeInForce                                    = TimeInForce.Gtc;
                          TraceOrders                                    = false;
                          RealtimeErrorHandling                        = RealtimeErrorHandling.StopCancelCloseIgnoreRejects;
                          StopTargetHandling                            = StopTargetHandling.PerEntryExecution;
                          BarsRequiredToTrade                            = 1;
                          // Disable this property for performance gains in Strategy Analyzer optimizations
                          // See the Help Guide for additional information
                          IsInstantiatedOnEachOptimizationIteration    = true;
                          Posi                    = 1;
                      }
                      else if (State == State.Configure)
                      {
                      }
                  }
          
                  protected override void OnBarUpdate()
                  {
                      if (BarsInProgress != 0)
                          return;
          
                      if (CurrentBars[0] < 1)
                          return;
                                  
          
                       // Set 1
                      if (CurrentBar % 2 == 0)
                      {
                          EnterShort(Convert.ToInt32(Posi), "");
                      }
                      
                       // Set 2
                      if (CurrentBar % 2 == 1)
                      {
                          EnterLong(Convert.ToInt32(Posi), "");
                      }
                      
                  }
                  
                  #region Properties
                  
                  [NinjaScriptProperty]
                  [Range(1, int.MaxValue)]
                  [Display(Name="Posi", Description="posi.", Order=1, GroupName="Parameters")]
                  public int Posi
                  { get; set; }
          
                  #endregion
              }
          }

          this strategy works just as it is intended to. ¿what kind of additions and changes would it need in order for it to be ready to be distributed to clients? that is what i am trying to visualize.
          Last edited by rtwave; 01-17-2025, 09:59 PM.

          Comment


            #6
            Hello rtwave,

            Unless you are becoming a vendor there is nothing else you need to do beside export it. If you wanted to hide the code during the export you can use a compiled assembly.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by gustavobp, Yesterday, 05:30 AM
            2 responses
            19 views
            0 likes
            Last Post gustavobp  
            Started by preqc, 04-10-2022, 01:26 PM
            2 responses
            207 views
            0 likes
            Last Post mixedbyclaudio  
            Started by defa0009, 12-13-2024, 09:19 AM
            23 responses
            256 views
            1 like
            Last Post marcus2300  
            Started by srtrader, 02-12-2025, 09:01 PM
            3 responses
            28 views
            0 likes
            Last Post rockmanx00  
            Started by bertochi, 02-14-2025, 05:25 PM
            2 responses
            33 views
            0 likes
            Last Post bertochi  
            Working...
            X