Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding button on ToolStripButton bar

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

    Adding button on ToolStripButton bar

    Hello,

    I'd like to add some button on the ToolStripButton bar to open and close order.

    I use the same code in a indicator and I can see the new button in bar.


    private void InitializeControls()
    {
    try
    {

    System.Windows.Forms.Control[] controls = ChartControl.Controls.Find("tsrTool", false);
    if (controls.Length > 0)
    {
    btnShort = new System.Windows.Forms.ToolStripButton("btnShort");
    btnShort.ForeColor = Color.Black;
    btnShort.AutoSize = true;
    btnShort.BackColor = Color.DarkGray;
    btnShort.Text = "Short";
    strip = (System.Windows.Forms.ToolStrip)controls[0];
    strip.Items.Add(btnShort);
    btnShort.Click += btnShort_Click;

    }
    }
    catch (Exception ex)
    {
    Print(ex.ToString());
    }
    }

    Best Regards

    #2
    Hello,

    Thank you for the question.

    I am unsure of the question here, are you asking how to change what you have into something that would open and close orders?

    if so this would not be a supported item, I can provide some insight on problems or syntax errors you may have when using NinjaScript but this would be outside of the scope of support.

    If there is some issue you are running into please feel free to post the question here, if I can, I will assist you with this, otherwise we have quite a few members on the forum that deal with unsupported code who may be able to assist further than I can.

    can you please clarify what you are having difficulties with in this?

    I look forward to being of further assistance.

    Comment


      #3
      Hello,

      I'd like to add some button on the strategy chart ToolStripButton bar

      Best Regards
      Attached Files

      Comment


        #4
        Where did you add you strategy?

        Comment


          #5
          I know how to add a button on the chart ToolStripButton bar (I have the code and it's work fine)

          But I dont know if I can add a button on the strategy chart ToolStripButton bar.

          Comment


            #6
            Hello,

            If you had pulled this sample from the Drawing Tools Toolbar indicator here on the forum, this could be re created in a strategy as well, but you may have issues if you do not load the strategy in the chart I.E. loading the strategy in the control center.

            You would need to test that as it is un supported so it may or may not work as expected.

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X