Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Looking for an example on managing multiple buy/sell signals while market is no flat

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

    Looking for an example on managing multiple buy/sell signals while market is no flat

    I am looking for an example of running a strategy that triggers a buy or sell order independent of whether Market position is flat or not? For example:
    Lets say I am long, and another long order was triggered, I want the ability to trigger the order and still be able to keep track of each target and stop loss order, so that I can call them from OnOrderUpdate method. Also I want to know if a short order is triggered while I have multiple long positions, I want to be able to access the long positions to close them as well as cancelling their targets and stop loss orders.

    #2
    Hello Yandychang, thanks for your post.

    There is an example here on how to use Order objects in a strategy. This lets you submit your own stop and target orders when the order executes. This concept can be expanded to work with multiple entries with their own stop and target.



    Please let me know if you have any questions.


    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hello Yandychang, thanks for your post.

      There is an example here on how to use Order objects in a strategy. This lets you submit your own stop and target orders when the order executes. This concept can be expanded to work with multiple entries with their own stop and target.

      https://ninjatrader.com/support/help...and_onexec.htm

      Please let me know if you have any questions.

      Hi, I use AtmStrategyCreate() method in my NT8 strategy to enter a long/short position. Is it possible to achieve what Yandychang ​has asked above while using this method?


      Comment


        #4
        Originally posted by sliverhllc View Post

        Hi, I use AtmStrategyCreate() method in my NT8 strategy to enter a long/short position. Is it possible to achieve what Yandychang ​has asked above while using this method?

        Hello silverhllc,

        Thank you for your note and welcome to the NinjaTrader forum community!

        There is a difference between ATM strategies and NinjaScript strategies. I recommend reviewing the page here:


        It is important to note, as stated on that page, "Executions from ATM Strategies will not have an impact on the hosting NinjaScript strategy position and PnL - the NinjaScript strategy hands off the execution aspects to the ATM, thus no monitoring via the regular NinjaScript strategy methods will take place (also applies to strategy performance tracking)"

        That said, even if different ATM strategies are triggered by your script (even simultaneously) you should be able to monitor and manage them with the available ATM strategy methods such as GetAtmStrategyEntryOrderStatus(), AtmStrategyChangeStopTarget(), etc:


        For a full working example that uses ATM strategies, please refer to the SampleAtmStrategy that is included with NinjaTrader. You may view this from the Strategies folder in the NinjaScript Editor.

        ​​​​​​​Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Emily View Post

          Hello silverhllc,

          Thank you for your note and welcome to the NinjaTrader forum community!

          There is a difference between ATM strategies and NinjaScript strategies. I recommend reviewing the page here:


          It is important to note, as stated on that page, "Executions from ATM Strategies will not have an impact on the hosting NinjaScript strategy position and PnL - the NinjaScript strategy hands off the execution aspects to the ATM, thus no monitoring via the regular NinjaScript strategy methods will take place (also applies to strategy performance tracking)"

          That said, even if different ATM strategies are triggered by your script (even simultaneously) you should be able to monitor and manage them with the available ATM strategy methods such as GetAtmStrategyEntryOrderStatus(), AtmStrategyChangeStopTarget(), etc:


          For a full working example that uses ATM strategies, please refer to the SampleAtmStrategy that is included with NinjaTrader. You may view this from the Strategies folder in the NinjaScript Editor.

          ​​​​​​​Please let us know if we may be of further assistance.
          Hi Emily, Thanks for the response. Beyond using GetAtmStrategyEntryOrderStatus(), AtmStrategyChangeStopTarget(), my goal is to get the Unrealized and Realized profit/loss for the combined position, not just for one strategy. Is there a way to get the total profit/loss for the entire position, instead of fetching separately and adding these numbers for each strategy together?

          Comment


            #6
            Hello sliverhllc,

            Thank you for your reply.

            With the way that ATM strategies are managed separately from the standard NinjaScript strategy logic and the difference in commands, you would have to get separate profit/loss values and keep a running total by adding the numbers together. This is demonstrated in the reference sample "Getting PnL from an ATM strategy" found here:


            Please don't hesitate to reach out with any additional questions or concerns.
            Emily C.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            4 responses
            541 views
            0 likes
            Last Post PaulMohn  
            Started by GLFX005, Today, 03:23 AM
            0 responses
            3 views
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            11 views
            0 likes
            Last Post XXtrader  
            Started by Waxavi, Today, 02:10 AM
            0 responses
            7 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            14 views
            0 likes
            Last Post TradeForge  
            Working...
            X