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:	188
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 cmoran13, 04-16-2026, 01:02 PM
            0 responses
            42 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            25 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            162 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            157 views
            2 likes
            Last Post CaptainJack  
            Working...
            X