Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sample strategy.

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

  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • rtwave
    replied
    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.

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • rtwave
    replied

    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.

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • rtwave
    started a topic sample strategy.

    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.

Latest Posts

Collapse

Topics Statistics Last Post
Started by IanS00, Today, 01:55 PM
1 response
6 views
0 likes
Last Post NinjaTrader_Jesse  
Started by Marble, Today, 05:00 AM
2 responses
19 views
0 likes
Last Post Marble
by Marble
 
Started by wallace15269, 01-16-2025, 12:05 PM
5 responses
98 views
0 likes
Last Post wallace15269  
Started by several, 03-18-2025, 03:53 AM
9 responses
123 views
1 like
Last Post ntwong
by ntwong
 
Started by lkuo.me, 04-09-2017, 09:47 AM
2 responses
1,914 views
0 likes
Last Post coppernob108  
Working...
X