Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sync-ing an always in strategy across weekends

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

    Sync-ing an always in strategy across weekends

    I’m wondering, given the current functionality of NT7, what would be the recommended approach for running a “always in” system? How does NT suggest a strategy is synced with stop entry orders?

    Starting premise:

    · Classic 20 day Donchian Channel breakout strategy
    · Using the stop and reverse rules (i.e. always in)
    · Fixed Fractional position sizing with 1% risk on each position

    Let’s assume we are running this strategy against a collection of Forex instruments:

    · AUDJPY
    · NZDJPY
    · EURGBP
    · GBPUSD
    · USDCHF

    This is always in strategy (i.e. the classic breakout strategy holds the positions and then reverses them when the opposite side of the channel is hit). Let’s assume we need to shut down NT every weekend for server / PC maintenance. Every weekend when we shut down NT there will be difference between the position size that the strategy has, and the position size that exists unless we are able to re-create the trades exactly or the account size exact (see the 1% fixed fractional requirement).

    What would be the recommended approach for coding this simple strategy to operate across those instruments? How would the correct position sizing be generated if the strategy isn’t aware of the actual position size held in the account? (have I missed something that the order quantities would never be of the same value)?

    You can replicate this on a short-term frame by doing the following – opening a position on an instrument, then launching a strategy that uses a stop & reverse order upon that instrument. There will not be a correct order placed to reverse the position.

    Thanks and regards,

    drolles

    #2
    drolles, you will have those 4 options available to sync up your account vs strategy position - http://www.ninjatrader.com/support/h..._positions.htm

    You can for example restart on Sunday evening / Monday morning with 'immediately submit' on and then submit reconciliatory orders if needed to ensure the account position for your instruments matches the strategy positions held.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      Thanks for the reply.

      I have possibly not understood the functionality correctly. If you have a position over the weekend then if you set the strategy to immediately submit then when the positions don’t match (as they are unlikely to do given the fixed fractional requirement) when the strategy position does not match the account position quantity will the full position not be closed out and then the new quantity will be opened? I.e. the position fully closed and opened again with the new quantity?

      You used the term “reconciliation”; that’s not quite right is it? If the orders were reconciliation then they would only “adjust” the position and not fully close it and reopen it. For example, if the strategy was long 30,000 AUDJPY and the account position was only 10,000 long AUDJPY then the full position would be closed will it not?

      Thanks and regards,

      drolles

      Comment


        #4
        drolles,

        No, the full position will not be closed. It will calculate what the difference is. For instance, if you have 10k in strategy position, but 30k in account position. The order placed would be to close out of 20k. It will do the bare minimum to sync up the account position to the strategy position.

        In your example if the strategy was 30k, but account was only 10k. The order placed would be to get an additional 20k.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          Thanks for the reply and calcification. I must have misinterpreted the functionality I’d seen to date.

          Then let’s complete the scenario. If you didn’t want those orders to be placed every weekend and you wanted the position left as it was, what would happen to any stop entry orders (see the original post)? They would be of the wrong quantity values, i.e. the quantities would be incorrect between the Strategy and Account position?

          Am I right in saying that you could never get those orders to represent the correct values in quantities? What’s NT’s recommended best practice?

          Thanks and regards,

          drolles

          Comment


            #6
            drolles,

            Your strategy does not care about anything on your account position. Think of it as being oblivious to the account position. The strategy will do whatever the strategy logic sets out to do based on the strategy position. If your account position is different then it is simply different.

            NT does not make any recommendations on best practices as it is really up to the user as to what exact behavior they would like. Some people have specific reasons to have the strategy position and account position to be out of sync. Others prefer it to be synced. It is really up to you what you want and then choosing the option settings that is tailored to that based on what is outlined here: http://www.ninjatrader.com/support/h..._positions.htm
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh,

              Thanks for the reply.

              Let me try again in a different way without the reference to best practice.

              Am I right in saying that the stop entry orders would never be the right quantity values in the scenario I’ve mentioned?

              Thanks and regards,

              drolles

              Comment


                #8
                drolles,

                The stop entry orders will always be of the right quantity according to the strategy position and strategy logic. Under your scenario, this quantity would not be the "right" quantity based on the preexisting account position. This is why there is a need to sync the account position to the strategy position. Once synced, the right quantity from a strategy position standpoint will also be the right quantity from an account position standpoint.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh,

                  Thanks very much for the reply.

                  I should have clarified, I am referring to the account position, not to the strategy position. Can you please answer my question with respect to the scenario I’ve detailed below, and the account position?

                  Thanks and regards,

                  drolles

                  Comment


                    #10
                    drolles,

                    I believe I already answered it in my prior posts. It will not be the correct quantity in relation to account position since your account position does not equal your strategy position.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Josh,

                      Thanks for the reply.

                      Just to reiterate the scenario then, the accounts and strategy position is not synced.

                      Just to be clear, there is no way to know the actual account position quantity (again, I’m not referring to the strategy position here) at this given with the current NinjaScript functionality is there?

                      Thanks and regards,

                      drolles

                      Comment


                        #12
                        drolles, this refers back to topics discussed prior - for NinjaTrader the strategy position is paramount, as the account position needs to be in sync with it for the strategy trades replicated to be what you expect. You could unfortunately not access the current account's position per NinjaScript, this is however already on our list of feedback collected.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          @NT: I never really understood and liked the sync idea.
                          In my view the strategy must sync to the account and not viceversa.
                          What you do with the sync option is different: You sync the account to the strategy.

                          But the real money stays in the account, and therefore I do always want my strategy to adapt to the current account situation. I do not want to adapt the account to my strategy.

                          @NT2:accessing account position per strategy (and be able to modify while in Historic) is a good idea.

                          @drolles: By extra programming you can achieve what you need. Basically when you restart your strategy after the weekend you have to examine the execution tokens to find out the actual strategy position. Do a search for zweistein as I have several posts on this subject (with Bertrand responding ) on this subject.

                          Best regards
                          andreas
                          www.zweisteintrading.eu

                          Comment


                            #14
                            Thanks for the input zweistein I can follow your argumentation - those points are already on our feedback list for future consideration.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Bertrand,

                              Thanks very much for your level headed response. There was a “tone” that I wasn’t really appreciating before you stepped in.

                              The only thing I am trying to do here is determine the current recommended method for implementing a strategy such as the one described with the functionality as it stands in NT7. I can’t be the only customer of NT’s that has this problem so I am doing this for the benefit of the community and myself. I am not doing this to be painful, I’m doing it to try to get a medium-term trend following strategy live.

                              I greatly appreciate you have taken on board the topics in our conversation previously and the time you spent on it. I offer again to review any requirements / specification documentation you would like me to. I’m happy to offer that for the benefit of the community and myself.

                              If it is ok I would like to continue the discussion, working through the problem together as we are still not to an answer? That is, we still don’t have an agreed implementation of a long-term trend following strategy without “reconciliation” orders being placed after each launch. Please see my comments to Andreas below. I will probably take up his recommendation. However, that will just be a workaround using non-standard functionality. I’m after a solution that uses the standard functionality of NT7 as it is now (I appreciate it will be fixed later).

                              Can we just reiterate were we are at? So far we have agreed that (I think) that the use of stop entry (reversal) orders would not work as these orders will be for values that are held in the Strategy Account and not in the Positions Account. And the two accounts not being reconciled would mean the orders are for the incorrect amounts.

                              One solution I can think of is to use Market Orders (e.g. EnterLong() to reverse the order. However, given you still need to specify the quantity on the order, whereby the quantity will be wrong (same problem as before). That is correct is it not?

                              One possible solution would be to use Market Orders to get the position flat (i.e. a simple ExitLong()) at a reversal point and then use market entry orders to get back into the reverse position. Let’s assume that you have the strategy with a sub-time frame of 1 min (same as before with signals on Daily bars). There could be a significant move in a 1 min in the Forex market in highly volatile times therefore to wait for the next call to OnBarUpdate() is probably not palatable.

                              What about forcing a call to OnBarUpdate() from OnOrderUpdate()? That is, once an Exit order has been executed, force a call to OnBarUpdate(), could that be done? Or are there other suggestions?

                              @ Andreas – Thanks so much for adding your views and suggestions. I will do as you suggest and follow-up on your posts. I really do appreciate it. I am PM you to suggest some collaboration if that is ok? Please see my reply above to Bertrand. I think it is best for everyone to determine, given the current functionality of NT7, what is NT’s proposed implementation. That’s all I’m trying to work through with NT to get to a conclusion.

                              Thanks and regards,

                              drolles

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by zstheorist, Today, 07:52 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post zstheorist  
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              149 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post tkaboris  
                              Working...
                              X