Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop1 or Target1 remain after the ATM closes.

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

    Stop1 or Target1 remain after the ATM closes.

    I will try to explain problems that I encounter quite often.
    I created a Strategy that uses several ATMs at the same time. Each ATM has 1 Stop1 and 1 Target1. When creating an ATM, these targets are set to a known large distance (for example, 1000 ticks), but then they are moved to the values ​​specified in the Strategy settings.

    Problem #1:
    Sometimes the result of such a function:
    bool check = s.AtmStrategyChangeStopTarget (0, newSL, "Stop1", atmStrategyId);

    check is "True", but Stop1 does not move at all. It also does not respond to further calls to the s.AtmStrategyChangeStopTarget () function.

    Question for problem #1:
    What the reason of this problem?


    Problem #2:
    Periodically, after I clicked “Close” (peak1, label 1), the ATM order and its Target1 are closed / deleted, and Stop1 remains on the chart (pic1, label2). I cannot delete it manually, I cannot move it. Here's how it appears in the list of orders: pic2. There I also can’t delete it.
    I found a way to delete such orders - this is Account Reset. But it seems to me that this is not the right way.

    Question for problem #2:
    I’m wondering what is the reason for such orders and why I can’t delete them in the standard way.

    Click image for larger version  Name:	 Views:	0 Size:	88.4 KB ID:	1099831

    Click image for larger version  Name:	 Views:	0 Size:	7.2 KB ID:	1099833
    Last edited by webus; 05-15-2020, 02:25 AM.

    #2
    Hello webus,

    Thank you for the post.

    From the given details I couldn't really say what may be happening, this may be a situation where you would want to try and reset the database and try this again with a fresh database. If you have some set of steps which can recreate this we can likely look further into that with a sample of the logic used and steps used. I would suggest to try and isolate a situation where you see this happen so that we can look into that more.

    I look forward to being of further assistance.

    Comment


      #3
      Hi NinjaTrader_Jesse,

      Originally posted by NinjaTrader_Jesse View Post
      Hello webus,

      Thank you for the post.

      From the given details I couldn't really say what may be happening, this may be a situation where you would want to try and reset the database and try this again with a fresh database. If you have some set of steps which can recreate this we can likely look further into that with a sample of the logic used and steps used. I would suggest to try and isolate a situation where you see this happen so that we can look into that more.

      I look forward to being of further assistance.
      I can try to record a video. Will this suit you?

      Comment


        #4
        Originally posted by NinjaTrader_Jesse View Post
        Hello webus,

        Thank you for the post.

        From the given details I couldn't really say what may be happening, this may be a situation where you would want to try and reset the database and try this again with a fresh database. If you have some set of steps which can recreate this we can likely look further into that with a sample of the logic used and steps used. I would suggest to try and isolate a situation where you see this happen so that we can look into that more.

        I look forward to being of further assistance.
        Please, take a look. I caught a few cases.

        Case#1:
        Comment:
        The Strategy opened the ATM market position with Stop1 and Target1 by ATM template settings. The strategy tried to change Target1 and Stop1 based on the Strategy settings - Unsuccessfully. The strategy tried to close the ATM position -Unsuccessfully. Stop1 and Target1 remained on the chart. They cannot be changed or deleted. Only the account reset helps.
        Take a look please:



        Case#2
        Comment:
        The Strategy opened the ATM market position with Stop1 and Target1 by ATM template settings. The strategy tried to change Target1 and Stop1 based on the Strategy settings. Stop1 changed succesfully. Target1 - Unsuccessfully. The strategy tried to close the ATM position - Unsuccessfully. Target1 remained on the chart. It cannot be changed or deleted. Only the account reset helps.
        Take a look please:



        Case#2
        Comment:
        The Strategy opened the ATM market position with Stop1 and Target1 by ATM template settings. The strategy tried to change Target1 and Stop1 based on the Strategy settings. Target1 and Stop1 changed succesfully.
        At the specefied time (15:24), the Strategy tried to close the ATM using AtmStrategyClose (). The attempt failed (but in the log file is "true"). The position remained open, and Stop1 and Target1 were deleted. The terminal received an error that was not displayed in the log file. An unsuccessful attempt to close a position manually.
        Take a look please:



        Comment


          #5
          Hello webus,

          Thank you for the reply.

          I took a look at the videos however that is not necessarily helpful in this situation. If you have isolated a specific way to reproduce the problems then a simplified code sample and the steps to reproduce the problem would be more helpful. I can take a look to see if anything can be done with that otherwise I can forward that to development.

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

          Comment


            #6
            Hi NinjaTrader_Jesse,

            Originally posted by NinjaTrader_Jesse View Post
            Hello webus,

            Thank you for the reply.

            I took a look at the videos however that is not necessarily helpful in this situation. If you have isolated a specific way to reproduce the problems then a simplified code sample and the steps to reproduce the problem would be more helpful. I can take a look to see if anything can be done with that otherwise I can forward that to development.

            Please let me know if I may be of additional assistance.
            Ok, I’ll try to separate these cases into separate code samples, but as I said earlier and as seen from the video, this happens randomly. There are no special steps.

            Sometimes this works without errors for a long time, sometimes the Stop1 and Target1 levels stop changing and freeze (I have to reset my account to delete them).

            Sometimes the "Close" button does not close the ATM position, or closes the position, but Stop1 and Target1 remain on the chart and freeze (I have to reset my account to delete them).

            I tried to show all this on video.

            But as I wrote earlier, I will try to separate these cases into separate code samples and record new videos.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            44 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            65 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X