Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

scale out

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

    scale out

    Hello,

    when I do a trade with multiple contracts I do the entries with eg 4 x 1 contract for having different targets and to get out at the profittarget with the same name (that is related to the entry.)

    But I´d like to do instead an entry with 1 x 4 contracts and to scale out from this 4-contract-position every time a target is reached.

    I couldn´t code this. How can I do? Thanks for help.

    Best regards
    Tony

    #2
    Originally posted by tonynt View Post
    Hello,

    when I do a trade with multiple contracts I do the entries with eg 4 x 1 contract for having different targets and to get out at the profittarget with the same name (that is related to the entry.)

    But I´d like to do instead an entry with 1 x 4 contracts and to scale out from this 4-contract-position every time a target is reached.

    I couldn´t code this. How can I do? Thanks for help.

    Best regards
    Tony
    From this page: http://www.ninjatrader.com/support/h...d_approach.htm

    I get this snippet:

    Closing a Partial Position using an Exit Method
    You can close out a partial position by specifying the exit quantity. The following example goes long 3 contracts. Each subsequent bar update will submit a market order to exit one contract until the position is completely closed. ExitLong(1) will be ignored if a long market position does not exist.

    Code:
    protected override void OnBarUpdate()
    {
        if (CrossAbove(SMA(10), SMA(20), 1))
             EnterLong(3);
     
        ExitLong(1);
    }

    Comment


      #3
      scale out

      Hello,

      koganam thank you for your reply.

      Best
      Tony

      Comment


        #4
        Hello,

        coming back to this trade management I think now what would be the best for handling the corresponding stops? Eg in the sample here with EnterLong(3) how can it be done so that after the ExitLong(1) the stoplossquantity is 2. How would this be done when working instead of setstoploss with exitlongstop?


        Thanks
        Tony
        Last edited by tonynt; 01-05-2013, 10:38 AM.

        Comment


          #5
          Originally posted by tonynt View Post
          Hello,

          coming back to this trade management I think now what would be the best for handling the corresponding stops? Eg in the sample here with EnterLong(3) how can it be done so that after the ExitLong(1) the stoplossquantity is 2. How would this be done when working instead of setstoploss with exitlongstop?


          Thanks
          Tony
          Reissue the stop order with the correct quantity specified.

          Comment


            #6
            Hello,

            thank you for your reply. This is a good idea but how can I fill the new stop with the "actual" quantity in the market. I dont know how to verify this state and add in the syntax of the script like "... if marketposition == long..check quantity and fill exitlongstop(..qty...)"


            Thanks
            Tony

            Originally posted by koganam View Post
            Reissue the stop order with the correct quantity specified.

            Comment


              #7
              Originally posted by tonynt View Post
              Hello,

              thank you for your reply. This is a good idea but how can I fill the new stop with the "actual" quantity in the market. I dont know how to verify this state and add in the syntax of the script like "... if marketposition == long..check quantity and fill exitlongstop(..qty...)"


              Thanks
              Tony
              Two ways.
              1. You know how many you were in, so if targets are filled, you know how many should be left. Just a matter of subtraction as targets are filled; or
              2. Use Position.Quantity to either confirm your calculations, or as an absolute measure.

              Comment


                #8
                Hello,

                ad 1. I do not know. Or maybe I know, but how can I bring in to a script during a trade??

                ad 2. Thank you. This is what I was looking for to use it in exitlongstop(...Position.Quantity...). Hope this works.

                Best
                Tony

                Originally posted by koganam View Post
                Two ways.
                1. You know how many you were in, so if targets are filled, you know how many should be left. Just a matter of subtraction as targets are filled; or
                2. Use Position.Quantity to either confirm your calculations, or as an absolute measure.

                Comment


                  #9
                  Originally posted by tonynt View Post
                  Hello,

                  ad 1. I do not know. Or maybe I know, but how can I bring in to a script during a trade??

                  ...
                  Best
                  Tony
                  You know how many you entered into the position. You know how many you exited. So the difference is the difference. If you started with 3 contracts, then after profit is taken on 1 contract, you are left with 3 - 1 = 2 contracts.

                  What am I missing here?

                  Comment


                    #10
                    How will you work with this information in a script that is running? I can watch it, I can write it on paper, I can make a screenshot. But how could I use this information and work with in a script running this moment? Stopping the strategy and bringing in the stop manually?

                    Originally posted by koganam View Post
                    You know how many you entered into the position. You know how many you exited. So the difference is the difference. If you started with 3 contracts, then after profit is taken on 1 contract, you are left with 3 - 1 = 2 contracts.

                    What am I missing here?

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    79 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    45 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    29 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    32 views
                    0 likes
                    Last Post TheRealMorford  
                    Started by Mindset, 02-28-2026, 06:16 AM
                    0 responses
                    66 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Working...
                    X