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

Learn code, first stratégy, patience & comprehension

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

    Learn code, first stratégy, patience & comprehension

    Hello world

    Im french, i want to learn code on ninjatrader and i'm here to share with you good idea and find lot of, lot of help. I have no knowledge in coding, but i know prcisely what i want.
    For some people its the most important, but without one we make nothing without other. Typicall french sentence lol

    So welcome in my Post

    #2
    Hello ramonne69,

    Thanks for your post and welcome to the NinjaTrader forums!

    With NinjaTrader you can create strategies through the strategy builder which is a non-programming interface or directly in Ninjascript which are methods and properties based on C# programming language.

    Here is a link to the strategy builder in the : http://ninjatrader.com/support/helpG...gy_builder.htm Note: links direct you to the helpguide and each page will have links to further pages.
    Here is a link to our public training webinar on using the strategy builder: https://www.youtube.com/watch?v=HCyt...ZmVnauWXkWe0Nf

    If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started. You will find language references to all of the methods and functions you will be using. As Ninjascript is based on C# programming language you may want to seek out a course on C# programming as Ninjascript will use C# syntax.



    This video introducing the NinjaScript editor is an excellent resource,

    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.3:11 Creating a New NinjaScript Strategy13:52 Analyz...


    You will find reference samples online as well as some tips and tricks for both indicators and strategies:




    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

    There is a growing library of user-submitted custom indicators (100+) and strategies that can be downloaded from our support form. Please look in the NinjaScript file sharing section of our support forum as you may find what you are looking for there:



    Finally, the following link is to our help guide with an alphabetical reference list to all supported methods, properties, and objects that are used in NinjaScript.

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Alambert, money management

      Hi Paul,
      Thanks for all those information !

      I find a money management in Calgo based on martingal of Mahematician Alembert,
      I want to translate this in ninjatrader script, if some people are interesting to work on with me ;

      namespace cAlgo
      {
      [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
      public class Alembex : Robot
      {
      [Parameter("Initial Volume", DefaultValue = 10000, MinValue = 0)]
      public int InitialVolume { get; set; }

      [Parameter("Stop Loss", DefaultValue = 40)]
      public int StopLoss { get; set; }

      [Parameter("Take Profit", DefaultValue = 40)]
      public int TakeProfit { get; set; }

      private Random random = new Random();
      private long pertesVolume = 0;
      private int nombreDeGain = 0;

      protected override void OnStart()
      {
      Positions.Closed += OnPositionsClosed;
      pertesVolume = InitialVolume;

      ExecuteOrder(InitialVolume, GetRandomTradeType());
      }

      private void ExecuteOrder(long volume, TradeType tradeType)
      {
      var result = ExecuteMar****rder(tradeType, Symbol, volume, "Alembex", StopLoss, TakeProfit);

      if (result.Error == ErrorCode.NoMoney)
      Stop();
      }

      private void OnPositionsClosed(PositionClosedEventArgs args)
      {
      var position = args.Position;

      if (position.Label != "Alembex" || position.SymbolCode != Symbol.Code)
      return;

      if (position.GrossProfit > 0)
      {
      nombreDeGain += 1;
      Print("Gain");

      if (nombreDeGain == 1)
      {
      Print("Premier Gain (Cumul de pertes depuis le dernier gain : ", pertesVolume, ")");
      ExecuteOrder(pertesVolume, GetRandomTradeType());
      }
      else
      {
      ExecuteOrder(InitialVolume, GetRandomTradeType());
      }

      pertesVolume = InitialVolume;
      }
      else
      {
      nombreDeGain = 0;
      Print("Perte");
      pertesVolume += position.Volume;
      ExecuteOrder((int)position.Volume, position.TradeType);
      }

      Print("Volume : ", position.Volume);
      Print("Volume pertes : ", pertesVolume);
      Print("---");
      }

      private TradeType GetRandomTradeType()
      {
      return random.Next(2) == 0 ? TradeType.Buy : TradeType.Sell;
      }
      }
      }

      Comment


        #4
        Hello ramonne69,

        Thanks for your post.

        Just to be clear, in the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

        We can certainly leave this thread open for any forum members who would like to assist you with converting.

        Alternatively, if you would like your strategy created for you, we can provide references to 3rd party programmers who are skilled in Ninjascript strategy development.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          hi,
          All right.
          Do you know a community, an forum with ninjatrader coder who you share with us ?
          thanks

          Comment


            #6
            Hello ramonne69,

            Thanks for your reply.

            If you are asking for a free resource I could not advise of any.

            If you are asking for a professional coder, please let us know and we can certainly provide references.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              I live in free world and share, i think you know what i mean, so thanks for your reply, i will search by myself
              Dont erase my post, Calgo Alembert code could interested some persone.
              Thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,266 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X