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

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.
    Gaby V.NinjaTrader Customer Service

    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.
        Gaby V.NinjaTrader Customer Service

        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:	86
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
            Gaby V.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            5 views
            0 likes
            Last Post Option Whisperer  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            8 responses
            58 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by halgo_boulder, 04-20-2024, 08:44 AM
            2 responses
            22 views
            0 likes
            Last Post halgo_boulder  
            Started by mishhh, 05-25-2010, 08:54 AM
            19 responses
            6,189 views
            0 likes
            Last Post rene69851  
            Started by gwenael, Today, 09:29 AM
            0 responses
            6 views
            0 likes
            Last Post gwenael
            by gwenael
             
            Working...
            X