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

Profit Target with ATM Strategy Methods

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

    Profit Target with ATM Strategy Methods

    Hello,

    please could you explain how I can create an order with an profit target with the given ATM Strategy Methods like in the screenshot.

    Thank you.
    Attached Files

    #2
    Hello teafortwo,

    Thank you for your post.

    To confirm, you are wanting to utilize your pictured ATM Strategy template in a NinjaScript Strategy, is that correct?

    Here's a link to our help guide that goes over the basics of using ATM Strategy methods in an automated strategy:



    Here's a second link listing the available methods for working with ATM Strategies within a NinjaScript strategy:



    There's an example strategy that is built into NinjaTrader which you can view from the NinjaScript Editor called Sample ATM Strategy that you can save a copy of and modify that should give you good direction to get started on using your own ATM templates in a NinjaScript strategy. Note you will need an existing ATM Strategy Template to test this script called "AtmStrategyTemplate" set up from Chart Trader or the SuperDOM prior to testing. Keep in mind that ATM Strategies operate in real-time only and will not execute on historical data thus they can't be backtested.

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


    Kate W.NinjaTrader Customer Service

    Comment


      #3
      No I just like to set a profit target with the function AtmStrategyCreate(). Could you give me an example?

      Comment


        #4
        Hello teafortwo,

        Thank you for your reply.

        ATMStrategyCreate does not simply set a profit target and it is not possible to set just a profit target and no stop loss with an ATM Strategy. Using ATMStrategyCreate creates an entry order and specifies the ATM Template to be used with that entry, which then manages stops and targets as specified in the selected ATM Strategy Template. As I mentioned previously, you can see the correct usage in the built in strategy Sample ATM Strategy.

        You can certainly program a strategy without using ATM Strategy methods and submit profit target and/or stop loss orders for an opened position. If you'd like more information on programming strategies without using ATM methods, please let me know.

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



        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Yes I would like to receive more information on programming strategies.

          I am looking for an dynamic way to set the profit target with script function.

          And, stop loss can be set:
          AtmStrategyChangeStopTarget(0, Close[0] + 50 * 0.25, "Stop1", atmStrategyId);

          How can I set the profit target?

          Comment


            #6
            Hello teafortwo,

            Thank you for your reply.

            No, the stop loss cannot be originally set using AtmStrategyChangeStopTarget(), this would only modify the stop after an ATM Strategy has been created using an ATM Template and ATMStrategyCreate().

            I've included a very basic example strategy that may be viewed in the strategy builder that uses Order submission methods rather than ATM Strategy Methods which is attached to this post.

            We do have resources to help you begin creating NinjaScript Strategies/Indicators. All links below are publicly available.

            The best way to begin learning NinjaScript is to use the Strategy Builder. With the Strategy Builder you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.

            I'm also providing a link to a pre-recorded set of videos 'Strategy Builder 301' and 'NinjaScript Editor 401' for you to view at your own convenience.

            Strategy Builder 301
            NinjaScript Editor 401

            If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our NT7 help guide first:

            Basic Programming Concepts

            For general C# education I have personally found Dot Net Perls to be a great reference site with easy to understand examples.

            Browse examples for many languages, with explanations and code side by side for easy understanding.


            There are a few Sample Automated Strategies which come pre-configured in NinjaTrader that you can use as a starting point. These are found under New -> NinjaScript Editor -> Strategy. You will see locked strategies where you can see the details of the code, but you will not be able to edit (you can though always create copies you can later edit via right click > Save as)

            We also have some Reference samples online as well as ‘Tips and Tricks’ for both indicators and strategies:

            Click here to see our NinjaScript Reference Samples
            Click here to see our NinjaScript Tips

            These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

            Further, the following link is to our help guide with an alphabetical reference list to all supported methods, properties, and objects that are used in NinjaScript.

            Alphabetical Reference

            And our Educational Resources in the NinjaTrader 8 help guide.

            Educational Resources

            A set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.

            Condition Builder

            You can also contact one of our professional NinjaScript Consultants or Educators who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like a list of professional NinjaScript Consultants or Educators who would be happy to create or modify any script at your request or assist you in learning NinjaScript.

            Please let me know if I may be of further assistance.


            Attached Files
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Hello Kate,

              thank you....

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,266 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X