Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using strategy instead of ATM to manage a trade

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

    Using strategy instead of ATM to manage a trade

    I am completely new to NinjaScript, so this might be a silly question, so please bear with me.

    Is this possible to develop a strategy where you still manually place the orders, but when it is placed, the strategy will manage the position instead of using ATM? This will allow for more sophisticated trailing stops. For example, I still want to click a buy/sell button, which presumably will be a custom button and once open, the strategy will take over and place a calculated profit target and trail the position with an ATR stop or low/high of last x bars for example. Also, the close position button will not disable the strategy like the standard close button is doing.


    #2
    Maybe not exactly as described, but I'd imagine it's possible to do this. If you don't want to learn the code yourself you'll need to hire a 3rd party developer. Potentially, an easier way to accomplish this would be to code up the strategy as described then use the enable button to turn it on and off when you want it to place a trade. You could make one for buying and one for selling then just turn them on when you want it to place the trade. Have it setup to place the trade as soon as it's enabled and then manage the trade per your criteria.
    L33TB0Y
    NinjaTrader Ecosystem Vendor - L33TB0Y TRADING

    Comment


      #3
      Yes, it's possible. There is at least 2 possibilities:
      1. Strategy with ATM + some control to enter trades(wpf buttons, hotkeys etc). This allows you to manually changes stops/targets via chart trader. I use this method for 3 years, it's good if you don't need to do some complex stuff. For that there is the second option.
      2. Simple strategy + some control to enter trades(wpf buttons, hotkeys etc). But in this case you can't change stop/target via chart trader. It you do NT disables your strategy. However you can do this via some hotkey or program your condition, this also applies to strategy with atm, so both can do your sophisticated trailing stops. Also simple strategy can use more advanced methods like OnOrderUpdate and OnExecutionUpdate.
      Last edited by Leeroy_Jenkins; 04-04-2023, 12:39 AM.

      Comment


        #4
        Hello sevensa,

        Having a script manage manually submitted orders or positions would be better suited for the Addon approach (such as using an indicator) and attaching event handler methods to Account events, than a NinjaScript Strategy which is intended to be fully automated.


        NinjaScript Strategy native methods are not affected by manual orders or positions.

        An example that attaches handler methods to account events can be found here.
        This indicator serves to provide labels for Atm strategies that are present on your chart. Each new Atm strategy will rotate through the colors defined in your Brush Collection. Simply add to a chart, select the data series you want to have labels added to, choose your font and add all the brushes/colors you want […]


        Further, using the addon approach would not disable when clicking the Close button.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you all for your responses. I have a bit of reading up to do now. I have many years or Easy Language experience, can mess around in Python and used C++ many moons ago in University and I am trying to get up to speed now with NinjaScript and C#.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          41 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          64 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X