Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

AtmStrategySelector is working badly in AddonFrameworkBasic

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

    AtmStrategySelector is working badly in AddonFrameworkBasic

    Hello

    I have noticed something in the AddonFramework that is working wrong. If order quantity is edited in one of the strategies, all other strategies change in order quantity as well. I realized this because in my addon I used the code of the AddonFrameworkBasic that you share and I saw that when I changed the strategy, the value in qudselector did not change.

    How could this be solved so that all strategies are not updated with the same value as the other strategies when they are edited?

    #2
    Hello jleira, thanks for writing in.

    Could you give screenshots and a description of what you are reporting? Everything looks fine to me testing the sample Addon.

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Goodmorning ChrisL

      Each ATMStrategy that I have created had a different number of contracts configured. However, when I edit the contract amount of only one of them, all of the other strategies take the same number of contracts that I had not edited. I don't even enter the other strategies, nor do I change anything in the other strategies, but when reviewing them, they all have the quantity orders changed too.

      Example if in a strategy I change the number of contracts to 1, all the other strategies are updated to 1 as well and that is not right. Something is not working fine. This is only happening in the AddonFrameworkSample.
      Attached Files

      Comment


        #4
        Hello jleira, thanks for your reply. I tested again and I do see the same issue. I'll report it to our product management team.

        Thanks in advance.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thank you ChrisL

          I will wait for some solution from them because I really need it.

          Regards

          Comment


            #6
            ChrisL

            I think I found the problem, when you modify the qudselector of the addon, the order quantity parameter of all the strategies you have created are updated. So I found a solution to the issue but I don't know if it is the best solution. In the * .xaml file I went to the line: AtmStrategy: AtmStrategySelector and I found this: LinkedQuantity = "{Binding Value, ElementName = qudSelector, Mode = OneWay}". I take it off.

            Code:
            <AtmStrategy:AtmStrategySelector x:Name="atmStrategySelector" [SIZE=14px][B]LinkedQuantity="{Binding Value, ElementName=qudSelector, Mode=OneWay}"[/B][/SIZE] Grid.Row="8" Width="140" Height="22" HorizontalAlignment="Left" Margin="5,3,0,1" VerticalAlignment="Center"/>
            Then, I added in atmStrategySelector.SelectionChanged + = (or, args) =>, the following: qudSelector.Value = selectedStrategy.EntryQuantity; so that when the selector is changed, the quantity of the Addons qudselector is updated
            Code:
            atmStrategySelector.SelectionChanged += (o, args) =>
            {
              if (atmStrategySelector.SelectedItem == null)
              {
                return;
              }
              if (args.AddedItems.Count > 0)
              {
                NinjaTrader.NinjaScript.AtmStrategy selectedStrategy = args.AddedItems[0] as NinjaTrader.NinjaScript.AtmStrategy;
                if (selectedStrategy != null)
                {
                  tifSelector.SelectedTif = selectedStrategy.TimeInForce;
            [SIZE=14px][B]     qudSelector.Value = selectedStrategy.EntryQuantity;[/B][/SIZE] [SIZE=14px][COLOR=#27ae60][B]// I ADDED THIS LINE[/B][/COLOR][/SIZE]
                }
            }
            Now it seems to be working correctly but I don't know if this is the correct solution. Let me know if you consider this correction adequate and that it does not affect other things that perhaps in my tests I am not realizing

            Comment


              #7
              Hello jleira, thanks for your reply.

              I will suggest we change the Addon example to the way Chart Trader and SuperDOM handle it, they use TwoWay binding between the quantity selector and the ATM editor. If you have tested the change you made here and it works well feel free to use this method instead.

              Best regards.
              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Davide999, 05-18-2023, 03:55 AM
              4 responses
              554 views
              1 like
              Last Post kcwasher  
              Started by Stanfillirenfro, Today, 07:23 AM
              2 responses
              9 views
              0 likes
              Last Post Stanfillirenfro  
              Started by rexsole, Today, 08:39 AM
              2 responses
              6 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by cmtjoancolmenero, Yesterday, 03:58 PM
              6 responses
              29 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by gbourque, Today, 06:39 AM
              2 responses
              14 views
              0 likes
              Last Post gbourque  
              Working...
              X