• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy MoneyMgmt for Chart Trader Entries

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

    Strategy MoneyMgmt for Chart Trader Entries

    I would love to be able to submit position entries from Chart Trader and have a strategy perform the trade management. The ATM strategies are cool, but not nearly powerful enough for the myriad of market conditions upon which a Stop could be based. For example, consider a simple One 5M BarTrailing Stop...ATMs just don't go there.

    The problem would seem to be that Chart Trader and Strategies each run in their own sphere (or virtual machine) and that neither one has acess to the other. However, through the Strategy method 'PositionAccount.MarketPosition', this may be enough.

    Consider the following scenerio. Chart Trader places a buy order with no ATM management, no stop, target, auto trail...etc. A 'TradeMgmt' Strategy is running on the same instrument (separate chart) and picks up the trade entry when 'PositionAccount' shows that the account postion has changed from flat to long (which must have been initiated by the Chart Trader since 'TradeMgmt' Strategy never initiates trades on its own). Essentially, TradeMgmt stops are implemented by taking the reverse side of the Chart Trader entires. So at the end of the trading day (and assuming all buys), Chart Trader would show 5 longs active, and TradeMgmt Strategy would show 5 short positions active, with the net result that the TradeMgmt Strategy implemented the stops (according to whatever alogrithm was programmed) and the account is flat, as it should be.

    Would this solution work? Are there any major pitfalls you see? For example, a very active trader could run the totals up to +100 active buys and sells at the end of the day. And of course, is there a better way to do this??

    #2
    Hello doctore,

    You are correct. Any orders placed manually do not get picked up and do not affect the position of a NinjaScript Strategy. Also, strategies cannot pick up or see orders made by other strategy instances.

    Instead, I would recommend creating an Addon.
    You can find the account, loop through all of the orders, and manage these how you would like.
    http://ninjatrader.com/support/helpG...ount_class.htm

    Or you could instead place a button on the chart by the strategy code, and then when the button is clicked use the strategy to place order. If the strategy places the order, then that order would affect the position of the strategy.
    http://ninjatrader.com/support/forum...php?linkid=697
    http://ninjatrader.com/support/forum...327#post499327
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      If I understand you correctly, I can:

      1. Initiate a position from Chart Trader (with no stops or targets)

      2. Manage the stops (in 'TradeMgmt') using the Account.Orders and
      Account.CreateOrder() methods.

      3. And on the Stop being hit:
      a. the Chart Trader window will indicate that the position is Flat, and
      b. all graphics related to the trade were 'cleaned up' in Chart Trader (just as if
      Chart Trader had originally placed the stop
      )

      I have used NT7 for years and am new to NT8, hence the following question:

      "Where should TradeMgr" live? In a separate chart window for the same instrument? In
      an AddOn??

      Comment


        #4
        Hello doctore,

        This would depend on the approach you use.

        It is possible to loop through an account to find working orders on the account using the account class methods.

        Once an order is found, it is possible to modify that order with <account>.Change().
        http://ninjatrader.com/support/helpG...-us/change.htm

        The order in this case would be submitted by Chart Trader. Any modifications to the order would reflect in Chart Trader.

        The position would continue to reflect in Chart Trader.

        The Atm Strategy would initially be selected in, and triggered by Chart Trader.

        Any actions from the Atm Strategy would continue functioning.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          You say:

          "Once an order is found, it is possible to modify that order with <account>.Change().
          http://ninjatrader.com/support/helpG...-us/change.htm

          The order in this case would be submitted by Chart Trader. Any modifications to the order would reflect in Chart Trader."


          OK, and my question continues to be "Where does the software that modifies the order live?" As an AddOn? In a strategy running in a chart trader window? Somewhere else??? Again, I'm new to NT8.

          Comment


            #6
            Hello doctore,

            The addon class items can be used in any script.

            You could put this in an addon in a separate window, in an indicator applied to the chart, or in a strategy that ignores the internal strategy methods and instead uses the addon class methods.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Super! I loved NT7, and nice to see that NT8 is even more amazing. Many thanks for the help!

              Scott

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Oceans, Today, 02:22 AM
              2 responses
              17 views
              0 likes
              Last Post Oceans
              by Oceans
               
              Started by sisenberg, Yesterday, 08:06 PM
              1 response
              14 views
              0 likes
              Last Post sisenberg  
              Started by PLeary, Today, 06:25 AM
              0 responses
              4 views
              0 likes
              Last Post PLeary
              by PLeary
               
              Started by sergey_z, Today, 06:17 AM
              0 responses
              1 view
              0 likes
              Last Post sergey_z  
              Started by nikkk, Today, 06:14 AM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_PatrickG  
              Working...
              X