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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      47 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X