Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:	127
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.
    Emily C.NinjaTrader Customer Service

    Comment


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

      Bob

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Karado58, 11-26-2012, 02:57 PM
      8 responses
      14,828 views
      0 likes
      Last Post Option Whisperer  
      Started by Option Whisperer, Today, 09:05 AM
      0 responses
      1 view
      0 likes
      Last Post Option Whisperer  
      Started by cre8able, Yesterday, 01:16 PM
      3 responses
      11 views
      0 likes
      Last Post cre8able  
      Started by Harry, 05-02-2018, 01:54 PM
      10 responses
      3,204 views
      0 likes
      Last Post tharton3  
      Started by ChartTourist, Today, 08:22 AM
      0 responses
      6 views
      0 likes
      Last Post ChartTourist  
      Working...
      X