Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unstable script work

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

    Unstable script work

    Hello support --

    I developed a script which draw objects on a chart when I click on a line of separate windows form.

    I add the script to three different chart. The charts are linked. The problem is that some time the script draw objects only on one chart, objects on the other charts are not drawn at all, sometime objects are drawn by click particular line. Clicking on other lines of the form does not give a result.

    Actually I have another three linked charts and I add the script to the three of them too. The problem is the same.

    Sometime everything work good. Objects are drawn on all charts by clicking on each line of the form.

    What is the problem? I can send you the script if you need it to test and review the code.

    Regards.

    #2
    Hi Alex, do you see any errors / exceptions raised as this happens? We could sure give a quick testrun here and share our thoughts then. The way you initiate the drawing would not be direclty supported though, to further look into I would radically isolate and simplify matters to exactly understand where it would break for your setup. So for example unlink the charts and work with one chart now only to begin with.

    Comment


      #3
      Bertrand,

      I tryed the early version of my script (cs.zip attached file) and it works. I added Instrument check and tick size to the last version (cs_1.zip attached file) and the problem is in them.

      I tried to get Instrument value and tick size value by the following

      #region Variables
      double ts;
      Instrument instr;
      #endregion

      protected override void OnStartUp()
      {
      ts = TickSize;
      instr = Instrument;
      }
      also I tried to get that values by
      public void listView1_SelectedIndexChanged(object sender, EventArgs e) and protected override void OnBarUpdate() methods.

      The script works good if I have executions at the current trade session and do not shut down the terminal (NT7). As soon as I shut down the terminal the script gives zero values of instr and does not work.

      But the early script work whether the terminal was shut down or not. It needs the current session trades only.

      I guess the problem is in Instrument and tick size method. On what method and how can I get Instrument and tick size values to my script.

      Regards.
      Attached Files

      Comment


        #4
        Alex, both instrument and ticksize access should be fine either in OnStartUp() or OnBarUpdate() since you would have an instrument / bars series by then to work with - debug prints at the time you would want to work with those values would confirm this.

        Most of the code used we could unfortunately not really support officially here, to continue debugging this script I would recommend making just one change at a time going from your first working version to the one that broke then. That way you can hopefully get a better handling on the Achilles heel here.

        Comment


          #5
          Also, just seen this issue for your scripts -

          Error on calling 'OnTermination' method for indicator 'cs': Object reference not set to an instance of an object.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          581 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          338 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X