Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript - ATMstrategy

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

    #16
    Hello,

    Both will work. My ay makes sure that the PT or stop loss was filled. Your way does not.



    if (atmStrategyId.Length > 0)
    {
    // You can change the stop price
    if (GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat)
    {

    // My Position is flat either my stop loss or PT got hit so I need to now close out my strategy position.
    ExitShort(10000, "Ex_SH2", "Short2");

    }




    NOTE to make sure we are on same page here:

    - You cannot combine ATM Strategies and NS Strategy order calls. ExitShot will not close the ATMStrategy. It will only close the NS strategy which remember they are not the same.

    - What you are doing here is trying to combine NS strategy with a ATM Strategy. Both will run on the same account and will double your position up. Since the NS strategy is submitting orders and the ATM Strategy is submitting orders.

    -If you want to clsoe an ATM Strategy you need to use this instead.

    Comment


      #17
      Hello Brett,

      thank you for your support!

      Finally: As you wrote “Before you submit any order, check to see if ATMStrategyID is blank or not.“

      please tell me how I can check. I´ll do of course.I write an indicator to see – but how can one check?

      And is there a possibility to check and verify if there rest a position or limit or stop in the market? (because as you informed with "flatten everything" then there will be flattened positions of other instruments too). So when its possible to check then I can make an indicator or drawing-object that shows there is one, eg background in certain color as long as position or limit or stop.



      Thanks
      Tony

      Comment


        #18
        Hello,

        Thanks for your patience.

        I will respond shortly.

        Comment


          #19
          Hello,

          Thanks for your patience.

          You will check it with this code as shown in the sampleAtmStrategy.

          if (orderId.Length == 0 && atmStrategyId.Length == 0)


          Finally, there is no way to check the position of your account from an indicator or strategy, only strategy position can be checked.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by alifarahani, Today, 09:40 AM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by RookieTrader, Today, 09:37 AM
          4 responses
          17 views
          0 likes
          Last Post RookieTrader  
          Started by PaulMohn, Today, 12:36 PM
          0 responses
          3 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          39 views
          0 likes
          Last Post love2code2trade  
          Started by junkone, Today, 11:37 AM
          3 responses
          22 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X