• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

1 Minute Swing Scalp in Strategy Builder

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

    1 Minute Swing Scalp in Strategy Builder

    I am using Strategy Builder to try and construct a simple 1 point scalp on the 1 minute chart with an optional scale-in on an 8 tick adverse move. I have attached the strategy. I wanted to filter out swings which have a range of <= 7 ticks. I tried to do this using an offset of the swing indicator high vs. low, image attached.

    Apparently Condition Builder had an issue with this, because the strategy would not run until I removed this condition. Is there any way I can define a range, from high to low, in such a way? I would like to have enough room to resistance to have a reasonable chance to get at least 4 ticks.

    Thanks. 1MinSwingScalpLong.zip
    ​​​​​​​

    #2
    Hello Bionian,

    Thank you for your post.

    I've added this setup to the strategy, and it runs for me, just doesn't often take trades - I ran this on a 1 year 60 minute NQ chart and it only took 585 trades over the entire year. Is it disabling itself when you add the strategy to the chart, or do you just not see trades being taken? What instrument and interval chart are you trying it with?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply. When I tried to run the strategy on the chart (NOT on the strategy tab on the control center, but the actual 1 min chart), and checked enable, I got no signals, at least that I could see. Perhaps the way I constructed it, I accidentally made it too restrictive. This is intended to be a 1 minute strategy for tight trading ranges- 4 to 6 or 8 points, to scalp long for 1 point at the bottom, and sell at the top for a 1 point scalp. Then on a 2 point adverse move, there would be a second entry to scale into the losing position. Trading range breakouts usually fail, so any breakout could be bought, mimicking a limit order. The reason for restricting the range to 7 ticks or more it to filter out trades which have too much close overhead supply. Perhaps what I created was in error.

      However, this 7-tick restriction may not even be necessary as long as the strategy will automatically reverse and enter in the opposite direction on an opposite signal. There would probably be at least enough room to get a 1-2 tick scratch.

      It seems that the strategies I have created so far automatically reverse positions on a valid signal in the opposite direction. How can I set up the strategy in Strategy Builder to make sure this happens? Then the range may not be important anyway.

      Thanks-
      Rick

      Comment


        #4
        Hello Rick,

        Thank you for your reply.

        Might have just been the instrument you tried it on. I've got it running right now on a 1 minute ES 12-19 chart and from the 7th through today I see 94 trades.

        When calling an entry method in the opposite direction of your current position this will cause your position to be reversed. NinjaTrader will automatically submit an order to close your existing position and then enter an order to enter you into the opposite position.

        Note, though, if you call an exit method (like ExitShort, stops and targets don't count for this) and call an entry method in the same run of OnBarUpdate, which occurs once per bar, the OnPositionUpdate() method will not have yet run and NinjaTrader will not have known that your position is closed.

        This will cause both actions to complete and end up sending 3 orders. The first order is the exit position from your exit method, the second order is to close the position from NinjaTrader automatically reversing your position, the third order is to enter you into the opposite position.

        The result is that either the script will double the quantity when it reverses or it will cause an overfill and stop the script.

        From the help guide:

        "Entry() methods will reverse the position automatically. For example if you are in a 1 contract long position and now call EnterShort() -> you will see 2 executions, one to close the prior long position and the other to get you into the desired 1 contract short position."

        https://ninjatrader.com/support/help...d_approach.htm

        So, just make sure you aren't using Exit methods along with the entry and you're good.

        I'm about to review your email from yesterday, so I'll reply back to that through the ticketing system.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Kate,

          I'm not sure I understand, but yesterday I was getting unexpected orders on this different strategy. Could that be what was going on? ReversalWStochLongShortAutoTrading.zip

          Comment


            #6
            Hello Rick,

            Thanks for your reply.

            That wouldn't be the case with this latest strategy - you're not using Exit orders in this one, just entries. I think what you're running into is possibly calling EnterLong or EnterShort twice causing unexpected behavior, but it could very well have to do with trying to submit orders with a quantity of 0; I'd need to do some testing. Have you tried turning on Trace Orders to see what's being submitted or ignored or rejected?

            Strategy Builder > Default Properties > More Properties > Trace Orders

            Once you then recompile the strategy, you can open a new NinjaScript Output window under New > NinjaScript Output. This will print a log of any orders submitted by the strategy during while it's running, along with any ignored orders. You can then look through and see what may be occurring.

            Here is a link to our help guide that goes into more detail on tracing orders:

            https://ninjatrader.com/support/help...aceorders2.htm

            If you are unsure what the order trace tells you, I'd be happy to take a look at what you get.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Actually, this strategy should have exit orders, both stop loss and profit targets. See attachment. There are 2 long positions and 2 short positions, each with a stop-loss and profit target. 8 total exits.

              Click image for larger version  Name:	Reversal strategy stops and targets.PNG Views:	0 Size:	29.2 KB ID:	1080824
              Attached Files

              Comment


                #8
                Hi Rick,

                Thank you for your reply.

                Those would be what we'd refer to as "Set" orders. They're a little different from an exit, as they're specifically profit targets. When I say Exit orders, I mean what you'd see in the Actions section of the builder, like "Exit Long" and "Exit Long LImit".

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ksarin, Today, 04:31 PM
                0 responses
                3 views
                0 likes
                Last Post ksarin
                by ksarin
                 
                Started by ralett, Today, 03:39 PM
                0 responses
                8 views
                0 likes
                Last Post ralett
                by ralett
                 
                Started by koganam, Today, 03:17 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Kate  
                Started by DTSSTS, Today, 02:46 PM
                4 responses
                14 views
                0 likes
                Last Post DTSSTS
                by DTSSTS
                 
                Started by koganam, Today, 03:02 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X