Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

@SampleAtmStrategy questions

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

    @SampleAtmStrategy questions

    There are two things I can't understand on the @SampleAtmStrategy

    Referring to this section of its code:
    Code:
    // You can change the stop price
    if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
    { //Brackets are missing on original SampleAtmStrategy
    AtmStrategyChangeStopTarget(DefaultQuantity, 0, "STOP1", atmStrategyId); //error occurs when a limit order is placed. This is market order form.
    it uses the instruction:
    Syntax:
    AtmStrategyChangeStopTarget(double limitPrice, double stopPrice, string orderName, string atmStrategyId)

    The first parameter is limitPrice and yet I am placing a DefaultQuantity.
    Can you explain?

    Also, what does it mean " //error occurs when a limit order is placed. This is market order form." ?

    Best
    Gio


    #2
    Hello Gio,

    AtmStrategyChangeStopTarget() does not allow the quantity to be modified. You are only able to change the price.

    You will need to remove the DefaultQuantity.

    For a stop order (stop loss) the limit price will be ignored. For a limit order (profit target) the stop price will be ignored.


    "Also, what does it mean " //error occurs when a limit order is placed. This is market order form." ?"

    The example assumes the entry order is a market order which fills immediately.
    If the entry is a limit order, the entry may not fill before this AtmStrategyChangeStopTarget() method is called. If the method is called before the entry fills, there is no stop or limit order to modify and this causes an error.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      71 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      143 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      76 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      47 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      51 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X