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
-
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....
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.
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 NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment