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

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.


    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.

    Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've
    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().


        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().


          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 Barry Milan, Today, 10:35 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by WeyldFalcon, 12-10-2020, 06:48 PM
              14 responses
              1,428 views
              0 likes
              Last Post Handclap0241  
              Started by DJ888, Yesterday, 06:09 PM
              2 responses
              9 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              40 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Today, 08:51 AM
              2 responses
              16 views
              0 likes
              Last Post bill2023  
              Working...
              X