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

Strategies sharing forum here?

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

    Strategies sharing forum here?

    I notice that the Strategy sharing section has only 7 strategies listed while teh indicators has hundreds. Is there any other place /source for already ready made strategies which can then be modified to suit one's purpose?

    #2
    Originally posted by ju1234 View Post
    I notice that the Strategy sharing section has only 7 strategies listed while teh indicators has hundreds. Is there any other place /source for already ready made strategies which can then be modified to suit one's purpose?
    Hello,

    Thank you for your post.

    I am not aware of any other complete NinjaScript strategies for share.

    However, you can use the reference samples and modify them to your needs: http://www.ninjatrader-support2.com/...splay.php?f=30
    Ray S.NinjaTrader Customer Service

    Comment


      #3
      ju1234,

      I think strategies are probably so much more time consuming that when one finds one that works, they are reluctant to share.

      I am very thankful for all the time people take to work up indicators and such, but I have to admit, I too am one of the people that don't share my strategies beyond my family.

      But I think you should not give up:

      a) Read NT forums or go to EliteTrader forums and people share the ideas behind what works for them quite often. For instance, I will share that my most profitable strategies are based on a simple SMA cross of around 9 and 100.

      b) Code the strategy yourself, or use one of the talented NT certified consultants. Basically if you can write up a plan on paper that shows when to buy and when to sell, you can give that to a consultant and they will give you back a strategy. This route is great for those who aren't interested in learning C#. It may cost you a few hundred bucks, but in the grand scheme of things, that is next to nothing if you are trading for a living.

      c) Look around on Google for strategies on other popular platforms, mainly TradeStation. Then you can use similar concepts and convert those to Ninja C#.

      Good hunting!

      Comment


        #4
        Thank you , that is great.

        I looked at one of them: Sample time filter. I am new to this stuff. If I understand it right, this is not just a time filter it is time filter added to a simple action series. Right?

        That means if I put just the following portion of the code to a preexisting strategy, that will make the strategy work during the hours specified?

        /* Checks to see if the time is during the busier hours (format is HHMMSS or HMMSS). Only allow trading if current time is during a busy period.
        The timezone used here is (GMT-05:00) EST. */
        if ((ToTime(Time[0]) >= 93000 && ToTime(Time[0]) < 120000) || (ToTime(Time[0]) >= 140000 && ToTime(Time[0]) < 154500))
        {

        I assume that it must be inserted just before the "action" like enter long etc.

        I do not understand the role of { in the code. I assume each conditionand action together must be between opening and closing brackets, right?

        Thank you.

        Comment


          #5
          Originally posted by ju1234 View Post
          Thank you , that is great.

          I looked at one of them: Sample time filter. I am new to this stuff. If I understand it right, this is not just a time filter it is time filter added to a simple action series. Right?

          That means if I put just the following portion of the code to a preexisting strategy, that will make the strategy work during the hours specified?

          /* Checks to see if the time is during the busier hours (format is HHMMSS or HMMSS). Only allow trading if current time is during a busy period.
          The timezone used here is (GMT-05:00) EST. */
          if ((ToTime(Time[0]) >= 93000 && ToTime(Time[0]) < 120000) || (ToTime(Time[0]) >= 140000 && ToTime(Time[0]) < 154500))
          {

          I assume that it must be inserted just before the "action" like enter long etc.

          I do not understand the role of { in the code. I assume each conditionand action together must be between opening and closing brackets, right?

          Thank you.
          The { } brackets enclose a set or group of operations. If you need to do 2 or 20 things for instance after a certain condition is true (like a certain time or a certain SMA value, etc) then you group them using { } brackets so it knows where to start/end that group.

          I think the best way to learn is by looking at example code. So I would look at the built-in NT examples like you are doing and also look at the indicators. You can open indicator code using Tools -> Edit Ninjascript -> indicators. The language is the same with an indicator as with a strategy, for the most part.

          Another way is to use the Condition Builder wizard to get you started, then unlock the code and you know what you told the wizard and you can see what the wizard did, so you can make sense of it then elaborate on it.

          Comment


            #6
            BTW,

            Code:
            [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ((ToTime(Time[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) >= [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]93000[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] && ToTime(Time[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) < [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]120000[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]) || (ToTime(Time[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) >= [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]140000[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] && ToTime(Time[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) < [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]154500[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]))
            {
            do;
            this;
            stuff;
            }
            [/SIZE][/FONT]


            The above code basically says if the time of the bar is 9:30am or after (local PC time) but before 12:00 noon, or if it is 2:00pm or after, but before 3:45pm, then do; this; stuff;.

            && means and
            || means or

            so ie:

            if (Rising(SMA(9)) && Falling(SMA(100))) { Print ("Rising SMA 9 ---and--- falling SMA 100"); }

            but...

            if (Rising(SMA(9)) || Falling(SMA(100))) { Print ("Rising SMA 9 ---or--- falling SMA 100"); }

            Good luck..

            Comment


              #7
              Thank you very much.

              Comment


                #8
                Also I shared a work in progress strategy here:



                Good hunting!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cre8able, Yesterday, 01:16 PM
                3 responses
                11 views
                0 likes
                Last Post cre8able  
                Started by Harry, 05-02-2018, 01:54 PM
                10 responses
                3,203 views
                0 likes
                Last Post tharton3  
                Started by ChartTourist, Today, 08:22 AM
                0 responses
                6 views
                0 likes
                Last Post ChartTourist  
                Started by LiamTwine, Today, 08:10 AM
                0 responses
                2 views
                0 likes
                Last Post LiamTwine  
                Started by Balage0922, Today, 07:38 AM
                0 responses
                5 views
                0 likes
                Last Post Balage0922  
                Working...
                X