Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scaling up a position

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

    Scaling up a position

    Hello,
    I'd like to buy/short an extra contract automatically if my current position is in profit of 12 ticks for the ES.

    Can someone please guide me how this can be achieved from coding perspective?

    Very much appreciate your help in advance.

    #2
    Hello pandyav,

    So the first step in this would be to get your entry price so that you can compare it to the current market price which you can typically get from the Position.AvgPrice, then you can enter in another order on you have the desired number of ticks in profit.

    Here is a link to our Help Guide that demonstrates this that you may view.


    Note that you will have to change your EntryHandling to be able to handle the additional orders. So for example you may want to use the "EntryHandling.UnqiueEntries" and give each entry order a different name.


    Let me know if you have any questions.
    JCNinjaTrader Customer Service

    Comment


      #3
      @NinjaTrade_JC,
      Thank you for your insight. I placed the statement you suggested in the strategy as below. What I am trying to achieve is the following:
      On long signal, enter two positions, 1st with a profit target of 2 and 2nd one with a profit target of 6 points. But, if the position move 3 points in my favor, I also want to enter a third position with a profit target of 3 additional points.

      The problem I am running into is that all the 3 positions are entered very much at the same point when the long signal is received. Can you please help me to figure out what am I doing wrong? I am attaching the screenshot for your reference.

      Very much appreciate your help in advance.

      if (CurrentBar < 0 || BarsInProgress != 0)
      return;
      //Long Entry
      if (VsTWPColor(wave).Power5[0] >= 1
      && (VsTWPColor(wave).Power5[0] <= 2
      && AAATS_TrendWithPower(wave).TrendUp.ContainsValue(0 )
      && AAATS_TrendWithPower(BarsArray[1],highertimewave).TrendTicksCount[0]>=1
      && AAATS_TrendWithPower(BarsArray[1],highertimewave).TrendTendance[0]>=1


      && (ToTime(Time[0]) >= 83000 && ToTime(Time[0]) <= 150000)))
      {
      EnterLong(1,"Long 1");
      EnterLong(1,"Long 2");
      if (Close[0]>=Position.AvgPrice + 12 *TickSize)
      EnterLong(1,"Long 3");
      }
      Attached Files

      Comment


        #4
        Hi Pandyav,

        Was this a live trade or a historical trade on the chart?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          JC,

          I don't know if this is along the same lines but I would like to know if I can, through Market Wizard, scale up a position? Specifically, I would like to open a position with one order and if it hits say 15 tics, add a contract and once again at 30 tics. Additionally, I would want to move my stop loss up to break even during each one of these adds.

          Also, I would like to be able to Trace orders like found in this link ( http://www.ninjatrader.com/support/f...ead.php?t=3627 ). Can this be done in Market Wizard?

          In case you haven't guessed, I am not a programmer....yet. ;-)

          Best regards,

          Dolfan

          Comment


            #6
            Hello Dolfan,

            Thanks for your post.

            The strategy wizard is intended for simple strategies and while it may be possible to add multiple orders with multiple training stops I think you would quickly run up against the limitations of the wizard and not be able to achieve your goals. TraceOrders() is not an option in the strategy wizard. In this case I would suggest to consider coding your strategy directly in Ninjascript.

            You have two paths with Ninjascript, you can write and create on your own (if you like I can provide reference links for learning Ninjascript) or if you like we can provide references to 3rd party programmers who would be able to provide quotations for the programming service.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              References would be much appreciated. Thanks!

              Best regards,

              Dolfan

              Comment


                #8
                Hello Dolfan,

                Thanks for your reply. Can you clarify if you are looking for the reference links to learn Ninjascript or are you asking for the 3rd party reference?
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Oops, sorry. References to Ninjascript.

                  Dolfan

                  Comment


                    #10
                    Hello Dolfan,

                    Thanks for your reply.

                    For information on running strategies please visit the following link: http://www.ninjatrader.com/support/h...strategies.htm

                    If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started with Ninja Script. You will find language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first indicator and get you started with some of these concepts.
                    A link to our Help Guide can be found below: http://www.ninjatrader.com/support/h...?tutorials.htm

                    I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript: http://www.ninjatrader.com/support/h..._resources.htm

                    You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:
                    Click here to see our NinjaScript Reference Samples: http://www.ninjatrader.com/support/f...splay.php?f=30
                    Click here to see our NinjaScript Tips: 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 also 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
                    Paul H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by RideMe, 04-07-2024, 04:54 PM
                    5 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by f.saeidi, Today, 08:13 AM
                    1 response
                    4 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by DavidHP, Today, 07:56 AM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by kujista, Today, 06:23 AM
                    3 responses
                    9 views
                    0 likes
                    Last Post kujista
                    by kujista
                     
                    Started by Mindset, Yesterday, 02:04 AM
                    2 responses
                    18 views
                    0 likes
                    Last Post NinjaTrader_RyanS  
                    Working...
                    X