Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Display information from order placed with Chart Trader

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

    Display information from order placed with Chart Trader

    is there a way to access the info like target, entry & stop from an order placed with chart trader? I'd like to make an indicator to use the info but don't know how to grab it if I didn't place the order with a strategy

    #2
    Hello cre8able,

    Thank you for your post.

    You can use the Account class from AddOn to access information on Orders placed to the account selected in Chart Trader.

    AddOn Account class - https://ninjatrader.com/support/helpGuides/nt8/account_class.htm

    Orders - https://ninjatrader.com/support/help...rs_account.htm

    Please let me know if you have any further questions.

    Comment


      #3
      thank you Gaby

      How do i get the current account in the chart trader? Not Sim101, unless that is what chart trader is using

      myAccount = Account.All.FirstOrDefault(a => a.Name == "Sim101");

      Comment


        #4
        Hello,

        Please see the forum post linked below which has an example script demonstrating how to get the account selected in the Chart Trader.



        If you have any further questions, please let me know.

        Comment


          #5
          a little more help. I'm trying to get the three values shown for an open order. Stop, Target and Entry, which is order.AverageFillPrice... the only one I seem to be able to get


          Click image for larger version

Name:	image.png
Views:	184
Size:	25.8 KB
ID:	1286255

          What do I need to change to get the other 2 values?

          HTML Code:
                      foreach (Order order in myAccount.Orders)
                      {
                          if(order.OrderType == OrderType.Market)
                          {
                          Print("market  " +order.ToString() + "   " + order.AverageFillPrice);            
                          }
                          
                          if(order.OrderType == OrderType.StopLimit)
                          {
                          Print("stop" + order.StopPrice);            
                          }​

          Also, how do I limit the information to only the open order? After the order is closed, I still get the order.AverageFillPrice.

          What is the correct syntax for only "active" orders?

          Comment


            #6
            Hello,


            If these are seperate orders, you can use:


            Code:
            if(order.OrderType == OrderType.StopMarket)
            
            {
            
            Print("stop" + order.StopPrice);
            
            }​

            and


            Code:
            if(order.OrderType == OrderType.Limit)
            
            {
            
            Print("stop" + order.LimitPrice);
            
            }​



            Or,


            Code:
            if(order.OrderType == OrderType.StopLimit)
            
            {
            
            Print("stop" + order.LimitPrice);
            
            Print("stop" + order.StopPrice);
            
            }​


            You can add a condition to check for only working orders or orders that are not filled by adding a condition to check for order state, such as orderState.Filled or orderState.Working.


            Order - https://ninjatrader.com/support/help.../nt8/order.htm

            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