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 ATM with strategy

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

    Example of using ATM with strategy

    Good morning & greetings from the wet & windy Netherlands !

    Could someone please post an example of adding control of a strategy after entry to the selected ATM (using the standard NT8 "Sample MA Crossover", please) ?

    Second question : what is the "time of day" code for "Only enter between 0800 and 1200 chart time" & where is it inserted (at the beginning, presumably) ?

    Thank-you.

    #2
    Hello jtrade,

    Thank you for your post.

    Could someone please post an example of adding control of a strategy after entry to the selected ATM (using the standard NT8 "Sample MA Crossover", please) ?
    Would this not be the "SampleAtmStrategy" in NinjaTrader 8? If not can you expand on what you mean by adding control of the strategy after entry to the selected ATM strategy?

    For your second question, this would be the following code and you would place your conditions for entry in it's brackets:
    Code:
    if (ToTime(Time[0]) >= 080000 && ToTime(Time[0]) <= 120000)
    {
    // your conditions here
    }
    Please let me know if you have any questions.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello jtrade,

      Thank you for your post.


      Would this not be the "SampleAtmStrategy" in NinjaTrader 8? If not can you expand on what you mean by adding control of the strategy after entry to the selected ATM strategy?

      For your second question, this would be the following code and you would place your conditions for entry in it's brackets:
      Code:
      if (ToTime(Time[0]) >= 080000 && ToTime(Time[0]) <= 120000)
      {
      // your conditions here
      }
      Please let me know if you have any questions.
      Thank-you, Patrick.

      1. Do I just add the "SampleAtmStrategy" to the chart alongside the "Sample MA Crossover" & then add the name of my ATM to one of the inputs within that sample ATM strat OR I am supposed to cut and paste the code into the MA strat ? It seems the latter.

      2. If I want to add two time periods do I just repeat the code with an AND in between ?

      3. Presumably a back test of the correctly inserted code would show the results obtained thereby ?

      Sorry, I know these are very basic questions - it's a long time since I was cut & pasting strategy code in TradeStation... (& in fact I had an ATM-type strat coded that I could add alongside any entry strat and it would control that strat after entry : it was later sold by progster, the coder, here http://www.codefortraders.com/TradeS...ut%20Exits.htm !).

      Comment


        #4
        Hello jtrade,

        Thank you for your response.

        I would not recommend copying and pasting code. The SampleAtmStrategy is a bit more complex than most strategies due to it setting and calling various strings to ensure it is properly moving through the proper motions. I would recommend studying the SampleAtmStrategy code first and then the SampleMaCrossover.

        The ATM Strategy template is a string in the SampleAtmStrategy code that is called in the AtmStrategyCreate() function. More information can be found at the following link: https://ninjatrader.com/support/help...tegycreate.htm

        For multiple time frames I would recommend reviewing our documentation on it's implementation at the following link: https://ninjatrader.com/support/help...nstruments.htm

        Backtesting is a good way to test out the strategies to ensure they are performing as intended. Please keep in mind that the ATM Strategy functions do not work on historical data.

        Please let me know if you have any questions.

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Please keep in mind that the ATM Strategy functions do not work on historical data.
          .

          How do I back test for optimal ATM stop and target values, please ?

          Is the only way to code stops and targets directly into the entry strategy as inputs for optimisation, ie. mimic the ATM within the strategy itself, rather than calling the pre-existing ATM from the strategy ?

          I'd like to be able to do what was possible with the Tradestation strategy code I linked to in my second post above. I am willing to pay a Ninjascript expert to do this if necessary, as long as it's essentially simple to someone who "speaks the language".

          Comment


            #6
            Hello jtrade,

            Thank you for your response.

            To clarify here ATM Strategy functions do not operate on historical data therefore they cannot be backtested through the Strategy Analyzer.

            If you wanted to backtest them you could run them through the Playback connection for Replay data but this would not offer and optimization options like the Strategy Analyzer.

            The ATM Strategy functions require that you built the ATM Strategy outside of NinjaScript. Such as in the SuperDOM of Chart Trader, you then call the template by name in the ATM Strategy function CreateAtmStrategy() in order to have it manage the position after the entry fills.

            If you wanted a NinjaScript strategy that allowed you to setup Stop Losses and Profit Targets that could be backtesting and thus optimized you would drop the use of the ATM Strategy functions and implement the Managed Order Approach in your NinjaScript Strategy. You can find details on the Managed Order Approach at the following link: https://ninjatrader.com/support/help...d_approach.htm

            I will have our affiliate NinjaTrader Ecosystem follow up where on NinjaScript Consultants.

            Please let me know if you have any questions.

            Comment


              #7
              Hello jtrade,


              You can search our extensive library of vendors who provide programming services through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!


              You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third party services for NinjaTrader all pricing and support information will need to be obtained through the consultant.

              This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

              Please let me know if you have any questions, concerns or if I can provide any further assistance by responding to this thread at your convenience.
              Ryan L.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_PatrickH View Post

                If you wanted a NinjaScript strategy that allowed you to setup Stop Losses and Profit Targets that could be backtesting and thus optimized you would drop the use of the ATM Strategy functions and implement the Managed Order Approach in your NinjaScript Strategy. You can find details on the Managed Order Approach at the following link: https://ninjatrader.com/support/help...d_approach.htm
                .
                This seems to be what I'm looking for.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,609 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                6 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                16 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X