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

Automatically reversing position, strategy wizard

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

    Automatically reversing position, strategy wizard

    hi i'm using strategy wizard to make a strategy.

    the strategy goes long and short

    the long and short logic are inverse of one another

    therefore, if i am in a long position and my short logic becomes valid, i would like to exit my long position and enter my short position (automatically reverse)

    what i am doing in strategy wizard is:

    set1= long rules

    when the following condition are true:
    xyz

    do the following:
    go long, exit short position

    set2= short rules
    when the following condition are true:
    zyx

    do the following:
    go short
    exit long position

    but the above does not seem to be working correctly. it seems to never exit my positions once it goes long/short

    thank you in advance for your help.

    btw this is a simple cross above cross below strat..
    Last edited by staycool3_a; 05-02-2013, 05:52 PM.

    #2
    calhawk01, thanks for the post and welcome here. If you just want to reverse then there's no separate Exit order call needed, you would just use the Enter() methods on your conditions hitting - those would automatically reverse for you if needed. Would that change the outcome you're seeing?

    All the best,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      calhawk01, thanks for the post and welcome here. If you just want to reverse then there's no separate Exit order call needed, you would just use the Enter() methods on your conditions hitting - those would automatically reverse for you if needed. Would that change the outcome you're seeing?

      All the best,
      I'm not familiar with what "Enter()" means. I am at work now and will test it when I get home. Are you referring to "enter long position" or "enter short position" in the strat wizard? Then, I may already be using it

      One more question: on your website it claims that NT allows you to paper trade your strategy before going live. Is that under SIMULATION mode??

      The simulation mode seems very limited to the amount of data that you can test.

      Can you tell me an alternative way to test, lets say, all the 500 stocks in sp500, real-time?

      Also, what is up with the SIM101 account?? Is that a built in NT account for simulation? What if I wanted to connect with TD ameritrade's paper trading account (think or swim). Can you please tell me the steps on how to do that?

      Comment


        #4
        calhawk01, from what you describe you're issueing two calls to an order method to execute - one would be to exit any open positon and then other to take the new signal. For a reversal strategy that would not be recommended, since it can create duplicate orders as all our Enter methods would reverse automatically for you. So if you're in a short position and call EnterLong() > it would close the short for you and take you long, a separate exit order call for the short would not be needed in this case.

        The Sim101 account is the internal account you would use for any trade simulation directly in NinjaTrader, it would be the only account you can use for submitting trades if you're not using a live license key from us. If you have a lice license your TDA account could be access as well -



        The available data you receive would not be dicated by NT, but by the connection option you're using - which one are you testing now with?

        Correct, by papertrading your strategy we mean simulated trading in realtime using the Sim101 account in NT.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          calhawk01, from what you describe you're issueing two calls to an order method to execute - one would be to exit any open positon and then other to take the new signal. For a reversal strategy that would not be recommended, since it can create duplicate orders as all our Enter methods would reverse automatically for you. So if you're in a short position and call EnterLong() > it would close the short for you and take you long, a separate exit order call for the short would not be needed in this case.

          The Sim101 account is the internal account you would use for any trade simulation directly in NinjaTrader, it would be the only account you can use for submitting trades if you're not using a live license key from us. If you have a lice license your TDA account could be access as well -



          The available data you receive would not be dicated by NT, but by the connection option you're using - which one are you testing now with?

          Correct, by papertrading your strategy we mean simulated trading in realtime using the Sim101 account in NT.
          Right now I am connected to IQFEED.

          When you say "simulated REAL TIME" you mean, simulated "computer generated prices?

          To me simulated real time paper trading would mean, that I can connect to IQFEED, get REAL TIME market data from IQFEED and feed it to NT. Then based on that data I can test me strategy. Is that possible in the free version?

          Also as far as crossover "efficiency" is concerned is it wise to use strategy wizard to create two different rules for cross above and cross below. ie, SET1= cross above, SET2= cross below.

          OR should I use these below codes:

          2)
          {
          If (crossabove(sma(fast),sma(slow),1))
          {
          enterlong();
          }
          else if (crossbelow(sma(fast),sma(slow),1))
          {
          entershort();
          }
          }
          3)
          if (CrossAbove(CCI(14), 250, 1))
          EnterShort();

          if (CrossAbove(EMA(10), EMA(20), 1))
          EnterLong();
          side question- does the above mentioned codes, automatically reverse positions once the opposing signal is generated?

          which one out of the three different methods:
          1. creating cross over using wizard [two different sets, one long and one short]
          2. the code using "else"
          3. or the two separate condition codes)
          from your experience is more efficient in the sense of faster execution?


          I feel the strategy wizard would give set1 more priority over set2 (not sure why I feel that way, but thats how I feel )

          thank you
          Last edited by staycool3_a; 05-03-2013, 08:27 AM.

          Comment


            #6
            'When you say "simulated REAL TIME" you mean, simulated "computer generated prices?'

            [BW] Is possible as well via connecting to the Simulated Datafeed -http://www.ninjatrader.com/support/helpGuides/nt7/simulated_data_feed_connection.htm?zoom_highlights ub=simulated

            'To me simulated real time paper trading would mean, that I can connect to IQFEED, get REAL TIME market data from IQFEED and feed it to NT. Then based on that data I can test me strategy. Is that possible in the free version?'

            [BW] Yes, that's possible if you're connected to IQFeed any execution you do is going to the Sim101 internal account in NT with the simulated license.

            I would not be worried about the efficiency question, I doubt there's a noticeable difference.

            And yes - it would auto reverse for you.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              [BW] Yes, that's possible if you're connected to IQFeed any execution you do is going to the Sim101 internal account in NT with the simulated license.
              Will try that. I'm guessing this process is as easy as? is there a write up on this?

              i'm guessing it's:
              1. connect to iqfeed
              2. my simulation account will automatically start feeding iqfeed data
              3. enable my strategy on the dashboard
              4. this will start buy/selling based on the strategy

              b/c I believe when I tried this yesterday, the above steps were nullified (it didn't work like that).

              1.when I connected to iqfeed, then only thing i was able to do was download data
              2. my simulation account did not become ''active'' the only time it became active was when i connected to simulation mode

              thank you once again, you are excellent.

              Comment


                #8
                Thanks - all the steps needed would be shown here - http://www.ninjatrader.com/support/h...t_strategy.htm

                I would suggest running from a chart first, since this will give you a visual representation of signals executing.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  question-

                  if i have a crossabove/below strategy to go long/short, will it automatically get me out of the position if the opposite condition is true EVEN IF my stoploss and/or profit target are not hit?

                  ex:

                  go long:sma2 crosses above sma3

                  go short:sma2 crosses below sma3

                  stoploss and profit targets are in initialize:
                  stoploss = 1000000000000000000000 ticks //point i'm making here is that stoploss will NOT be hit prior to the opposing long/short signal to be returning true
                  profit = 1000000000000000000000 ticks //point i'm making here is that stoploss will NOT be hit prior to the opposing long/short signal to be returning true

                  in other words.. if you're still in a trade and stoploss and profit targets have not been hit yet, will the system automatically end my position if the opposite crossover/condition becomes true?

                  thx

                  Comment


                    #10
                    Hi Calhawk01,

                    If I'm following you correctly,

                    If you enter long from the CrossAbove and then want to enter short from the CrossBelow, then what happens is the strategy will close out the current position and enter a new one.

                    I.E. If you are in a long position and the condition for the CrossBelow is met then the strategy will close out the long position and enter in a short.

                    Please let me know if I can be of further assistance
                    Cal H.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Cal View Post
                      Hi Calhawk01,

                      If I'm following you correctly,

                      If you enter long from the CrossAbove and then want to enter short from the CrossBelow, then what happens is the strategy will close out the current position and enter a new one.

                      I.E. If you are in a long position and the condition for the CrossBelow is met then the strategy will close out the long position and enter in a short.

                      Please let me know if I can be of further assistance
                      even if your stop/profit orders are live? they will be cancelled?

                      b/c that is not occurring in the formula that i am testing, it seems to ignore the opposite buy/sell order

                      Comment


                        #12
                        Originally posted by NinjaTrader_Cal View Post
                        Hi Calhawk01,

                        If I'm following you correctly,

                        If you enter long from the CrossAbove and then want to enter short from the CrossBelow, then what happens is the strategy will close out the current position and enter a new one.

                        I.E. If you are in a long position and the condition for the CrossBelow is met then the strategy will close out the long position and enter in a short.

                        Please let me know if I can be of further assistance
                        For managed orders, that is only true if you do not have an existing protective order. If you do have one, the internal order handling rules for Managed trades will cause NT to ignore the reversal order. The very fine manual explains this very well, but only if we read it.

                        Of course, using unmanaged orders is a different kettle of fish.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by llanqui, Today, 03:53 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post llanqui
                        by llanqui
                         
                        Started by burtoninlondon, Today, 12:38 AM
                        0 responses
                        10 views
                        0 likes
                        Last Post burtoninlondon  
                        Started by AaronKoRn, Yesterday, 09:49 PM
                        0 responses
                        14 views
                        0 likes
                        Last Post AaronKoRn  
                        Started by carnitron, Yesterday, 08:42 PM
                        0 responses
                        11 views
                        0 likes
                        Last Post carnitron  
                        Started by strategist007, Yesterday, 07:51 PM
                        0 responses
                        14 views
                        0 likes
                        Last Post strategist007  
                        Working...
                        X