Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entries Count per minute

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

    #16
    Well here's what was happening, I was just testing ticker SPWR from 1/1/13-1/18/13 on a 10minute time frame and using 1.15 for percmove. When I add all the additional coding for the bool and barssinceentry the trade no longer occurs. Can you test that by any chance? Can you just paste in the additional else if's below so it looks back the full 6 bars so we are on the same page?

    else if (Close[0] > (Open[2]*percmove))
    {
    EnterLong(Convert.ToInt32(Math.Round(1000/Close[0])));
    }

    else if (Close[0] > (Open[3]*percmove))
    {
    EnterLong(Convert.ToInt32(Math.Round(1000/Close[0])));
    }

    else if (Close[0] > (Open[4]*percmove))
    {
    EnterLong(Convert.ToInt32(Math.Round(1000/Close[0])));
    }

    else if (Close[0] > (Open[5]*percmove))
    {
    EnterLong(Convert.ToInt32(Math.Round(1000/Close[0])));
    }

    Comment


      #17
      Zachj,

      Based off your code you are adding 15% to the value of Open which is a lot. Since the Open value is point based.

      I was running the strategy on the ES instrument and based of the price point and the percentage your conditions would very rarely become true.

      You may want to put the percmove in ticks rather than points for the instrument.
      Cal H.NinjaTrader Customer Service

      Comment


        #18
        I know that it's a lot typically, but when your looking at stocks under $10, it's not that much. This code was triggering a trade in SPWR and now with this boolean code added it's suddenly not. I even tried changing it to a measley 1% and still nothing. Something is off.

        Comment


          #19
          Wait I took out...
          if (Historical)
          return;

          and it now is picking up the trade. Why is that? I'm not too farmiliar with Historical but it looks like it's only for live trading purposes and not for back testing.

          Comment


            #20
            Zachj,

            Correct,
            Code:
            if(historical) return;
            will not work with back tests. This will let you have it so that you do not have to worry about historical trades showing up when running live.
            Cal H.NinjaTrader Customer Service

            Comment


              #21
              Not a great strategy but the boolean code seems to be fulfilling its purpose successfully and I can reuse this code. Thanks for everyone's help. I just want to add, they should really make the sample code ChelseaB posted available in the manual or at least more detail. All the manual says is if (BarsSinceEntry() > 2) and no mention of the boolean code, maybe this is simple to some people but obviously not to everyone as I see tons of posts with people having trouble with this and trades not firing. Might save time for the support team and everyone else to add more details for re-occuring issues to the manual and speed up the advancement of the software in the end.

              Comment


                #22
                zachj,

                Thank you for your feedback in this area. We will be revisiting our training documents in the next major release of NinjaTrader.
                MatthewNinjaTrader Product Management

                Comment


                  #23
                  Follow up question on this... if I have a multi instrument script is there anyway to gear the performance script below so that it's < 1 trade per individual instrument instead of all instruments combined? Or a way to incorporate the BIP.

                  if (Performance.AllTrades.Count <1)

                  I can set the BarsSinceEntry to use a specific BIP but I'm guessing this is not possible with the Performance code?

                  If not is there any other way I can have it track the # of trades per instrument? Basically wanting it to say if there has been no trades for this particular instrument continue, if there has been 1 or more trades for particular instrument make sure 2 bars have passed.
                  Last edited by zachj; 08-10-2013, 03:46 PM.

                  Comment


                    #24
                    Zachj,

                    You can test for market position by using Positions. This will allow you to select which instrument to test against and if they are in a position and such.

                    See the link below on more information from our help guide -
                    http://www.ninjatrader.com/support/h...?positions.htm
                    Cal H.NinjaTrader Customer Service

                    Comment


                      #25
                      Ok so how would I replicate..
                      if (Performance.AllTrades.Count <1)

                      by using Postions.MarketPosition?

                      I figured I would just do this below but it now won't trigger any trades..

                      if (Positions[0].MarketPosition == 0)

                      Comment


                        #26
                        ZachJ,

                        You would test Positions.MarketPosition == MarketPosition. Flat, Short, or Long. Not against a hard number.

                        If you testing for zero positions then you would test for flat.
                        Cal H.NinjaTrader Customer Service

                        Comment


                          #27
                          If 0 trades had been triggered no trades would trigger at all, that's why I put in the if (Performance.AllTrades.Count <1) to get the first trade to trigger. If 1 or more trade was active I then had BarsSinceEntry() > 5 to make sure at least 5 bars have passed since last entry. If I use Flat it won't allow 2 simultaneous positions for an instrument. Is that the best I can hope for for multi instrument though?

                          Comment


                            #28
                            ZachJ,

                            You can then try Position.Quantity to get the quantity of the positions.

                            http://www.ninjatrader.com/support/h...l?quantity.htm

                            Is this what you are looking for?
                            Cal H.NinjaTrader Customer Service

                            Comment


                              #29
                              ok so if (Performance.AllTrades.Count <1) for single series should be equivalent to
                              if (Positions[0].Quantity < 1) for multiple series?

                              Comment


                                #30
                                Zachj,

                                Correct. These are the same when one is used for a single series and the other is for multiple series.
                                Cal H.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                599 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                344 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                103 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                558 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                557 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X