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

Exit strategy....

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

    Exit strategy....

    Hello,

    Thank you very much for the webinar about the strategy development yesterday. It was really interesting and Josh did very well !

    I know it's not possible to apply a strategy to an existing position, to exit only this position if I've not entered in the position with a strategy...

    But I read this in Ninja help :

    "If you want your Account Position to match your Strategy Position,
    you will need to place a manual order into the account the strategy is
    running on. Continuing from the above example, you would need to place
    a 1-lot market order for the market being traded into the account the
    strategy is running on."

    What I'm trying to do is kind of the oposite, isn't it ? I need an
    entry order in my strategy ?

    If I add a buy stop possibility with a lower price thant the current
    price in my strategy.

    Then I'm entering in a long position with DOM for instance, and start
    my strategy. Will my Account Position match my Strategy Position ? In
    this case the exit condition I defined will work ?
    Thank you for your help
    J.

    #2
    Hi jed77,

    Thanks!

    No that will not work. Placing manual orders is only for syncing account positions with strategy positions. When you are using your strategy and you started it with a virtual long 1 so the next thing the strategy would do is sell 1, you will want your account position to also have a long 1 or else when the strategy sells 1 you will actually have a short 1 instead of being flat.

    The strategy does not recognize manually placed trades so unless you have a simulated position you cannot exit a position.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Ok, I understand...

      So, I'll need to enter the market with the strategy, instead of the chart trader, is it ?
      My orders will be seen on the chart ?

      Thank you for your help !
      J.

      Comment


        #4
        That is correct. For a strategy, all entries need to be managed by the strategy.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Ok, thank you for your answer.

          Could you explain how to submit a buy stop with the strategy ?

          Thank you very much for your help !
          J.

          Comment


            #6
            Hi,

            To submit a buy stop order you can either use NinjaScript and use EnterLongStop() or you can use the Strategy Wizard. From the Wizard you want to go into the "Conditions and Actions" page and press the "Add" button on the action's side. Expand "Order Management" and you can select Enter long stop from there.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thank you Josh ! This really help me !


              J.
              Last edited by jed77; 10-15-2008, 08:54 AM.

              Comment


                #8
                Hello Josh,

                Is it possible to have some parts of the strategy executed bar close true and some bar close false with the strategy wizard ?
                Or this should be adjusted in the code directly ?

                Thank you for your help !

                J.

                Comment


                  #9
                  Hi jed77,

                  This is possible, but as you suspected, it requires coding to achieve it.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Ok, we will see that later....

                    I have another question :
                    My strategy is working well now, I'm entering with a buy/sell stop order and exiting according to the conditions defined in the strategy. Perfect.
                    But, after the close, my strategy is resting and place a new buy/sell stop order again. I don't want that. I want my strategy not to start again after 1 execution. How to do that ?
                    Can you explain please ?
                    Thank you very much.
                    J.

                    Comment


                      #11
                      Hi jed,

                      Create a bool and use it in the trade condition. As an action when you submit your entry set that bool to false. Now that bool will not evaluate to true in the future thus your trade condition is not true and no more trades will be made by the strategy ever.

                      When you decide you want to trade again you will want to reset that bool to true and then your strategy can trade again.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Josh,

                        I understand the concept, but I'm not sure I can implement it properly...
                        Can we go through a step by step ?

                        In the "User Defined Inputs" I created a bool with default "true"
                        Then, in the "set 1" wher I have my Stop buy/sell order, in the condition builder, on the left, I choose my user defined input and == true under misc.

                        Next, when I'm starting my strategy, I have as a parameter what I called "TradeCondition", by default "true". I have to switch it to false and apply the strategy to the instrument ? Is it the way ?

                        Thank you very much. Have a nice day.
                        Jed

                        Comment


                          #13
                          jed77,

                          Unfortunately the Strategy Wizard would not be the most optimal place for creating these flag variables via bools. However please try this:

                          Do not use user defined variables. In your Conditions Builder add a condition that says Variable0 == 0. Then in the Actions add an action that sets Variable0 to 1.

                          So when Variable0 is 0 you will trade, couple that condition along with all your other entry conditions. When those are all evaluated to true place your entry order and then set Variable0 to 1. That will prevent future entries.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Hello Josh,

                            The entry order is placed by the strategy, right ? So after the strategy is running, how do I set Variable0 to 1 ?

                            Thx
                            Jed

                            Comment


                              #15
                              The order is placed by the strategy, correct. You need to add the action to change Variable0 to 1. Select the action that say something like "Set user variable". Then you can select Variable0 and change the value to 1.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ageeholdings, 05-01-2024, 05:22 AM
                              6 responses
                              42 views
                              0 likes
                              Last Post ageeholdings  
                              Started by tony_28217, Today, 07:04 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post tony_28217  
                              Started by flybuzz, Today, 10:33 AM
                              1 response
                              9 views
                              0 likes
                              Last Post flybuzz
                              by flybuzz
                               
                              Started by spencerp92, 10-10-2023, 09:56 AM
                              4 responses
                              308 views
                              0 likes
                              Last Post flybuzz
                              by flybuzz
                               
                              Started by samish18, Yesterday, 10:13 AM
                              1 response
                              26 views
                              0 likes
                              Last Post NinjaTrader_Eduardo  
                              Working...
                              X