Announcement

Collapse
No announcement yet.

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.

    http://ninjatrader.com/support/helpG..._resources.htm

    This video introducing the NinjaScript editor is an excellent resource,

    https://www.youtube.com/watch?v=BA0W...ZmVnauWXkWe0Nf

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

    http://www.ninjatrader.com/support/f...splay.php?f=30
    http://www.ninjatrader.com/support/f...ead.php?t=3229

    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:

    http://www.ninjatrader.com/support/f...splay.php?f=37

    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.

    http://ninjatrader.com/support/helpG..._reference.htm
    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 = ExecuteMarketOrder(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 iseseora, Today, 11:55 PM
              0 responses
              1 view
              0 likes
              Last Post iseseora  
              Started by dorotwart, Today, 11:43 PM
              0 responses
              2 views
              0 likes
              Last Post dorotwart  
              Started by MatthewLesko, Today, 11:13 PM
              0 responses
              3 views
              0 likes
              Last Post MatthewLesko  
              Started by Lance El Camino, Today, 04:14 PM
              1 response
              13 views
              0 likes
              Last Post s.kinra
              by s.kinra
               
              Started by jtrading82, Today, 04:56 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Working...
              X