• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

managed, unmanaged, ATM

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

    managed, unmanaged, ATM

    Hello,

    I´m using in my NT7-script strategies in onExecution

    if(Position.MarketPosition == MarketPosition.Short)inshorttrade=true;
    if(Position.MarketPosition == MarketPosition.Long)inlongtrade=true;
    (Position.MarketPosition == MarketPosition.Flat){inshorttrade=true; inlongtrade=true;}

    to use then the bool in my conditions and I plot this bool with drawtextfixed in the chart to verify.

    Now I have a script from a programmer and I added this snippets but this doesnt work. It always shows "...false" in my chart, even when I´m short or long. Does the "onexecution" statements maybe not work if the script is calling an ATM? If so, what can I use instead to have a simple bool for flat or not to use in my conditions.

    Thank you!
    Tony

    #2
    Hello Tony,

    Thank you for mentioning the script is using Atm Strategy methods.

    No, when placing an order with Atm Strategy methods, the strategy position will not be updated nor with the strategy performance.
    http://ninjatrader.com/support/forum...985#post501985

    Think of these as orders as being manually placed with an Atm Strategy attached so these can be manually managed.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      thank you for your reply and the link. But another question please: when calling an ATM from a NT-script-strategy is it possible to work with the orders from the ATM like one can do with IOrders, meaning for example to move a stop for 2nd contract when target 1 is filled (and not move it with a fixed number of ticks from ATM settings)

      Can you please give me an example how to do this?

      Thank you
      Tony
      Last edited by tonynt; 06-29-2017, 07:15 AM. Reason: translation error, clearifying

      Comment


        #4
        Hello Tony,

        It would not be possible to save an order to an IOrder using Atm Strategy methods as these do not return an IOrder object.

        You would need to use unsupported methods of looping though the account to get all orders in the account and deciding what to do with them.
        http://ninjatrader.com/support/forum...2&postcount=33
        http://ninjatrader.com/support/forum...967#post470967
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea,

          thank you again for your reply. Sorry, if causing misunderstanding because inaccurate translation. I dont need to use it "exactly" like IOrders, I just want to move stop2 to BE with fill of target1. This is not possible when calling an ATM from the script?

          But to avoid this workaround with calling an ATM and instead using setstoploss and setprofittarget in the NT-script please let me ask if setstoploss and setprofittarget from NT-script-strategy do work exactly same (OCO and whatever else is important) on NT-Brokerage-Servers and Exchange as if the orders would have come from an ATM. Or do I have to add something in the NT7-script so that setstoploss and setprofittarget work exactly same as from an ATM?

          Thank you
          Tony

          Comment


            #6
            Hello Tony,

            Below is a link to the help guide on Atm Strategy methods.
            http://ninjatrader.com/support/helpG...gy_methods.htm

            If you want to change the position of a stop or target use AtmStrategyChangeStopTarget() and supply the atm strategy id and name of the order as it appears on the Orders tab of the Control Center ("Stop1", "Stop2", "Stop3", "Target1", "Target2", "Target3").
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello Chelsea,

              thank you for your reply. There was a sample about calling ATM from script do you have the link or name?

              My last question - again from the post before - please, when discussing this topic to know about this:

              "But to avoid this workaround with calling an ATM and instead using setstoploss and setprofittarget in the NT-script please let me ask if setstoploss and setprofittarget from NT-script-strategy do work exactly same (OCO and whatever else is important) on NT-Brokerage-Servers and Exchange as if the orders would have come from an ATM. Or do I have to add something in the NT7-script so that setstoploss and setprofittarget work exactly same as from an ATM?"

              Thank you
              Tony

              Comment


                #8
                Hello Tony,

                Included with NinjaTrader is the SampleAtmStrategy.

                Tools -> Edit NinjaScript -> Strategy -> SampleAtmStrategy.

                This demonstrates using AtmStrategyChangeStopTarget().


                SetStopLoss() and SetProfitTarget() use OCO and work very similar to the initial placement of a stop loss and profit target in an Atm Strategy.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hello,

                  I have another question now in this concern please. When calling an ATM from NT7-script does the chase if touched from ATM work?

                  Thank you
                  Tony

                  Comment


                    #10
                    Hello Tony,

                    Yes, the Chase if touched and Profit chase will work when calling AtmStrategyCreate with a template that has this enabled.
                    (The Chase Limit must be set to something other than 0)
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by SDaCosta30, Today, 04:19 AM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Started by memonolog, Today, 02:39 AM
                    3 responses
                    20 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by memonolog, Today, 07:07 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post memonolog  
                    Started by juanram, Today, 06:01 AM
                    1 response
                    9 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Started by dastaan, Today, 06:29 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post dastaan
                    by dastaan
                     
                    Working...
                    X