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!
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
NinjaTrader
Display information from order placed with Chart Trader
Collapse
X
-
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 strategyTags: None
-
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
-
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
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
-
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.htmGaby V.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
8 responses
58 views
0 likes
|
Last Post Yesterday, 10:45 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
||
Started by gwenael, Today, 09:29 AM
|
0 responses
6 views
0 likes
|
Last Post
by gwenael
Today, 09:29 AM
|
Comment