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

Imitating Chart Trader Button Behaviors using Additional buttons

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

    Imitating Chart Trader Button Behaviors using Additional buttons

    Current Scenario: I am using Chart Trader Buy/Sell Buttons along with defined ATM strategy. When using those button i have to change the quantity for the different sizes.
    What I want is:
    I want to add custom buttons on chart trader with a specified size while using the same ATM strategy as selected so that i don't have to enter the quantity every time.

    Now, i am able to add the button on chart trader to buy and sell different sizes e.g. 100, 50, 20, 10 however i am not able to see the stop loss and target marker on the chart. Also my stop loss doesn't get automatically updated when i peel off my position (partial sell). Where as if I use the original Chart Trader Buy sell buttons, it automatically adjusts my stoploss/target quantity as I peel off my position. How Can i imitate this behavior for my custom buttons.

    Thanks
    g

    #2
    Hello gbajaj,

    Could it be the ATM orders are outside the visible display of the chart? Please right click in ChartTrader and select 'Properties'. Enable the 'Auto scale' setting and click OK. Check if you now see the ATM orders.

    What setting do you have selected for 'ATM strategy selection mode' in the ChartTrader Properties? If you set it to 'Select active ATM strategy on order submission', does the stop loss automatically update when you scale out of the position? This works for me when I test it.

    Could you please send me a screenshot that shows the buttons you added. Do you use a 3rd party add-on that allows you to create these buttons?
    JasonNinjaTrader Customer Service

    Comment


      #3
      Looks like i am not able to explain my question very well.

      What i want is that my custom buttons to behave similar to the predefined buttons.
      I have written the code myself and here is the Buy order for my B-100 button.

      myAccount.CreateOrder(Instrument, OrderAction.Sell, OrderType.Market, OrderEntry.Manual, TimeInForce.Day, 100, 0, 0, "", "Exit", DateTime.MaxValue, null);
      now as evident from code, it's doing it's own thing, no ATM strategy is part to the api call params here.

      My question is:
      What should I add to this code so i could use the ATM strategy current selected.
      Attached Files

      Comment


        #4
        Hello gbajaj,

        Your custom buttons wont have access to just use the existing ATM selector for an ATM, you would need to find what template is selected in that control and then use StartAtmStrategy().

        There is an example of that concept here: https://ninjatrader.com/support/foru...egy#post752775

        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        26 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by bmartz, 03-12-2024, 06:12 AM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by Aviram Y, Today, 05:29 AM
        2 responses
        9 views
        0 likes
        Last Post Aviram Y  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X