BarsSinceExit can be used as well - http://www.ninjatrader.com/support/h...ssinceexit.htm
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Pairs trading
Collapse
X
-
Freddy, yes that would work if you're trying to place a bracket with 2 limits at the same time, then you would run into the order handling rules of the managed approach detailed here :
BarsSinceExit can be used as well - http://www.ninjatrader.com/support/h...ssinceexit.htmBertrandNinjaTrader Customer Service
-
BarsSinceExit could work on a profit target exit as well if you link it up with the lastTrade performance for example - http://www.ninjatrader.com/support/h.../nt7/trade.htm
So if the last trade was a winner (target hit) and BarsSinceEntry is at a cetain barcount do something....BertrandNinjaTrader Customer Service
Comment
-
Freddy, you can try for example this snippet :
Code:if (Performance.RealtimeTrades.Count > 0) { // Get the last completed real-time trade (at index 0) Trade lastTrade = Performance.RealtimeTrades[Performance.RealtimeTrades.Count - 1]; // Calculate the PnL for the last completed real-time trade in % double lastProfit = lastTrade.ProfitPercent; // Pring the PnL to the Output window Print("The last trade's % profit is " + lastProfit); }
Last edited by NinjaTrader_Bertrand; 08-25-2011, 10:18 AM.BertrandNinjaTrader Customer Service
Comment
-
Hi Freddy,
You can do this with a bool flag. Include a check to this bool flag within your entry conditions. After the order is submitted, set to the opposite direction so that your condition no longer evaluates true.
You can use Bars.FirstBarOfSession to reset this bool flag for each new trading session.
Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by adeelshahzad, Today, 11:49 AM
|
6 responses
23 views
0 likes
|
Last Post
by mcosta72
Today, 04:35 PM
|
||
Started by sidlercom80, 05-05-2020, 07:20 AM
|
4 responses
304 views
0 likes
|
Last Post
by Bidder
Today, 04:35 PM
|
||
Started by andrew56, 11-21-2017, 11:57 AM
|
6 responses
954 views
0 likes
|
Last Post
by Bidder
Today, 04:34 PM
|
||
Indicator categories collapse, CategoryDefaultExpanded/CategoryExpanded has no effect
by Shai Samuel
Started by Shai Samuel, 08-09-2022, 04:41 AM
|
6 responses
184 views
1 like
|
Last Post
by Bidder
Today, 04:32 PM
|
||
Started by TheTradingMantis, 10-31-2017, 03:18 PM
|
5 responses
1,251 views
0 likes
|
Last Post
by TheAngryCube
Today, 04:06 PM
|
Comment