• 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

Strategy Indicators

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

    Strategy Indicators

    Hi,

    I have a strategy that plots a few indicators.

    All is well until I lose connection. I want the strategy to keep running and pick up where it was when the connection is restored. I have the following code to achieve this.


    RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;

    ConnectionLossHandling = ConnectionLossHandling.KeepRunning;

    DisconnectDelaySeconds = 600;

    NumberRestartAttempts = 40;

    RestartsWithinMinutes = 5;

    I find that the indicators are being created on the chart after each loss of connection. Is there a way to avoid this, or delete the old versions of the indicators upon restart. The indicators can't be deleted manually as they are 'locked' by the strategy.

    Thanks

    Ian


    #2
    Hello IanC28,

    Thanks for your post.

    There isn't a way to programmatically add/remove indicators from a chart and this should be all managed by NinjaTrader. I tested on my end and was not able to reproduce the issue.

    Could you reproduce the issue using the attached script and provide some steps that I can take to reproduce the issue if I deliberately disconnect my PC's internet connection?

    If you are seeing the issue on your script but not with this example, please modify the example script so it can be used to demonstrate the issue.

    I look forward to being of further assistance.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello IanC28,

      Could you confirm if you have seen my message regarding how we can reproduce the issue with an example, or if you have resolved the matter already?

      I look forward to assisting further.
      JimNinjaTrader Customer Service

      Comment


        #4
        Hi Jim,

        Yes I am testing your simplified strategy, and don't have issues.

        I am currently modifying the strategy to see if I can recreate the issue. Not sure if I will succeed as the simple strategy is too simple.

        My strategy creates many orders each with a stop and a target and it runs for several hours before creating an issue.

        I also run the strategy on several charts at the same time. . . . really not comparing apples with apples.

        I have not resolved the issue.

        Thanks

        Ian

        Comment


          #5
          Hello Ian,

          Thanks for the follow up.

          I would not suspect the handling of orders to be related to the issue you saw with indicators being added, and I also would not expect other charts to have an effect on an issue with indicators being added to a chart on connection losses. We should be able to narrow the case down to some repeatable steps with the strategy added to one chart, with all other logic not related to adding indicators removed, and then to deliberately cause disconnections.

          After the cae is reduced, please compare it with the test case I provided and see if there is anything that can be changed. If the issue cannot be resolved, please share with me your reduced test case so I can look into the behavior on my end.

          I look forward to being of further assistance.
          JimNinjaTrader Customer Service

          Comment


            #6
            Hi Jim,

            I have managed to create a repeatable error, but not the same as first reported.

            Please see the attached file. Load a blank chart and add and initialise the strategy.

            The error occurs if you drag an indicator off another chart onto this chart. I dragged a few different indicators including SMA and EMA.

            The error is that the MACD indicator on the chart (created by the strategy) freezes i.e. is says it is calculating . . . . continuously.

            The error can be cleared by changing the chart from say 1 min to 2 min.

            Resetting the chart initialises some routines that "correct" the error. I think the strategy needs to call the same routines. I think this is related to the issues I was experiencing.

            Thanks

            Ian



            Attached Files

            Comment


              #7
              Hello Ian,

              I have been able to reproduce and I have reported this issue for further investigation. I'll keep you informed as this develops.

              EDIT: The issue has been tracked with the ticket ID NTEIGHT-13633. This ID can be found in the Release Notes page of the Help Guide when a new release includes a fix for this issue. Since there are other internal tasks that the Development team has before releases are prepared, we cannot offer an ETA on the next release.

              Thanks for the report!
              Last edited by NinjaTrader_Jim; 03-22-2019, 07:46 AM.
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by denalek2419, Today, 01:46 PM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by REI140205, Today, 12:58 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by Aditrade, Today, 12:33 PM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_Kate  
              Started by music_p13, Today, 12:22 PM
              2 responses
              10 views
              0 likes
              Last Post music_p13  
              Started by The Big D, Today, 11:41 AM
              2 responses
              7 views
              0 likes
              Last Post The Big D  
              Working...
              X