• 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

SetProfitTarget fails to change price

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

    SetProfitTarget fails to change price

    RC2 Version - when I try to change an existing Profit Target when the order has filled after initially setting the target and stop - the system is not changing it neither in SIM BackTest nor MarketReplay.

    I also tried calling the ChangeOrder routine - it also does not change the price.

    #2
    I have no idea what you have coded - but based on your description, I took a guess.

    It did not work in RC2. I have also tested NTB11, and NTB9. My code did not change profittargets. I don't think I would have ever expected this code to work. I'm not about to test NT7 at the moment. Have you tested your code on NT7?

    I have other code that does and adjusts the target from NT8B9. I ran this code in NT8B14 (RC2), and it does adjust the profit target as programmed.

    Comment


      #3
      I am only using NT8 so I did not try coding it for NT7. My script is very complex, but I guess I could write a reduced example.

      According to the docs, unless I am misunderstanding it - after I set the profit target in a managed order scenario - if I want to change the price target - I call SetProfitTarget (which I do during onBarUpdate for the specific multiple timeframe BarInProgress I originally set it). I am using signal names, with multiple orders running at the same time as well. The SetStop routine does work which threw me.

      My specific scenario:
      • Multiple Timeframes (7 to be exact)
      • 2 different open orders using signal names (same direction)
      • SetProfit and SetStop previously set for both after filling
      • I reduce the pricetarget for one order by .25 on the ES
      Last edited by MarketAlly; 10-22-2016, 10:29 PM.

      Comment


        #4
        My sample was under 40 lines in OnBarUpdate, and 1/3 of it was white space and braces.

        Enter at 10am, and attempt to change after 10:05am...

        Which Calculation Mode are you using when trying to change?

        So no NT7 attempt... got it...

        Did this code work in previous beta's? or are you starting in RC2?

        Comment


          #5
          I have been using this code since beta 2 but I only previously moved stops. My targets had always been fixed.

          Comment


            #6
            Works for me:

            http://screencast.com/t/cNYGYBKCSysc

            Comment


              #7
              SetProfitTarget/SetStopLoss didn't work in NTB13/RC1... There might be fallout remaining from this.

              http://ninjatrader.com/support/forum...etprofittarget

              But without sample code that proves your case.... I'm not seeing it as evidenced by my video.
              Maybe someone else will see the issue.

              Comment


                #8
                I will try to work up sample code but your example is not outlining my scenario.

                Comment


                  #9
                  Hello MarketAlly,

                  Thank you for your response.

                  I would like to review the sample once you have it ready or the code you are currently using if you want to send it over to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' and a link to this thread.

                  I would also like to ask if you have confirmed that switching back to RC1 resolves this behavior.
                  Patrick H.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by EnveousColnago, Yesterday, 05:43 PM
                  7 responses
                  37 views
                  0 likes
                  Last Post Lancer
                  by Lancer
                   
                  Started by PeterGolz, 01-17-2020, 10:42 AM
                  11 responses
                  73 views
                  0 likes
                  Last Post reubenlasky  
                  Started by utilizator, Today, 11:36 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post utilizator  
                  Started by EnveousColnago, Today, 07:24 AM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_ShawnB  
                  Started by tornadoatc, Today, 10:31 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post tornadoatc  
                  Working...
                  X