Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Addon button for boolean variable

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

    #16
    if I open 2 strategy on one chart (2 different accounts ) which one will be connected to the buttons of that instance and that chart ?and the truth is that a strategy usually has nothing to do with the indicators on that chart so how will the strategy know which buttons are associated to this strategy
    do you mean that I would have to select plot on chart ...for the button to work with the strategy ?
    Last edited by yBl123; 01-10-2024, 11:27 AM.

    Comment


      #17
      Hello,

      Each strategy added to the chart is accessing a separate instance of the indicator, so two strategies mean two separate indicator instances. As mentioned, each indicator instance has its own button.

      When you access an indicator in a strategy, it is not actually adding it to the chart for display. This is done via AddChartIndicator(). So if you have two strategies calling the indicator and adding it via AddChartIndicator() for display, the indicator is being added to the chart twice.



      Please let me know if you have any further questions.

      Comment


        #18
        Thanks for this clarification ,so to be able to press the button I would indeed need to select plot to chart(this is a option in strategy builder ) for the button to be on the chart , do you know what happens if I add this twice on the same chart will pressing that button which is really 2 buttons on top of each other work for both ?
        ok I just tried with indicator you showed me and i see it does not stack the buttons on top of each other ,so i guess this wont work
        Last edited by yBl123; 01-10-2024, 12:10 PM.

        Comment


          #19
          Hello,

          Please note you cannot add plots in the Strategy Builder.

          It's possible that the indicator buttons would be layered on top of eachother if you have more than one instance added to the chart, if the indicator does not have code to identify if there is already a button within the User Control Collection or use something like a StackPanel. So if you add the indicator twice on the same chart, multiple buttons would be added layered on top of each other and clicking on a button would only affect the one instance of the indicator added by the specific strategy it is tied to.

          Take a look at SampleWPFModifications which demonstrates implementing custom logic for adding buttons to new rows in the Chart Trader area without having them overlap.



          Please let us know if you have any further questions.

          Comment


            #20
            Originally posted by NinjaTrader_Gaby View Post
            Hello,

            Please note you cannot add plots in the Strategy Builder.

            It's possible that the indicator buttons would be layered on top of eachother if you have more than one instance added to the chart, if the indicator does not have code to identify if there is already a button within the User Control Collection or use something like a StackPanel. So if you add the indicator twice on the same chart, multiple buttons would be added layered on top of each other and clicking on a button would only affect the one instance of the indicator added by the specific strategy it is tied to.

            Take a look at SampleWPFModifications which demonstrates implementing custom logic for adding buttons to new rows in the Chart Trader area without having them overlap.



            Please let us know if you have any further questions.
            is it possible with code to set up that if multiple buttons would be added layered on top of each other and clicking on the button would affect all buttons that are layered ?

            Comment


              #21
              Hello,

              No, that would not be possible.

              If you wanted to have the buttons be put side by side to eachother, you could do so using a StackPanel.

              The sample script linked in my previous post demonstrates using StackPanels.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              62 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              134 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X