Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add buttons to Chart Trader to trade a Market Generated Signal

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

    Add buttons to Chart Trader to trade a Market Generated Signal

    I developing a indicator to use buttons added to Chart Trader that will trade based on signals developed by market activity.
    It will then use an ATM Strategy and manage it manually by use the Chart Trader ATM.
    I have this working in NT 7 but want to move to NT 8.

    Just working on getting the buttons on the Chart Trader panel at this point.

    I'm using the sample code "ChartTraderCustomButtonsExample"

    I'm trying to add buttons but having a problem. I have the first Row added but now trying to add a second row.
    I used the "System.Windows.Controls.Grid.SetRow(); but its over writing the button in row 1.
    How do I set this correctly?



    Attached Files

    #2
    Hello Taddypole,

    I cant tell from the images what may be the problem, did you add another row to the grids row definitions?


    Comment


      #3
      Sorry Jesse...
      I thought I had attached the code i'm working on...
      Here it is...

      Attached Files

      Comment


        #4
        Hello Taddypole,

        I don't see that you have added any rows to the grid, you would need to add rows in addition to columns to the lowerButtonsGrid. You can see where the columns are added at line 186, the same would need to be done if you wanted multiple rows. You can add rows to the RowDefinitions collection. Once a grid has rows you can use the Grid.SetRow method to specify where a control goes inside that grid.

        Comment


          #5
          Thank you for that Jesse. I now have my buttons added to Chart Trader as per the attached pic.


          Click image for larger version

Name:	buttons added.png
Views:	865
Size:	903.1 KB
ID:	1188580

          Next I'm trying to add a Linear Regression indicator. I've taken it from the App share area.
          I've brought all the code in for the linear regression indicator from "BltTriggerLines" but am having a problem I can't figure out.
          I'm getting an index out of bounds on the Trigger plot variable.

          Wondering if you or someone else can help with the trigger plot i'm trying to add...
          I don't understand what could cause this error...


          Click image for larger version

Name:	Trigger threw an exception.png
Views:	869
Size:	541.9 KB
ID:	1188579




          Comment


            #6
            The problem seems to be with the Trigger[0] double series. But when I review both indicators, I have the following:

            private void Initialize()
            {
            AddPlot(new Stroke(Brushes.Green, 2), PlotStyle.Line, "Trigger");
            AddPlot(new Stroke(Brushes.Red, 2), PlotStyle.Line, "Average");
            }

            protected override void OnBarUpdate()
            {
            Trigger[0] = LinReg(Input, TriggerPeriod)[0];
            Average[0] = EMA(Trigger, AveragePeriod)[0]}
            }

            #region Property Grid

            [Browsable(false)]
            [XmlIgnore()]
            public Series<double> Trigger
            {
            get { return Values[0]; }
            }

            [Browsable(false)]
            [XmlIgnore()]
            public Series<double> Average
            {
            get { return Values[1]; }
            }


            Since these code snippets are the same for both indicators, how could the index be out of range on one and working on the other?

            I would think the issue would be contained in the above code.
            I'm stumped.

            Comment


              #7
              Hello Taddypole,

              The indicator is using Plots and the Values collection points to a specific plot. You would need to AddPlot the same plots from the TriggerLines indicator into yours if you are trying to merge the code.

              I see you made a private void Initialize() but that is not called anywhere in your code. You could move the AddPlot statements to OnStateChange instead to correct that.

              Comment


                #8
                That helped Jesse...
                thank you....

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                578 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                334 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
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X