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

takeprofit and stopprofit

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

    takeprofit and stopprofit

    i ask a question

    it's possible to create strategy only for takeProfit and stopProfit?
    (not the complete trade into a single signal)


    (i would like make a strategy with signal entryposition and Stop loss.....and another with takeProfit and StopProfit)


    So in my chart i apply 2 strategy.....

    #2
    Hello turbofib,

    Thank you for your post.

    It is possible to create a strategy that would look for positions on the instrument and account and then submit orders based on the position.

    However, this requires the Unmanaged Order Approach and also requires and understanding that the strategy position will not be the account position and will likely always be different.

    For information on the Unmanaged Order Approach please visit the following link: http://ninjatrader.com/support/helpG...d_approach.htm

    You would also need to look into PositionAccount: http://ninjatrader.com/support/helpG...ionaccount.htm

    Please let me know if you have any questions.

    Comment


      #3
      excuse me..but i don't understand..

      with Managed Order Approach it's possibile to do this :


      Strategy1:
      protected override void OnBarUpdate()

      if (Position.MarketPosition==MarketPosition.Flat)

      {
      if (signal ) EnterLong();
      if (signal2) EnterShort();
      }


      Strategy2:
      protected override void OnBarUpdate()

      if (Position.MarketPosition!=MarketPosition.Flat && SignalExit)

      {
      ExitLong();
      ExitShort();
      }
      It's possible to do this ?
      or i must to use Unmanaged Order Approach

      Comment


        #4
        Hello turbofib,

        Thank you for your response.

        It would not be possible to just use Exit methods as they only exit a position the strategy holds. If the position is manually entered then the strategy cannot exit that position with the exit methods.

        You can use the Unmanaged Order Approach to submit exit orders without concern on the position of the strategy.

        Please let me know if you have any questions.

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello turbofib,


          It would not be possible to just use Exit methods as they only exit a position the strategy holds. If the position is manually entered then the strategy cannot exit that position with the exit methods.
          in my strategy1 the position is entered manually?



          So if I have an exit strategy, which I use in all my trade,in managed Order Approach i always have to copy it to the original strategy, is that correct?

          Comment


            #6
            Originally posted by turbofib View Post
            in my strategy1 the position is entered manually?
            No this would be entered from the strategy. I did not understand you full use case, but now it makes sense.

            Originally posted by turbofib View Post
            So if I have an exit strategy, which I use in all my trade,in managed Order Approach i always have to copy it to the original strategy, is that correct?
            Your exit logic needs to be in the strategy. Unless you plan to develop one strategy to solely exit every strategy entry you make, which would still require what I mentioned on Unmanaged Order Approach.

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              No this would be entered from the strategy. I did not understand you full use case, but now it makes sense.


              Your exit logic needs to be in the strategy. Unless you plan to develop one strategy to solely exit every strategy entry you make, which would still require what I mentioned on Unmanaged Order Approach.
              another question....
              If i use Unmanaged Order Approach and i've 2 strategy ....how can i test it in strategy analyzer that accept only 1 strategy?

              Comment


                #8
                Hello turbofib,

                Thank you for your response.

                There is no means to have this concept backtested. You would need to implement the exit logic in the strategy itself rather than have it call another.

                Please let me know if you have any questions.

                Comment


                  #9
                  you mean :

                  StrategyEnter

                  {

                  use here StrategyExit;

                  }

                  i call strategy exit into strategyEntry ?


                  is correct?

                  Comment


                    #10
                    Hello turbofib,

                    Thank you for your response.

                    The exit logic would need to be in your entry strategy, yes. It should be placed logically in the code to ensure it can work to detect the open position of the strategy and exit appropriately. If you would like us to look into the code further to give you more details please attach the strategies to your response or send them over to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread in the body of the email.

                    You can export your strategy by going to Tools > Export > NinjaScript Add On > Add > select your strategy > OK > Export > name the file 'NTsupport' > Save. The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript.

                    Comment


                      #11
                      Hi Patrick

                      i send you a testing strategy (ProvaSignal and provaExit)

                      Can you combine it using 2 strategy ?...i don't understand how to do it

                      i want to use 2 strategy ... 1 strategy to generate signal long or short and another strategy to generate profit loss or profit target
                      I sent email in you address thanks you..

                      Comment


                        #12
                        Hello turbofib,

                        Thank you for your patience.

                        I have responded to you via email.

                        Comment


                          #13
                          excuse me..
                          i seen you script....you don't understand what i want to do

                          i would to code strategy that call another strategy into code.. See #9 (using Unmanaged Approach)


                          Ok...i give you an example with Multichart..



                          i want to do similar
                          Last edited by turbofib; 03-29-2017, 06:26 AM.

                          Comment


                            #14
                            Hello turbofib,

                            Thank you for your response.

                            I understand your inquiry, however my response may not be clear. There is no means to have a strategy for entry and a strategy for exit both backtested in the Strategy Analyzer. As I provided in my response in email, the two strategies need to become one just as the strategy I provided you.

                            NinjaTrader and other charting/analytical platforms may not function in the same way.

                            Please let me know if you have any questions.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Lumbeezl, 01-11-2022, 06:50 PM
                            31 responses
                            817 views
                            1 like
                            Last Post NinjaTrader_Adrian  
                            Started by xiinteractive, 04-09-2024, 08:08 AM
                            5 responses
                            14 views
                            0 likes
                            Last Post NinjaTrader_Erick  
                            Started by swestendorf, Today, 11:14 AM
                            2 responses
                            6 views
                            0 likes
                            Last Post NinjaTrader_Kimberly  
                            Started by Mupulen, Today, 11:26 AM
                            0 responses
                            7 views
                            0 likes
                            Last Post Mupulen
                            by Mupulen
                             
                            Started by Sparkyboy, Today, 10:57 AM
                            1 response
                            6 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Working...
                            X