Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Example of using AtmStrategyChangeEntryOrder()

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

    Example of using AtmStrategyChangeEntryOrder()

    Click image for larger version

Name:	ChaseExample.png
Views:	182
Size:	23.8 KB
ID:	1235379
    Hello,

    I'm trying to use AtmStrategyChangeEntryOrder() to chase the market while a condition is true and a pending order is placed. I can't get it to work. Do you have a sample that shows how to use this method?

    In the screenshot I want the sell stop order to change and be placed over the green diamonds until the order is filled.

    Thanks.
    Last edited by bobperez; 02-14-2023, 09:51 AM.

    #2
    Hello bobperez,

    Thank you for your note.

    I have created a sample strategy that is based on the SampleAtmStrategy that comes with NinjaTrader by default. I have added logic to the ChangeATMStrategySample that I created that will modify the entry order price by using AtmStrategyChangeEntryOrder()

    Code:
                    if (Close[0] > Close[1])
                    {
                        AtmStrategyChangeEntryOrder(Close[0] - 10 * TickSize, 0, orderId);
                        Print("ATM Entry Order Changed");
                    }
    ​
    Here is the link to download the sample: ChangeATMStrategySample_NT8.zip

    In this sample, the initial entry order with ATM strategy attached is placed at the Low[0] price minus 20 ticks. Next, once the entry order is pending it checks if the Close[0] > Close[1] and if so it will change the limit price to Close[0] minus 10 ticks. The entry will trail the price until the price comes down and fills the entry; I just wanted to use a condition that will show the entry order being modified multiple times before it is filled and triggers the ATM strategy with the template "AtmStrategyTemplate." You will need to save an ATM template with this name in order for the strategy to work properly.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Thank you, Emily. The sample is very helpful!!

      Bob

      Comment

      Latest Posts

      Collapse

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